From d9654fbe46ae04474b7f1fed17884d76beb60f52 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 2 Feb 2021 08:19:52 -0800 Subject: [PATCH] Add some tests --- src/test/shell/bazel/java_launcher_test.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/shell/bazel/java_launcher_test.sh b/src/test/shell/bazel/java_launcher_test.sh index 81ef4b7dc145f0..bc0c6b00d515e0 100755 --- a/src/test/shell/bazel/java_launcher_test.sh +++ b/src/test/shell/bazel/java_launcher_test.sh @@ -57,6 +57,16 @@ java_binary( deps = [":hellolib"], main_class = "hello.Hello", ) +java_library( + name = "hellolib%special%lib", + srcs = ["HelloLib.java"], +) +java_binary( + name = "hello_special", + srcs = ["Hello.java"], + deps = [":hellolib%special%lib"], + main_class = "hello.Hello", +) EOF bazel build //$pkg/java/hello:hello || fail "expected success" ${PRODUCT_NAME}-bin/$pkg/java/hello/hello >& "$TEST_log" || \ @@ -66,6 +76,15 @@ EOF ${PRODUCT_NAME}-bin/$pkg/java/hello/hello --classpath_limit=0 >& "$TEST_log" || \ fail "expected success" expect_log "Hello World!" + + bazel build //$pkg/java/hello:hello_special || fail "expected success" + ${PRODUCT_NAME}-bin/$pkg/java/hello/hello_special >& "$TEST_log" || \ + fail "expected success" + expect_log "Hello World!" + + ${PRODUCT_NAME}-bin/$pkg/java/hello/hello_special --classpath_limit=0 >& "$TEST_log" || \ + fail "expected success" + expect_log "Hello World!" } run_suite "Java launcher tests"