changeset 345:071f5098ba66 draft

Added new tests testGetResourceAsStreamPositiveTest into ScriptEngineManagerClassTest.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Wed, 02 Apr 2014 09:39:43 +0200
parents e08cdeaa1aee
children cb8d30425c68
files ChangeLog src/org/RhinoTests/ScriptEngineManagerClassTest.java
diffstat 2 files changed, 78 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 01 11:44:02 2014 +0200
+++ b/ChangeLog	Wed Apr 02 09:39:43 2014 +0200
@@ -1,3 +1,9 @@
+2014-04-02  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineManagerClassTest.java:
+	Added new tests testGetResourceAsStreamPositiveTest
+	into ScriptEngineManagerClassTest.
+
 2014-04-01  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
--- a/src/org/RhinoTests/ScriptEngineManagerClassTest.java	Tue Apr 01 11:44:02 2014 +0200
+++ b/src/org/RhinoTests/ScriptEngineManagerClassTest.java	Wed Apr 02 09:39:43 2014 +0200
@@ -1790,6 +1790,14 @@
         }
 
         try {
+            this.scriptEngineManagerClass.cast(Character.valueOf('a'));
+            throw new AssertionError("Class.cast(Character.valueOf('a')) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.scriptEngineManagerClass.cast(Byte.valueOf((byte)42));
             throw new AssertionError("Class.cast(Byte.valueOf((byte)42)) does not throw any exception");
         }
@@ -1846,6 +1854,14 @@
         }
 
         try {
+            this.scriptEngineManagerClass.cast(new Throwable("xyzzy"));
+            throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.scriptEngineManagerClass.cast(new RuntimeException());
             throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception");
         }
@@ -1854,6 +1870,14 @@
         }
 
         try {
+            this.scriptEngineManagerClass.cast(new RuntimeException("xyzzy"));
+            throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.scriptEngineManagerClass.cast(new Error());
             throw new AssertionError("Class.cast(new Error()) does not throw any exception");
         }
@@ -1862,6 +1886,22 @@
         }
 
         try {
+            this.scriptEngineManagerClass.cast(new Error("xyzzy"));
+            throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineManagerClass.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.scriptEngineManagerClass.cast(new java.lang.String());
             throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception");
         }
@@ -1910,6 +1950,30 @@
         }
 
         try {
+            this.scriptEngineManagerClass.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.scriptEngineManagerClass.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.scriptEngineManagerClass.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.scriptEngineManagerClass.cast(new javax.swing.JLabel());
             throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception");
         }
@@ -1926,6 +1990,14 @@
         }
 
         try {
+            this.scriptEngineManagerClass.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.scriptEngineManagerClass.cast(new javax.swing.JPanel());
             throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception");
         }