6491461: 3/3 TEST: java/lang/instrument .sh tests need to use $TESTVMOPTS in their java commands
authordcubed
Mon, 24 Mar 2008 15:42:37 -0700
changeset 276 57cf064fc997
parent 275 9b31d45a4c80
child 277 9d9c1747de00
6491461: 3/3 TEST: java/lang/instrument .sh tests need to use $TESTVMOPTS in their java commands Summary: Add ${TESTVMOPTS} to java test execution command(s). Reviewed-by: sspitsyn
jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh
jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh
jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh
--- a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -23,7 +23,7 @@
 
 # @test
 # @bug 5055293
-# @summary Test non US-ASCII characters in the value of the Boot-Class-Path 
+# @summary Test non US-ASCII characters in the value of the Boot-Class-Path
 #          attribute.
 
 if [ "${TESTJAVA}" = "" ]
@@ -72,7 +72,7 @@
 
 echo "Running test..."
 
-"${JAVA}" -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
+"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTCLASSES}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
 result=$?
 
 echo "Cleanup..."
--- a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -49,7 +49,7 @@
 
 "$JAVAC" -d "${TESTCLASSES}" "${TESTSRC}"/DummyMain.java
 
-"${JAVA}" -javaagent:"${TESTSRC}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
+"${JAVA}" ${TESTVMOPTS} -javaagent:"${TESTSRC}"/Agent.jar -classpath "${TESTCLASSES}" DummyMain
 result=$?
 
 exit $result
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -33,7 +33,7 @@
   echo "TESTSRC not set.  Test cannot execute.  Failed."
   exit 1
 fi
-                                                                                                        
+
 . ${TESTSRC}/CommonSetup.sh
 
 # Setup to create circularity condition
@@ -71,5 +71,5 @@
   -C "${TESTCLASSES}" CircularityErrorTest.class
 
 # Finally we run the test
-(cd "${TESTCLASSES}"; 
-  $JAVA -javaagent:CircularityErrorTest.jar CircularityErrorTest)
+(cd "${TESTCLASSES}";
+  $JAVA ${TESTVMOPTS} -javaagent:CircularityErrorTest.jar CircularityErrorTest)
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -34,11 +34,11 @@
   echo "TESTSRC not set.  Test cannot execute.  Failed."
   exit 1
 fi
-                                                                                                        
+
 . ${TESTSRC}/CommonSetup.sh
 
 # Create Foo and Bar
-# Foo has a reference to Bar but we deleted Bar so that 
+# Foo has a reference to Bar but we deleted Bar so that
 # a NoClassDefFoundError will be thrown when Foo tries to
 # resolve the reference to Bar
 
@@ -53,11 +53,11 @@
   public class Foo {
       public static boolean doSomething() {
           try {
-	      Bar b = new Bar();
-	      return true;
-	  } catch (NoClassDefFoundError x) {
-	      return false;
-	  }
+              Bar b = new Bar();
+              return true;
+          } catch (NoClassDefFoundError x) {
+              return false;
+          }
       }
   }
 EOF
@@ -79,5 +79,5 @@
 
 # Finally we run the test
 (cd "${TESTCLASSES}"; \
-  $JAVA -Xverify:none -XX:+TraceClassUnloading -javaagent:ClassUnloadTest.jar \
-    ClassUnloadTest "${OTHERDIR}" Bar.jar)
+  $JAVA ${TESTVMOPTS} -Xverify:none -XX:+TraceClassUnloading \
+    -javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -24,7 +24,6 @@
 #
 
 
-#%E
 #
 # Common setup for unit tests. Setups up the following variables:
 #
@@ -66,7 +65,7 @@
   echo "TESTSRC not set.  Test cannot execute.  Failed."
   exit 1
 fi
- 
+
 if [ "${TESTCLASSES}" = "" ]
 then
   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh	Mon Mar 24 15:26:24 2008 -0700
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh	Mon Mar 24 15:42:37 2008 -0700
@@ -23,10 +23,10 @@
 # have any questions.
 #
 
-                                                                                                              
+
 # @test
 # @bug 6173575 6388987
-# @summary Unit tests for appendToBootstrapClassLoaderSearch and 
+# @summary Unit tests for appendToBootstrapClassLoaderSearch and
 #   appendToSystemClasLoaderSearch methods.
 #
 # @build Agent AgentSupport BootSupport BasicTest PrematureLoadTest DynamicTest
@@ -37,10 +37,10 @@
   echo "TESTSRC not set.  Test cannot execute.  Failed."
   exit 1
 fi
-                                                                                                        
+
 . ${TESTSRC}/CommonSetup.sh
 
-                                                                          
+
 # Simple tests
 
 echo "Creating jar files for simple tests..."
@@ -50,13 +50,13 @@
 "$JAR" -cfm Agent.jar "${TESTSRC}"/manifest.mf Agent.class
 "$JAR" -cf  AgentSupport.jar AgentSupport.class
 "$JAR" -cf  BootSupport.jar BootSupport.class
-"$JAR" -cf  SimpleTests.jar BasicTest.class PrematureLoadTest.class 
+"$JAR" -cf  SimpleTests.jar BasicTest.class PrematureLoadTest.class
 
 failures=0
 
 go() {
     echo ''
-    sh -xc "$JAVA -javaagent:Agent.jar -classpath SimpleTests.jar  $1 $2 $3" 2>&1
+    sh -xc "$JAVA ${TESTVMOPTS} -javaagent:Agent.jar -classpath SimpleTests.jar  $1 $2 $3" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
@@ -75,7 +75,7 @@
 "${JAVAC}" -d tmp "${TESTSRC}"/Tracer.java
 (cd tmp; "${JAR}" cf ../Tracer.jar org/tools/Tracer.class)
 
-# InstrumentedApplication is Application+instrmentation - don't copy as 
+# InstrumentedApplication is Application+instrmentation - don't copy as
 # we don't want the original file permission
 
 cat "${TESTSRC}"/InstrumentedApplication.java > ./Application.java
@@ -85,11 +85,11 @@
 cp "${TESTSRC}"/Application.java .
 "${JAVAC}" -d . Application.java
 
-sh -xc "$JAVA -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar DynamicTest" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # Repeat test with security manager
-sh -xc "$JAVA -classpath . -javaagent:Agent.jar -Djava.security.manager DynamicTest" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} -classpath . -javaagent:Agent.jar -Djava.security.manager DynamicTest" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 #