changeset 6098:a83eb49fa0a1

7162111: TEST_BUG: change tests run in headless mode [macosx] Reviewed-by: uta
author robm
date Sun, 24 Feb 2013 16:53:31 +0000
parents b63606fafce3
children aa88f22e90ab
files test/ProblemList.txt test/demo/jvmti/mtrace/TraceJFrame.java test/java/io/Serializable/resolveClass/deserializeButton/Foo.java test/java/io/Serializable/resolveClass/deserializeButton/Test.java test/java/io/Serializable/resolveClass/deserializeButton/run.sh
diffstat 5 files changed, 31 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/test/ProblemList.txt	Thu Jan 17 14:47:01 2013 +0000
+++ b/test/ProblemList.txt	Sun Feb 24 16:53:31 2013 +0000
@@ -1,6 +1,6 @@
-###########################################################################
+##########################################################################
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -234,27 +234,6 @@
 # 7056489
 com/sun/jndi/ldap/ReadTimeoutTest.java                          generic-all
 
-# 7162111
-demo/jvmti/mtrace/TraceJFrame.java                              macosx-all
-javax/script/CauseExceptionTest.java                            macosx-all
-javax/script/GetInterfaceTest.java                              macosx-all
-javax/script/JavaScriptScopeTest.java                           macosx-all
-javax/script/NullUndefinedVarTest.java                          macosx-all
-javax/script/PluggableContextTest.java                          macosx-all
-javax/script/ProviderTest.sh                                    macosx-all
-javax/script/RhinoExceptionTest.java                            macosx-all
-javax/script/StringWriterPrintTest.java                         macosx-all
-javax/script/Test1.java                                         macosx-all
-javax/script/Test2.java                                         macosx-all
-javax/script/Test3.java                                         macosx-all
-javax/script/Test4.java                                         macosx-all
-javax/script/Test5.java                                         macosx-all
-javax/script/Test6.java                                         macosx-all
-javax/script/Test7.java                                         macosx-all
-javax/script/Test8.java                                         macosx-all
-javax/script/UnescapedBracketRegExTest.java                     macosx-all
-javax/script/VersionTest.java                                   macosx-all
-
 ############################################################################
 
 # jdk_net
@@ -297,11 +276,6 @@
 # 6962637
 java/io/File/MaxPathLength.java                                 windows-all
 
-# 7162111 - these tests need to be updated to run headless
-java/io/Serializable/resolveClass/deserializeButton/run.sh      macosx-all
-java/io/Serializable/serialver/classpath/run.sh                 macosx-all
-java/io/Serializable/serialver/nested/run.sh                    macosx-all
-
 ############################################################################
 
 # jdk_nio
@@ -481,14 +455,6 @@
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
 
-# 7162111
-sun/tools/jrunscript/jrunscript-DTest.sh			macosx-all
-sun/tools/jrunscript/jrunscript-argsTest.sh			macosx-all
-sun/tools/jrunscript/jrunscript-cpTest.sh			macosx-all
-sun/tools/jrunscript/jrunscript-eTest.sh			macosx-all
-sun/tools/jrunscript/jrunscript-fTest.sh			macosx-all
-sun/tools/jrunscript/jrunscriptTest.sh				macosx-all
-
 # 8001118
 sun/tools/jcmd/jcmd-f.sh					generic-all
 sun/tools/jcmd/jcmd-help-help.sh				generic-all
@@ -527,10 +493,6 @@
 # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
 java/util/concurrent/locks/Lock/TimedAcquireLeak.java           generic-all
 
-# 7162111
-java/util/ResourceBundle/Control/Bug6530694.java		macosx-all
-java/util/logging/LoggingDeadlock4.java				macosx-all
-
 # 7041639, Solaris DSA keypair generation bug
 java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
 
--- a/test/demo/jvmti/mtrace/TraceJFrame.java	Thu Jan 17 14:47:01 2013 +0000
+++ b/test/demo/jvmti/mtrace/TraceJFrame.java	Sun Feb 24 16:53:31 2013 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,21 +32,26 @@
  * @run main TraceJFrame JFrameCreateTime
  */
 
