Skip to content

Commit 5d4442e

Browse files
hvadehrarules_java Copybara
authored andcommitted
Add a test for java_common.JavaPluginInfo
PiperOrigin-RevId: 729512644 Change-Id: Ie2319bec47dea26abdf12e853843f8b70f4d4357
1 parent 31566a6 commit 5d4442e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

java/test/common/java_common_tests.bzl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
load("@rules_testing//lib:analysis_test.bzl", "analysis_test", "test_suite")
44
load("@rules_testing//lib:util.bzl", "util")
55
load("//java:java_library.bzl", "java_library")
6+
load("//java/common:java_common.bzl", "java_common")
7+
load("//java/common:java_plugin_info.bzl", "JavaPluginInfo")
68
load("//java/test/testutil:java_info_subject.bzl", "java_info_subject")
79
load("//java/test/testutil:rules/custom_library.bzl", "custom_library")
810
load("//java/test/testutil:rules/custom_library_with_exports.bzl", "custom_library_with_exports")
@@ -58,12 +60,27 @@ def _test_compile_exports_no_sources_impl(env, target):
5860
["{package}/libjl.jar"],
5961
)
6062

63+
def _test_java_plugin_info(name):
64+
util.helper_target(native.filegroup, name = name + "/dummy")
65+
analysis_test(
66+
name = name,
67+
impl = _test_java_plugin_info_impl,
68+
target = name + "/dummy", # analysis_test always expects a target
69+
)
70+
71+
def _test_java_plugin_info_impl(env, _target):
72+
env.expect.that_bool(
73+
java_common.JavaPluginInfo == JavaPluginInfo,
74+
"java_common.JavaPluginInfo == JavaPluginInfo",
75+
).equals(True)
76+
6177
def java_common_tests(name):
6278
test_suite(
6379
name = name,
6480
tests = [
6581
_test_compile_default_values,
6682
_test_compile_sourcepath,
6783
_test_compile_exports_no_sources,
84+
_test_java_plugin_info,
6885
],
6986
)

0 commit comments

Comments
 (0)