/hg/rhino-tests: Three new tests added into ScriptEngineClassTest.

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Mar 28 09:47:59 UTC 2014


changeset 9d409b2379c5 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=9d409b2379c5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Mar 28 10:48:43 2014 +0100

	Three new tests added into ScriptEngineClassTest.


diffstat:

 ChangeLog                                     |   5 ++++
 src/org/RhinoTests/ScriptEngineClassTest.java |  31 +++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diffs (60 lines):

diff -r 2b9db1e50f41 -r 9d409b2379c5 ChangeLog
--- a/ChangeLog	Thu Mar 27 10:02:20 2014 +0100
+++ b/ChangeLog	Fri Mar 28 10:48:43 2014 +0100
@@ -1,3 +1,8 @@
+2014-03-28  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineClassTest.java:
+	Three new tests added into ScriptEngineClassTest.
+
 2014-03-27  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/ScriptEngineClassTest.java:
diff -r 2b9db1e50f41 -r 9d409b2379c5 src/org/RhinoTests/ScriptEngineClassTest.java
--- a/src/org/RhinoTests/ScriptEngineClassTest.java	Thu Mar 27 10:02:20 2014 +0100
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java	Fri Mar 28 10:48:43 2014 +0100
@@ -2048,6 +2048,19 @@
     }
 
     /**
+     * Test for method javax.script.ScriptEngine.getClass().getResourceAsStreamNPETest()
+     */
+    protected void testGetResourceAsStreamNPETest() {
+        try {
+            Object resource = this.scriptEngineClass.getResourceAsStream(null);
+            throw new AssertionError("NullPointerException expected!");
+        }
+        catch (NullPointerException e) {
+            //This is OK OK
+        }
+    }
+
+    /**
      * Test for method javax.script.ScriptEngine.getClass().getResourceAsStreamNegativeTest()
      */
     protected void testGetResourceAsStreamNegativeTest() {
@@ -2109,6 +2122,24 @@
     }
 
     /**
+     * Test for method javax.script.ScriptEngine.getClass().getResourceAsStreamPositiveTest()
+     */
+    protected void testGetResourceAsStreamPositiveTest() {
+        Object stream;
+        stream = this.scriptEngineClass.getResourceAsStream("/org/RhinoTests/AbstractScriptEngineClassTest.class");
+        assertNotNull(stream, "getResourceAsStream(\"/org/RhinoTests/AbstractScriptEngineClassTest.class\") returns null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngine.getClass().toString()
+     */
+    protected void testToString() {
+        String asString;
+        asString = this.scriptEngineClass.toString();
+        assertEquals("interface javax.script.ScriptEngine", asString, "wrong toString() return value");
+    }
+
+    /**
      * Test for instanceof operator applied to a class javax.script.ScriptEngine
      */
     @SuppressWarnings("cast")


More information about the distro-pkg-dev mailing list