-public class TraceJFrame {
+import java.awt.GraphicsEnvironment;
 
+public class TraceJFrame {
     public static void main(String args[]) throws Exception {
-        DemoRun demo;
+        if (GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
+            System.out.println("JFrame test was skipped due to headless mode");
+        } else {
+            DemoRun demo;
 
-        /* Run demo that uses JVMTI mtrace agent (no options) */
-        demo = new DemoRun("mtrace", "" /* options to mtrace */ );
-        demo.runit(args[0]);
+            /* Run demo that uses JVMTI mtrace agent (no options) */
+            demo = new DemoRun("mtrace", "" /* options to mtrace */ );
+            demo.runit(args[0]);
 
-        /* Make sure patterns in output look ok */
-        if (demo.output_contains("ERROR")) {
-            throw new RuntimeException("Test failed - ERROR seen in output");
+            /* Make sure patterns in output look ok */
+            if (demo.output_contains("ERROR")) {
+                throw new RuntimeException("Test failed - ERROR seen in output");
+            }
+
+            /* Must be a pass. */
+            System.out.println("Test passed - cleanly terminated");
         }
-
-        /* Must be a pass. */
-        System.out.println("Test passed - cleanly terminated");
     }
 }
--- a/test/java/io/Serializable/resolveClass/deserializeButton/Foo.java	Thu Jan 17 14:47:01 2013 +0000
+++ b/test/java/io/Serializable/resolveClass/deserializeButton/Foo.java	Sun Feb 24 16:53:31 2013 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,27 +26,26 @@
  * @summary Verify that class loaded outside of application class loader is
  *          correctly resolved during deserialization when read in by custom
  *          readObject() method of a bootstrap class (in this case,
- *          java.awt.Button).
+ *          java.util.Vector).
  */
 
-import java.awt.Button;
-import java.awt.event.MouseAdapter;
 import java.io.*;
+import java.util.Vector;
 
 public class Foo implements Runnable {
 
-    static class Adapter extends MouseAdapter implements Serializable {}
+    static class TestElement extends Object implements Serializable {}
 
     public void run() {
         try {
-            Button button = new Button();
-            button.addMouseListener(new Adapter());
+            Vector<TestElement> container = new Vector<TestElement>();
+            container.add(new TestElement());
 
             // iterate to trigger java.lang.reflect code generation
             for (int i = 0; i < 100; i++) {
                 ByteArrayOutputStream bout = new ByteArrayOutputStream();
                 ObjectOutputStream oout = new ObjectOutputStream(bout);
-                oout.writeObject(button);
+                oout.writeObject(container);
                 oout.close();
                 ObjectInputStream oin = new ObjectInputStream(
                     new ByteArrayInputStream(bout.toByteArray()));
@@ -54,7 +53,7 @@
             }
         } catch (Exception ex) {
             throw new Error(
-                "Error occured while (de)serializing Button: " + ex);
+                "Error occured while (de)serializing container: ", ex);
         }
     }
 }
--- a/test/java/io/Serializable/resolveClass/deserializeButton/Test.java	Thu Jan 17 14:47:01 2013 +0000
+++ b/test/java/io/Serializable/resolveClass/deserializeButton/Test.java	Sun Feb 24 16:53:31 2013 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @summary Verify that class loaded outside of application class loader is
  *          correctly resolved during deserialization when read in by custom
  *          readObject() method of a bootstrap class (in this case,
- *          java.awt.Button).
+ *          java.util.Vector).
  */
 
 import java.io.*;
--- a/test/java/io/Serializable/resolveClass/deserializeButton/run.sh	Thu Jan 17 14:47:01 2013 +0000
+++ b/test/java/io/Serializable/resolveClass/deserializeButton/run.sh	Sun Feb 24 16:53:31 2013 +0000
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 # @summary Verify that class loaded outside of application class loader is
 #          correctly resolved during deserialization when read in by custom
 #          readObject() method of a bootstrap class (in this case,
-#          java.awt.Button).
+#          java.util.Vector).
 
 if [ "${TESTJAVA}" = "" ]
 then