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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Sep 13 01:42:50 PDT 2013


changeset 61ed92f655a5 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=61ed92f655a5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Sep 13 10:46:37 2013 +0200

	Added new test testNewInstance into the test suite
	AbstractScriptEngineClassTest.


diffstat:

 ChangeLog                                             |   6 ++++++
 src/org/RhinoTests/AbstractScriptEngineClassTest.java |  17 +++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r 78bab1320e16 -r 61ed92f655a5 ChangeLog
--- a/ChangeLog	Thu Sep 12 11:48:50 2013 +0200
+++ b/ChangeLog	Fri Sep 13 10:46:37 2013 +0200
@@ -1,3 +1,9 @@
+2013-09-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
+	Added new test testNewInstance into the test suite
+	AbstractScriptEngineClassTest.
+
 2013-09-12  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/ScriptContextClassTest.java:
diff -r 78bab1320e16 -r 61ed92f655a5 src/org/RhinoTests/AbstractScriptEngineClassTest.java
--- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Thu Sep 12 11:48:50 2013 +0200
+++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Fri Sep 13 10:46:37 2013 +0200
@@ -1677,6 +1677,23 @@
     }
 
     /**
+     * Test for method javax.script.AbstractScriptEngine.getClass().newInstance()
+     */
+    protected void testNewInstance() {
+        try {
+            Object o = this.abstractScriptEngineClass.newInstance();
+            throw new AssertionError("Class.newInstance() does not throw any exception");
+        }
+        catch (InstantiationException e) {
+            // expected exception
+        }
+        catch (IllegalAccessException e) {
+            // expected exception
+        }
+
+    }
+
+    /**
      * Test for instanceof operator applied to a class javax.script.AbstractScriptEngine
      */
     @SuppressWarnings("cast")



More information about the distro-pkg-dev mailing list