/hg/rhino-tests: Added new test cases into CompilableClassTest.

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Feb 3 04:37:25 PST 2014


changeset a700722dcd30 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=a700722dcd30
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Feb 03 13:41:42 2014 +0100

	Added new test cases into CompilableClassTest.


diffstat:

 ChangeLog                                   |    5 +
 src/org/RhinoTests/CompilableClassTest.java |  258 +++++++++++++++++++++++++++-
 2 files changed, 262 insertions(+), 1 deletions(-)

diffs (294 lines):

diff -r a0ecef720764 -r a700722dcd30 ChangeLog
--- a/ChangeLog	Wed Jan 29 12:48:57 2014 +0100
+++ b/ChangeLog	Mon Feb 03 13:41:42 2014 +0100
@@ -1,3 +1,8 @@
+2014-02-03  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/CompilableClassTest.java:
+	Added new test cases into CompilableClassTest.
+
 2014-01-29  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/SimpleBindingsClassTest.java:
diff -r a0ecef720764 -r a700722dcd30 src/org/RhinoTests/CompilableClassTest.java
--- a/src/org/RhinoTests/CompilableClassTest.java	Wed Jan 29 12:48:57 2014 +0100
+++ b/src/org/RhinoTests/CompilableClassTest.java	Mon Feb 03 13:41:42 2014 +0100
@@ -99,7 +99,7 @@
      * Test for method javax.script.Compilable.getClass().isInstance()
      */
     protected void testIsInstance() {
-        assertTrue(this.compilableClass.isInstance(new ScriptEngineManager().getEngineByName(Constants.EngineNames.ENGINE_NAME_JavaScript)),
+        assertTrue(this.compilableClass.isInstance((Compilable)(new ScriptEngineManager().getEngineByName(Constants.EngineNames.ENGINE_NAME_JavaScript))),
                 "Method Compilable.getClass().isInstance() returns wrong value");
     }
 
@@ -1148,6 +1148,54 @@
         }
 
         try {
+            this.compilableClass.asSubclass(java.applet.Applet.class);
+            throw new AssertionError("Class.asSubclass(java.applet.Applet.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.Button.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Button.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.Canvas.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Canvas.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.CardLayout.class);
+            throw new AssertionError("Class.asSubclass(java.awt.CardLayout.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.Checkbox.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Checkbox.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.Choice.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Choice.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.compilableClass.asSubclass(java.awt.Color.class);
             throw new AssertionError("Class.asSubclass(java.awt.Color.class) does not throw any exception");
         }
@@ -1172,6 +1220,214 @@
         }
 
         try {
+            this.compilableClass.asSubclass(java.awt.Label.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Label.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.List.class);
+            throw new AssertionError("Class.asSubclass(java.awt.List.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.awt.Menu.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Menu.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.File.class);
+            throw new AssertionError("Class.asSubclass(java.io.File.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.Reader.class);
+            throw new AssertionError("Class.asSubclass(java.io.Reader.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.Writer.class);
+            throw new AssertionError("Class.asSubclass(java.io.Writer.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.StringReader.class);
+            throw new AssertionError("Class.asSubclass(java.io.StringReader.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.StringWriter.class);
+            throw new AssertionError("Class.asSubclass(java.io.StringWriter.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.InputStream.class);
+            throw new AssertionError("Class.asSubclass(java.io.InputStream.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.OutputStream.class);
+            throw new AssertionError("Class.asSubclass(java.io.OutputStream.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.ObjectInputStream.class);
+            throw new AssertionError("Class.asSubclass(java.io.ObjectInputStream.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.io.ObjectOutputStream.class);
+            throw new AssertionError("Class.asSubclass(java.io.ObjectOutputStream.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.math.BigDecimal.class);
+            throw new AssertionError("Class.asSubclass(java.math.BigDecimal.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.math.BigInteger.class);
+            throw new AssertionError("Class.asSubclass(java.math.BigInteger.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.ArrayList.class);
+            throw new AssertionError("Class.asSubclass(java.util.ArrayList.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.LinkedList.class);
+            throw new AssertionError("Class.asSubclass(java.util.LinkedList.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.HashMap.class);
+            throw new AssertionError("Class.asSubclass(java.util.HashMap.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.TreeMap.class);
+            throw new AssertionError("Class.asSubclass(java.util.TreeMap.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.HashSet.class);
+            throw new AssertionError("Class.asSubclass(java.util.HashSet.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.TreeSet.class);
+            throw new AssertionError("Class.asSubclass(java.util.TreeSet.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Stack.class);
+            throw new AssertionError("Class.asSubclass(java.util.Stack.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Vector.class);
+            throw new AssertionError("Class.asSubclass(java.util.Vector.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Hashtable.class);
+            throw new AssertionError("Class.asSubclass(java.util.Hashtable.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Calendar.class);
+            throw new AssertionError("Class.asSubclass(java.util.Calendar.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Arrays.class);
+            throw new AssertionError("Class.asSubclass(java.util.Arrays.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.compilableClass.asSubclass(java.util.Collections.class);
+            throw new AssertionError("Class.asSubclass(java.util.Collections.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
             this.compilableClass.asSubclass(javax.swing.JPanel.class);
             throw new AssertionError("Class.asSubclass(javax.swing.JPanel.class) does not throw any exception");
         }


More information about the distro-pkg-dev mailing list