# HG changeset patch # User Pavel Tisnovsky # Date 1394700636 -3600 # Node ID 7a653bbdeeecb90bb44d29509c8436d50717c289 # Parent bdfcaa390fb9c2e0fab9023881215f02357e9a6a Enhancements of various tests in ScriptEngineFactoryClassTest. diff -r bdfcaa390fb9 -r 7a653bbdeeec ChangeLog --- a/ChangeLog Wed Mar 12 12:42:16 2014 +0100 +++ b/ChangeLog Thu Mar 13 09:50:36 2014 +0100 @@ -1,3 +1,8 @@ +2014-03-13 Pavel Tisnovsky + + * src/org/RhinoTests/ScriptEngineFactoryClassTest.java: + Enhancements of various tests in ScriptEngineFactoryClassTest. + 2014-03-12 Pavel Tisnovsky * src/org/RhinoTests/InvocableClassTest.java: diff -r bdfcaa390fb9 -r 7a653bbdeeec src/org/RhinoTests/ScriptEngineFactoryClassTest.java --- a/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Wed Mar 12 12:42:16 2014 +0100 +++ b/src/org/RhinoTests/ScriptEngineFactoryClassTest.java Thu Mar 13 09:50:36 2014 +0100 @@ -1624,6 +1624,14 @@ } try { + this.scriptEngineFactoryClass.cast(Character.valueOf('a')); + throw new AssertionError("Class.cast(Character.valueOf('a')) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.scriptEngineFactoryClass.cast(Byte.valueOf((byte)42)); throw new AssertionError("Class.cast(Byte.valueOf((byte)42)) does not throw any exception"); } @@ -1680,6 +1688,14 @@ } try { + this.scriptEngineFactoryClass.cast(new Throwable("xyzzy")); + throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.scriptEngineFactoryClass.cast(new RuntimeException()); throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception"); } @@ -1688,6 +1704,14 @@ } try { + this.scriptEngineFactoryClass.cast(new RuntimeException("xyzzy")); + throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.scriptEngineFactoryClass.cast(new Error()); throw new AssertionError("Class.cast(new Error()) does not throw any exception"); } @@ -1696,6 +1720,22 @@ } try { + this.scriptEngineFactoryClass.cast(new Error("xyzzy")); + throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.scriptEngineFactoryClass.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.scriptEngineFactoryClass.cast(new java.lang.String()); throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception"); } @@ -1744,6 +1784,30 @@ } try { + this.scriptEngineFactoryClass.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.scriptEngineFactoryClass.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.scriptEngineFactoryClass.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.scriptEngineFactoryClass.cast(new javax.swing.JLabel()); throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception"); } @@ -1760,6 +1824,14 @@ } try { + this.scriptEngineFactoryClass.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.scriptEngineFactoryClass.cast(new javax.swing.JPanel()); throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception"); }