Mercurial > hg > rhino-tests
changeset 331:bdfcaa390fb9 draft
Enhancements of various tests in InvocableClassTest.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Wed, 12 Mar 2014 12:42:16 +0100 |
parents | 808d23256e54 |
children | 7a653bbdeeec |
files | ChangeLog src/org/RhinoTests/InvocableClassTest.java |
diffstat | 2 files changed, 78 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Mar 11 10:52:47 2014 +0100 +++ b/ChangeLog Wed Mar 12 12:42:16 2014 +0100 @@ -1,3 +1,8 @@ +2014-03-12 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/InvocableClassTest.java: + Enhancements of various tests in InvocableClassTest. + 2014-03-11 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/CompiledScriptClassTest.java:
--- a/src/org/RhinoTests/InvocableClassTest.java Tue Mar 11 10:52:47 2014 +0100 +++ b/src/org/RhinoTests/InvocableClassTest.java Wed Mar 12 12:42:16 2014 +0100 @@ -1,7 +1,7 @@ /* Rhino test framework - Copyright (C) 2011, 2012, 2013 Red Hat + Copyright (C) 2011, 2012, 2013, 2014 Red Hat This file is part of IcedTea. @@ -1530,6 +1530,14 @@ } try { + this.invocableClass.cast(Character.valueOf('a')); + throw new AssertionError("Class.cast(Character.valueOf('a')) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.invocableClass.cast(Byte.valueOf((byte)42)); throw new AssertionError("Class.cast(Byte.valueOf((byte)42)) does not throw any exception"); } @@ -1586,6 +1594,14 @@ } try { + this.invocableClass.cast(new Throwable("xyzzy")); + throw new AssertionError("Class.cast(new Throwable(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.invocableClass.cast(new RuntimeException()); throw new AssertionError("Class.cast(new RuntimeException()) does not throw any exception"); } @@ -1594,6 +1610,14 @@ } try { + this.invocableClass.cast(new RuntimeException("xyzzy")); + throw new AssertionError("Class.cast(new RuntimeException(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { this.invocableClass.cast(new Error()); throw new AssertionError("Class.cast(new Error()) does not throw any exception"); } @@ -1602,6 +1626,22 @@ } try { + this.invocableClass.cast(new Error("xyzzy")); + throw new AssertionError("Class.cast(new Error(\"xyzzy\")) does not throw any exception"); + } + catch (Exception e) { + // expected exception + } + + try { + this.invocableClass.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.invocableClass.cast(new java.lang.String()); throw new AssertionError("Class.cast(new java.lang.String()) does not throw any exception"); } @@ -1650,6 +1690,30 @@ } try { + this.invocableClass.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.invocableClass.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.invocableClass.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.invocableClass.cast(new javax.swing.JLabel()); throw new AssertionError("Class.cast(new javax.swing.JLabel()) does not throw any exception"); } @@ -1666,13 +1730,20 @@ } try { + this.invocableClass.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.invocableClass.cast(new javax.swing.JPanel()); throw new AssertionError("Class.cast(new javax.swing.JPanel()) does not throw any exception"); } catch (Exception e) { // expected exception } - } /** @@ -1689,7 +1760,6 @@ catch (IllegalAccessException e) { // expected exception } - } /**