# HG changeset patch # User Pavel Tisnovsky # Date 1396424383 -7200 # Node ID 071f5098ba66a0e15420114ec772ee9a37b99d6d # Parent e08cdeaa1aee4334ae7e95c75c4408eef126fd8f Added new tests testGetResourceAsStreamPositiveTest into ScriptEngineManagerClassTest. diff -r e08cdeaa1aee -r 071f5098ba66 ChangeLog --- 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 + + * src/org/RhinoTests/ScriptEngineManagerClassTest.java: + Added new tests testGetResourceAsStreamPositiveTest + into ScriptEngineManagerClassTest. + 2014-04-01 Pavel Tisnovsky * src/org/RhinoTests/ScriptEngineFactoryClassTest.java: diff -r e08cdeaa1aee -r 071f5098ba66 src/org/RhinoTests/ScriptEngineManagerClassTest.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"); }