changeset 303:99f05286b20a draft

Added new test cases into the test testAsSubclass.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Fri, 17 Jan 2014 13:12:51 +0100
parents 01e66e349104
children 7bbdd4d1eeee
files ChangeLog src/org/RhinoTests/AbstractScriptEngineClassTest.java
diffstat 2 files changed, 77 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 16 10:11:35 2014 +0100
+++ b/ChangeLog	Fri Jan 17 13:12:51 2014 +0100
@@ -1,3 +1,8 @@
+2014-01-17  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
+	Added new test cases into the test testAsSubclass.
+
 2014-01-16  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
--- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Thu Jan 16 10:11:35 2014 +0100
+++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Fri Jan 17 13:12:51 2014 +0100
@@ -1788,6 +1788,14 @@
         }
 
         try {
+            this.abstractScriptEngineClass.cast(Character.valueOf('a'));
+            throw new AssertionError("Class.cast(Character.valueOf('a')) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.abstractScriptEngineClass.cast(Byte.valueOf((byte)42));
             throw new AssertionError("Class.cast(Byte.valueOf((byte)42)) does not throw any exception");
         }
@@ -1844,6 +1852,14 @@
         }
 
         try {
+            this.abstractScriptEngineClass.cast(new Throwable("xyzzy"));
+            throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.abstractScriptEngineClass.cast(new RuntimeException());
             throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception");
         }
@@ -1852,6 +1868,14 @@
         }
 
         try {
+            this.abstractScriptEngineClass.cast(new RuntimeException("xyzzy"));
+            throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.abstractScriptEngineClass.cast(new Error());
             throw new AssertionError("Class.cast(new Error()) does not throw any exception");
         }
@@ -1860,6 +1884,22 @@
         }
 
         try {
+            this.abstractScriptEngineClass.cast(new Error("xyzzy"));
+            throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.abstractScriptEngineClass.cast(new java.io.File("xyzzy"));
+            throw new AssertionError("Class.cast(new java.io.File(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.abstractScriptEngineClass.cast(new java.lang.String());
             throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception");
         }
@@ -1908,6 +1948,30 @@
         }
 
         try {
+            this.abstractScriptEngineClass.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.abstractScriptEngineClass.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.abstractScriptEngineClass.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.abstractScriptEngineClass.cast(new javax.swing.JLabel());
             throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception");
         }
@@ -1924,6 +1988,14 @@
         }
 
         try {
+            this.abstractScriptEngineClass.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.abstractScriptEngineClass.cast(new javax.swing.JPanel());
             throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception");
         }