changeset 10857:15fcabec7e20

8198609: [TestBug] Some of the system tests need a message about exceptions being expected Reviewed-by: kcr
author mbilla
date Fri, 02 Mar 2018 21:36:35 +0530
parents 8e8647461811
children 3c886ca69902
files tests/system/src/test/java/test/launchertest/ModuleLauncherTest.java tests/system/src/testapp4/java/mymod/myapp4/AppBindingsQualExported.java tests/system/src/testapp4/java/mymod/myapp4/AppBindingsUnexported.java tests/system/src/testapp6/java/mymod/myapp6/AppFXMLExported.java tests/system/src/testapp6/java/mymod/myapp6/AppFXMLQualExported.java tests/system/src/testapp6/java/mymod/myapp6/AppFXMLUnexported.java
diffstat 6 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/tests/system/src/test/java/test/launchertest/ModuleLauncherTest.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/test/java/test/launchertest/ModuleLauncherTest.java	Fri Mar 02 21:36:35 2018 +0530
@@ -48,6 +48,7 @@
 
     private void doTestLaunchModule(String modulePath, String testAppName) throws Exception {
         assertNotNull(testAppName);
+        System.err.println("The following Unknown module WARNING messages are expected:");
         String mpArg = "--module-path=" + modulePath;
         String moduleAppName = "--module=" + moduleName + "/" + testAppName;
         final ArrayList<String> cmd =
--- a/tests/system/src/testapp4/java/mymod/myapp4/AppBindingsQualExported.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/testapp4/java/mymod/myapp4/AppBindingsQualExported.java	Fri Mar 02 21:36:35 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -172,6 +172,7 @@
         // In this case, the binding will succeed; calling get() will return 0;
         // the first time it is called it will log a warning.
         DoubleBinding binding3 = Bindings.selectDouble(root2, "next", "foo");
+        System.err.println("The following two WARNING messages are expected:");
         assertEquals(0, binding3.get()); // This will log a warning
         c.setFoo(3.4);
         assertEquals(0, binding3.get()); // No warning here
@@ -179,6 +180,7 @@
         // In this case, the binding will succeed; calling get() will return null;
         // the first time it is called it will log a warning.
         ObjectBinding<MyProps> binding4 = Bindings.select(root2, "next", "next");
+        System.err.println("The following two WARNING messages are expected:");
         assertSame(null, binding4.get()); // This will log a warning
         assertSame(null, binding4.get()); // No warning here
 
--- a/tests/system/src/testapp4/java/mymod/myapp4/AppBindingsUnexported.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/testapp4/java/mymod/myapp4/AppBindingsUnexported.java	Fri Mar 02 21:36:35 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -170,6 +170,7 @@
         // In this case, the binding will succeed; calling get() will return 0;
         // the first time it is called it will log a warning.
         DoubleBinding binding3 = Bindings.selectDouble(root2, "next", "foo");
+        System.err.println("The following two WARNING messages are expected:");
         assertEquals(0, binding3.get()); // This will log a warning
         c.setFoo(3.4);
         assertEquals(0, binding3.get()); // No warning here
@@ -177,6 +178,7 @@
         // In this case, the binding will succeed; calling get() will return null;
         // the first time it is called it will log a warning.
         ObjectBinding<MyProps> binding4 = Bindings.select(root2, "next", "next");
+        System.err.println("The following two WARNING messages are expected:");
         assertSame(null, binding4.get()); // This will log a warning
         assertSame(null, binding4.get()); // No warning here
 
--- a/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLExported.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLExported.java	Fri Mar 02 21:36:35 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -126,7 +126,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
--- a/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLQualExported.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLQualExported.java	Fri Mar 02 21:36:35 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -83,7 +83,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
@@ -96,7 +96,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
@@ -109,7 +109,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
--- a/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLUnexported.java	Fri Mar 02 05:46:23 2018 -0800
+++ b/tests/system/src/testapp6/java/mymod/myapp6/AppFXMLUnexported.java	Fri Mar 02 21:36:35 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -83,7 +83,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
@@ -96,7 +96,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }
 
@@ -109,7 +109,7 @@
             Node fxmlRoot = loader.load();
             throw new AssertionError("ERROR: did not get the expected exception");
         } catch (LoadException ex) {
-            ex.printStackTrace();
+            // This load exception is expected
         }
     }