summaryrefslogtreecommitdiff
path: root/java/sdk_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/sdk_test.go')
-rw-r--r--java/sdk_test.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/java/sdk_test.go b/java/sdk_test.go
index 2dac27af1..9bfe6a2b5 100644
--- a/java/sdk_test.go
+++ b/java/sdk_test.go
@@ -391,15 +391,19 @@ func TestClasspath(t *testing.T) {
t.Parallel()
t.Run("basic", func(t *testing.T) {
t.Parallel()
- testClasspathTestCases(t, classpathTestcases, false)
+ testClasspathTestCases(t, classpathTestcases, false, false)
})
t.Run("Always_use_prebuilt_sdks=true", func(t *testing.T) {
- testClasspathTestCases(t, classpathTestcases, true)
+ testClasspathTestCases(t, classpathTestcases, true, false)
+ })
+
+ t.Run("UseTransitiveJarsInClasspath", func(t *testing.T) {
+ testClasspathTestCases(t, classpathTestcases, false, true)
})
}
-func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase, alwaysUsePrebuiltSdks bool) {
+func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase, alwaysUsePrebuiltSdks, useTransitiveJarsInClasspath bool) {
for _, testcase := range classpathTestcases {
if testcase.forAlwaysUsePrebuiltSdks != nil && *testcase.forAlwaysUsePrebuiltSdks != alwaysUsePrebuiltSdks {
continue
@@ -437,7 +441,14 @@ func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase
convertModulesToPaths := func(cp []string) []string {
ret := make([]string, len(cp))
for i, e := range cp {
- ret[i] = defaultModuleToPath(e)
+ switch {
+ case e == `""`, strings.HasSuffix(e, ".jar"):
+ ret[i] = e
+ case useTransitiveJarsInClasspath:
+ ret[i] = filepath.Join("out", "soong", ".intermediates", defaultJavaDir, e, "android_common", "turbine", e+".jar")
+ default:
+ ret[i] = filepath.Join("out", "soong", ".intermediates", defaultJavaDir, e, "android_common", "turbine-combined", e+".jar")
+ }
}
return ret
}
@@ -531,6 +542,9 @@ func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
})
}
+ if useTransitiveJarsInClasspath {
+ preparer = PrepareForTestWithTransitiveClasspathEnabled
+ }
fixtureFactory := android.GroupFixturePreparers(
prepareForJavaTest,