Mercurial > hg > rhino-tests
changeset 312:ccbc43e0fc52 draft
Enhancement of the test SimpleBindingsClassTest.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Tue, 04 Feb 2014 12:49:25 +0100 |
parents | a700722dcd30 |
children | 90ec2e72a315 |
files | ChangeLog src/org/RhinoTests/SimpleBindingsClassTest.java |
diffstat | 2 files changed, 69 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Feb 03 13:41:42 2014 +0100 +++ b/ChangeLog Tue Feb 04 12:49:25 2014 +0100 @@ -1,3 +1,8 @@ +2014-02-04 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/SimpleBindingsClassTest.java: + Enhancement of the test SimpleBindingsClassTest. + 2014-02-03 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/CompilableClassTest.java:
--- a/src/org/RhinoTests/SimpleBindingsClassTest.java Mon Feb 03 13:41:42 2014 +0100 +++ b/src/org/RhinoTests/SimpleBindingsClassTest.java Tue Feb 04 12:49:25 2014 +0100 @@ -1826,6 +1826,14 @@ } try { + this.simpleBindingsClass.cast(new Throwable("xyzzy")); + throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.simpleBindingsClass.cast(new RuntimeException()); throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception"); } @@ -1834,6 +1842,14 @@ } try { + this.simpleBindingsClass.cast(new RuntimeException("xyzzy")); + throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.simpleBindingsClass.cast(new Error()); throw new AssertionError("Class.cast(new Error()) does not throw any exception"); } @@ -1842,6 +1858,22 @@ } try { + this.simpleBindingsClass.cast(new Error("xyzzy")); + throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.simpleBindingsClass.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.simpleBindingsClass.cast(new java.lang.String()); throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception"); } @@ -1890,6 +1922,30 @@ } try { + this.simpleBindingsClass.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.simpleBindingsClass.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.simpleBindingsClass.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.simpleBindingsClass.cast(new javax.swing.JLabel()); throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception"); } @@ -1906,6 +1962,14 @@ } try { + this.simpleBindingsClass.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.simpleBindingsClass.cast(new javax.swing.JPanel()); throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception"); }