summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2021-03-13 09:55:25 +0000
committerPaul Duffin <paulduffin@google.com>2021-03-18 08:02:38 +0000
commit76101fa5ece8e74a3b5a409185af00c9fa25c4d6 (patch)
tree489e12a237b88098c79c5cceed057035f01d941a /java/java_test.go
parente26e597fc86f9959bc79e9c7b6cc069144fd1a7a (diff)
Convert TestClasspath to test fixtures
The main complication with this change was that many of the tests check paths that are provided by the default java modules. The location of them is different in the test fixtures that it is when using testConfig() and so the test needed to be changed. Bug: 182638834 Test: m nothing Change-Id: I6d325dbd3ba39e5de7e53c576d7cfe07bd95a965
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 2eb724185..533055618 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -247,7 +247,14 @@ func moduleToPath(name string) string {
// defaultModuleToPath constructs a path to the turbine generate jar for a default test module that
// is defined in PrepareForIntegrationTestWithJava
func defaultModuleToPath(name string) string {
- return filepath.Join(buildDir, ".intermediates", defaultJavaDir, name, "android_common", "turbine-combined", name+".jar")
+ switch {
+ case name == `""`:
+ return name
+ case strings.HasSuffix(name, ".jar"):
+ return name
+ default:
+ return filepath.Join(buildDir, ".intermediates", defaultJavaDir, name, "android_common", "turbine-combined", name+".jar")
+ }
}
func TestJavaLinkType(t *testing.T) {