/hg/rhino-tests: Enhancements of various tests in InvocableClass...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Mar 12 11:41:34 UTC 2014


changeset bdfcaa390fb9 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=bdfcaa390fb9
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Mar 12 12:42:16 2014 +0100

	Enhancements of various tests in InvocableClassTest.


diffstat:

 ChangeLog                                  |   5 +
 src/org/RhinoTests/InvocableClassTest.java |  76 ++++++++++++++++++++++++++++-
 2 files changed, 78 insertions(+), 3 deletions(-)

diffs (153 lines):

diff -r 808d23256e54 -r bdfcaa390fb9 ChangeLog
--- 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 at redhat.com>
+
+	* src/org/RhinoTests/InvocableClassTest.java:
+	Enhancements of various tests in InvocableClassTest.
+
 2014-03-11  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/CompiledScriptClassTest.java:
diff -r 808d23256e54 -r bdfcaa390fb9 src/org/RhinoTests/InvocableClassTest.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
         }
-
     }
 
     /**


More information about the distro-pkg-dev mailing list