Mercurial > hg > rhino-tests
changeset 333:39b90cb1bd47 draft
Enhancements of various tests in ScriptContextClassTest.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Fri, 14 Mar 2014 13:14:58 +0100 |
parents | 7a653bbdeeec |
children | e21fefd231df |
files | ChangeLog src/org/RhinoTests/ScriptContextClassTest.java |
diffstat | 2 files changed, 37 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Mar 13 09:50:36 2014 +0100 +++ b/ChangeLog Fri Mar 14 13:14:58 2014 +0100 @@ -1,3 +1,8 @@ +2014-03-14 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/ScriptContextClassTest.java: + Enhancements of various tests in ScriptContextClassTest. + 2014-03-13 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
--- a/src/org/RhinoTests/ScriptContextClassTest.java Thu Mar 13 09:50:36 2014 +0100 +++ b/src/org/RhinoTests/ScriptContextClassTest.java Fri Mar 14 13:14:58 2014 +0100 @@ -1832,6 +1832,30 @@ } try { + this.scriptContextClass.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.scriptContextClass.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.scriptContextClass.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.scriptContextClass.cast(new javax.swing.JLabel()); throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception"); } @@ -1848,6 +1872,14 @@ } try { + this.scriptContextClass.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.scriptContextClass.cast(new javax.swing.JPanel()); throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception"); }