summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorJeongik Cha <jeongik@google.com>2019-06-30 19:53:19 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-06-30 19:53:19 -0700
commit218964e76eca4e4c86f2f2d486bbb4538e09bc10 (patch)
treef5572f7ccac05ae60800f77f4187857e64ddedad /java/java_test.go
parente34e7eacd1e13b8be667694755d9452b0295090a (diff)
parent7a22534a47a93c3a38a32d30e834a5af108947f3 (diff)
Merge "Enforce hidden api usage in vendor (soong)" am: e65d84c84c
am: 7a22534a47 Change-Id: Iffbacc0f98fb208e6f71919bcefa19cb0e57efca
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index a4b20ceaf..96ecdb689 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -286,6 +286,32 @@ func TestSimple(t *testing.T) {
}
}
+func TestSdkVersion(t *testing.T) {
+ ctx := testJava(t, `
+ java_library {
+ name: "foo",
+ srcs: ["a.java"],
+ vendor: true,
+ }
+
+ java_library {
+ name: "bar",
+ srcs: ["b.java"],
+ }
+ `)
+
+ foo := ctx.ModuleForTests("foo", "android_common").Module().(*Library)
+ bar := ctx.ModuleForTests("bar", "android_common").Module().(*Library)
+
+ if foo.sdkVersion() != "system_current" {
+ t.Errorf("If sdk version of vendor module is empty, it must change to system_current.")
+ }
+
+ if bar.sdkVersion() != "" {
+ t.Errorf("If sdk version of non-vendor module is empty, it keeps empty.")
+ }
+}
+
func TestArchSpecific(t *testing.T) {
ctx := testJava(t, `
java_library {