/hg/rhino-tests: Added new test testAsSubclass into the test suite

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Sun Sep 29 23:51:43 PDT 2013


changeset 8055f8294f0e in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=8055f8294f0e
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Sep 30 08:55:31 2013 +0200

	Added new test testAsSubclass into the test suite
	ScriptEngineClassTest.


diffstat:

 ChangeLog                                     |    6 +
 src/org/RhinoTests/ScriptEngineClassTest.java |  158 ++++++++++++++++++++++++++
 2 files changed, 164 insertions(+), 0 deletions(-)

diffs (181 lines):

diff -r 1bdd275b1a8d -r 8055f8294f0e ChangeLog
--- a/ChangeLog	Fri Sep 27 09:45:37 2013 +0200
+++ b/ChangeLog	Mon Sep 30 08:55:31 2013 +0200
@@ -1,3 +1,9 @@
+2013-09-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineClassTest.java:
+	Added new test testAsSubclass into the test suite
+	ScriptEngineClassTest.
+
 2013-09-27  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/ScriptExceptionClassTest.java:
diff -r 1bdd275b1a8d -r 8055f8294f0e src/org/RhinoTests/ScriptEngineClassTest.java
--- a/src/org/RhinoTests/ScriptEngineClassTest.java	Fri Sep 27 09:45:37 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java	Mon Sep 30 08:55:31 2013 +0200
@@ -1273,6 +1273,164 @@
     }
 
     /**
+     * Test for method javax.script.ScriptEngine.getClass().asSubclass()
+     */
+    protected void testAsSubclass() {
+        try {
+            this.scriptEngineClass.asSubclass(scriptEngineClass);
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+            throw new AssertionError(e.getMessage());
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Void.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Void.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Number.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Number.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Byte.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Byte.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Double.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Double.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Float.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Float.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Integer.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Integer.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Long.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Long.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.Short.class);
+            throw new AssertionError("Class.asSubclass(java.lang.Short.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.String.class);
+            throw new AssertionError("Class.asSubclass(java.lang.String.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.StringBuffer.class);
+            throw new AssertionError("Class.asSubclass(java.lang.StringBuffer.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.lang.StringBuilder.class);
+            throw new AssertionError("Class.asSubclass(java.lang.StringBuilder.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.awt.Color.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Color.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.awt.Font.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Font.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(java.awt.Image.class);
+            throw new AssertionError("Class.asSubclass(java.awt.Image.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(javax.swing.JPanel.class);
+            throw new AssertionError("Class.asSubclass(javax.swing.JPanel.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(javax.swing.JColorChooser.class);
+            throw new AssertionError("Class.asSubclass(javax.swing.JColorChooser.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(javax.swing.JScrollBar.class);
+            throw new AssertionError("Class.asSubclass(javax.swing.JScrollBar.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+        try {
+            this.scriptEngineClass.asSubclass(javax.swing.JSlider.class);
+            throw new AssertionError("Class.asSubclass(javax.swing.JSlider.class) does not throw any exception");
+        }
+        catch (Exception e) {
+            // expected exception
+        }
+
+    }
+
+    /**
      * Test for method javax.script.ScriptEngine.getClass().newInstance()
      */
     protected void testNewInstance() {


More information about the distro-pkg-dev mailing list