aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools/junitrunner/javatests/com/google/testing/junit
diff options
context:
space:
mode:
authorGravatar Kush Chakraborty <kush@google.com>2017-02-24 00:17:21 +0000
committerGravatar Irina Iancu <elenairina@google.com>2017-02-24 08:31:30 +0000
commitc67080c787cf0d176a91564c981b2366242d6c19 (patch)
tree873ede500711beb21e9b96a67310cc4e3de5c2ca /src/java_tools/junitrunner/javatests/com/google/testing/junit
parent5e945570ec0b9079596756bf89437ac37e031c36 (diff)
*** Reason for rollback *** Breaks dagger []: [] *** Original change description *** Separate the classpaths of the TestRunner with the test target, and use a separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH envi... *** -- PiperOrigin-RevId: 148405598 MOS_MIGRATED_REVID=148405598
Diffstat (limited to 'src/java_tools/junitrunner/javatests/com/google/testing/junit')
-rw-r--r--src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD14
-rwxr-xr-xsrc/java_tools/junitrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh4
-rwxr-xr-xsrc/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh7
-rwxr-xr-xsrc/java_tools/junitrunner/javatests/com/google/testing/junit/runner/utf8_test_log_test.sh4
4 files changed, 2 insertions, 27 deletions
diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD
index 3ba2806cf2..95327df8ab 100644
--- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD
+++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/BUILD
@@ -68,12 +68,8 @@ sh_test(
args = [
"$(location :TestbedBinary)",
"bazel.test_suite",
- "$(location //src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar)",
- ],
- data = [
- ":TestbedBinary",
- "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar",
],
+ data = [":TestbedBinary"],
shard_count = 0,
deps = [":testenv"],
)
@@ -85,12 +81,8 @@ sh_test(
args = [
"$(location :TestbedBinary)",
"bazel.test_suite",
- "$(location //src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar)",
- ],
- data = [
- ":TestbedBinary",
- "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar",
],
+ data = [":TestbedBinary"],
shard_count = 0,
deps = [":testenv"],
)
@@ -103,12 +95,10 @@ sh_test(
"$(location :TestbedBinary)",
"$(location //src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:XmlOutputExercises.ant.xml)",
"bazel.test_suite",
- "$(location //src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar)",
],
data = [
":TestbedBinary",
"//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:XmlOutputExercises.ant.xml",
- "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:libtestbed.jar",
],
shard_count = 0,
deps = [":testenv"],
diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh
index b79ccf14fe..609518a6bf 100755
--- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh
+++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/antxmlresultwriter_integration_test.sh
@@ -25,7 +25,6 @@ XML_OUTPUT_FILE="${TEST_TMPDIR}/test.xml"
SUITE_PARAMETER="$3"
SUITE="com.google.testing.junit.runner.testbed.XmlOutputExercises"
SUITE_FLAG="-D${SUITE_PARAMETER}=${SUITE}"
-TESTBED_LIB_LOCATION="${PWD}/$4"
shift 3
source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; }
@@ -33,9 +32,6 @@ source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; }
function test_XmlOutputExercises() {
cd $TEST_TMPDIR
- # Pass the test target classpath through the environment variable
- declare -x TEST_TARGET_CLASSPATH="$TESTBED_LIB_LOCATION"
-
$TESTBED --jvm_flag=${SUITE_FLAG} || true # Test failures
# Remove timestamps and test runtime from the XML files as they will always differ and cause a
diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh
index 470fece506..b44c34783b 100755
--- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh
+++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/junit4_testbridge_integration_tests.sh
@@ -25,7 +25,6 @@ DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
TESTBED="${PWD}/$1"
SUITE_PARAMETER="$2"
-TESTBED_LIB_LOCATION="${PWD}/$3"
SUITE_FLAG="-D${SUITE_PARAMETER}=com.google.testing.junit.runner.testbed.JUnit4TestbridgeExercises"
XML_OUTPUT_FILE="${TEST_TMPDIR}/test.xml"
@@ -43,9 +42,6 @@ function set_up() {
function test_Junit4() {
cd $TEST_TMPDIR
- # Pass the test target classpath through the environment variable
- declare -x TEST_TARGET_CLASSPATH="$TESTBED_LIB_LOCATION"
-
# Run the test without environment flag; it should fail.
declare +x TESTBRIDGE_TEST_ONLY
$TESTBED --jvm_flag=${SUITE_FLAG} >& $TEST_log && fail "Expected failure"
@@ -70,9 +66,6 @@ function test_Junit4() {
function test_Junit4FlagOverridesEnv() {
cd $TEST_TMPDIR
- # Pass the test target classpath through the environment variable
- declare -x TEST_TARGET_CLASSPATH="$TESTBED_LIB_LOCATION"
-
# Run the test with both environment and command line flags.
declare -x TESTBRIDGE_TEST_ONLY="doNotRun"
$TESTBED --jvm_flag=${SUITE_FLAG} --test_filter doRun >& $TEST_log || \
diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/utf8_test_log_test.sh b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/utf8_test_log_test.sh
index 96dfaee784..3b2c47c7bb 100755
--- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/utf8_test_log_test.sh
+++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/utf8_test_log_test.sh
@@ -23,7 +23,6 @@ TESTBED="${PWD}/$1"
SUITE_PARAMETER="$2"
SUITE_FLAG="-D${SUITE_PARAMETER}=com.google.testing.junit.runner.testbed.InternationalCharsTest"
XML_OUTPUT_FILE="${TEST_TMPDIR}/test.xml"
-TESTBED_LIB_LOCATION="${PWD}/$3"
unset TEST_PREMATURE_EXIT_FILE
shift 2
@@ -36,9 +35,6 @@ function expect_log() {
}
function test_utf8_log() {
- # Pass the test target classpath through the environment variable
- declare -x TEST_TARGET_CLASSPATH="$TESTBED_LIB_LOCATION"
-
$TESTBED --jvm_flag=${SUITE_FLAG} > $TEST_log && fail "Expected failure"
expect_log 'expected:<Test [Japan].> but was:<Test [日本].>'