changeset 338:c4c9da65a928 draft

Enhancements of various tests in ScriptEngineClassTest.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Fri, 21 Mar 2014 11:42:16 +0100
parents 6c88fa309557
children a925ed2c4086
files ChangeLog src/org/RhinoTests/ScriptEngineClassTest.java
diffstat 2 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 20 09:34:13 2014 +0100
+++ b/ChangeLog	Fri Mar 21 11:42:16 2014 +0100
@@ -1,3 +1,8 @@
+2014-03-21  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineClassTest.java:
+	Enhancements of various tests in ScriptEngineClassTest.
+
 2014-03-20  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/ScriptExceptionClassTest.java:
--- a/src/org/RhinoTests/ScriptEngineClassTest.java	Thu Mar 20 09:34:13 2014 +0100
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java	Fri Mar 21 11:42:16 2014 +0100
@@ -1891,6 +1891,30 @@
         }
 
         try {
+            this.scriptEngineClass.cast(new java.awt.Label());
+            throw new AssertionError("Class.cast(new java.awt.Label()) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.cast(new java.awt.Label(new String()));
+            throw new AssertionError("Class.cast(new java.awt.Label(new String())) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.cast(new java.awt.Label("xyzzy"));
+            throw new AssertionError("Class.cast(new java.awt.Label(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.scriptEngineClass.cast(new javax.swing.JLabel());
             throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception");
         }
@@ -1907,6 +1931,14 @@
         }
 
         try {
+            this.scriptEngineClass.cast(new javax.swing.JLabel("xyzzy"));
+            throw new AssertionError("Class.cast(new javax.swing.JLabel(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.scriptEngineClass.cast(new javax.swing.JPanel());
             throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception");
         }