提交 d5975a73 编写于 作者: U uta

7162111: TEST_BUG: change tests run in headless mode [macosx] (open)

Summary: In problem tests detection of AWT headless mode was introduced or AWT dependence was removed.
Reviewed-by: alanb
上级 2cec93d5
...@@ -162,26 +162,6 @@ javax/management/remote/mandatory/notif/DiffHBTest.java generic-all ...@@ -162,26 +162,6 @@ javax/management/remote/mandatory/notif/DiffHBTest.java generic-all
# 6988950 # 6988950
demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java generic-all demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.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 # jdk_net
...@@ -224,11 +204,6 @@ java/net/CookieHandler/CookieManagerTest.java macosx-all ...@@ -224,11 +204,6 @@ java/net/CookieHandler/CookieManagerTest.java macosx-all
# jdk_io # jdk_io
# 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 # jdk_nio
...@@ -364,9 +339,6 @@ com/sun/jdi/ProcessAttachTest.sh generic-all ...@@ -364,9 +339,6 @@ com/sun/jdi/ProcessAttachTest.sh generic-all
# jdk_util # jdk_util
# 7162111 - test needs to be changed to run headless
java/util/ResourceBundle/Control/Bug6530694.java macosx-all
# Filed 6933803 # Filed 6933803
java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all
......
...@@ -32,21 +32,26 @@ ...@@ -32,21 +32,26 @@
* @run main TraceJFrame JFrameCreateTime * @run main TraceJFrame JFrameCreateTime
*/ */
public class TraceJFrame { import java.awt.GraphicsEnvironment;
public class TraceJFrame {
public static void main(String args[]) throws Exception { 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) */ /* Run demo that uses JVMTI mtrace agent (no options) */
demo = new DemoRun("mtrace", "" /* options to mtrace */ ); demo = new DemoRun("mtrace", "" /* options to mtrace */ );
demo.runit(args[0]); demo.runit(args[0]);
/* Make sure patterns in output look ok */ /* Make sure patterns in output look ok */
if (demo.output_contains("ERROR")) { if (demo.output_contains("ERROR")) {
throw new RuntimeException("Test failed - ERROR seen in output"); throw new RuntimeException("Test failed - ERROR seen in output");
} }
/* Must be a pass. */ /* Must be a pass. */
System.out.println("Test passed - cleanly terminated"); System.out.println("Test passed - cleanly terminated");
}
} }
} }
...@@ -26,27 +26,26 @@ ...@@ -26,27 +26,26 @@
* @summary Verify that class loaded outside of application class loader is * @summary Verify that class loaded outside of application class loader is
* correctly resolved during deserialization when read in by custom * correctly resolved during deserialization when read in by custom
* readObject() method of a bootstrap class (in this case, * 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.io.*;
import java.util.Vector;
public class Foo implements Runnable { public class Foo implements Runnable {
static class Adapter extends MouseAdapter implements Serializable {} static class TestElement extends Object implements Serializable {}
public void run() { public void run() {
try { try {
Button button = new Button(); Vector<TestElement> container = new Vector<TestElement>();
button.addMouseListener(new Adapter()); container.add(new TestElement());
// iterate to trigger java.lang.reflect code generation // iterate to trigger java.lang.reflect code generation
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
ByteArrayOutputStream bout = new ByteArrayOutputStream(); ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(bout); ObjectOutputStream oout = new ObjectOutputStream(bout);
oout.writeObject(button); oout.writeObject(container);
oout.close(); oout.close();
ObjectInputStream oin = new ObjectInputStream( ObjectInputStream oin = new ObjectInputStream(
new ByteArrayInputStream(bout.toByteArray())); new ByteArrayInputStream(bout.toByteArray()));
...@@ -54,7 +53,7 @@ public class Foo implements Runnable { ...@@ -54,7 +53,7 @@ public class Foo implements Runnable {
} }
} catch (Exception ex) { } catch (Exception ex) {
throw new Error( throw new Error(
"Error occured while (de)serializing Button: " + ex); "Error occured while (de)serializing container: ", ex);
} }
} }
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @summary Verify that class loaded outside of application class loader is * @summary Verify that class loaded outside of application class loader is
* correctly resolved during deserialization when read in by custom * correctly resolved during deserialization when read in by custom
* readObject() method of a bootstrap class (in this case, * readObject() method of a bootstrap class (in this case,
* java.awt.Button). * java.util.Vector).
*/ */
import java.io.*; import java.io.*;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
# @summary Verify that class loaded outside of application class loader is # @summary Verify that class loaded outside of application class loader is
# correctly resolved during deserialization when read in by custom # correctly resolved during deserialization when read in by custom
# readObject() method of a bootstrap class (in this case, # readObject() method of a bootstrap class (in this case,
# java.awt.Button). # java.util.Vector).
if [ "${TESTJAVA}" = "" ] if [ "${TESTJAVA}" = "" ]
then then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册