summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-01-10 00:16:52 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-01-10 00:16:52 +0000
commitec3887ad2f2265e3edfe748aa7cd562f324e138d (patch)
tree2571ff27d9d6aa1f04d4b2d23c2a7f84e0b858bb /java/java_test.go
parentb087a045831c97e14b9738b4c3885c0bf28d10f1 (diff)
parent59a4a2b8d210e74e6625794f954bd11bb6157002 (diff)
Merge "Replace panic with ModuleErrorf" into main
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 8d96184d4..0891ab634 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -528,6 +528,15 @@ func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) {
}
}
+// A minimal context object for use with DexJarBuildPath
+type moduleErrorfTestCtx struct {
+}
+
+func (ctx moduleErrorfTestCtx) ModuleErrorf(format string, args ...interface{}) {
+}
+
+var _ android.ModuleErrorfContext = (*moduleErrorfTestCtx)(nil)
+
func TestPrebuilts(t *testing.T) {
ctx, _ := testJava(t, `
java_library {
@@ -595,7 +604,8 @@ func TestPrebuilts(t *testing.T) {
t.Errorf("foo classpath %v does not contain %q", javac.Args["classpath"], barJar.String())
}
- barDexJar := barModule.Module().(*Import).DexJarBuildPath()
+ errCtx := moduleErrorfTestCtx{}
+ barDexJar := barModule.Module().(*Import).DexJarBuildPath(errCtx)
if barDexJar.IsSet() {
t.Errorf("bar dex jar build path expected to be set, got %s", barDexJar)
}
@@ -608,7 +618,7 @@ func TestPrebuilts(t *testing.T) {
t.Errorf("foo combineJar inputs %v does not contain %q", combineJar.Inputs, bazJar.String())
}
- bazDexJar := bazModule.Module().(*Import).DexJarBuildPath().Path()
+ bazDexJar := bazModule.Module().(*Import).DexJarBuildPath(errCtx).Path()
expectedDexJar := "out/soong/.intermediates/baz/android_common/dex/baz.jar"
android.AssertPathRelativeToTopEquals(t, "baz dex jar build path", expectedDexJar, bazDexJar)