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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Sep 24 00:47:33 PDT 2013


changeset d1076a7a7c31 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=d1076a7a7c31
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Sep 24 09:51:17 2013 +0200

	Added new test testNewInstance into the test suite ScriptContextClassTest.


diffstat:

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

diffs (40 lines):

diff -r 187af2160af7 -r d1076a7a7c31 ChangeLog
--- a/ChangeLog	Mon Sep 23 10:37:44 2013 +0200
+++ b/ChangeLog	Tue Sep 24 09:51:17 2013 +0200
@@ -1,3 +1,9 @@
+2013-09-24  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptContextClassTest.java:
+	Added new test testNewInstance into the test suite
+	ScriptContextClassTest.
+
 2013-09-23  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/InvocableClassTest.java:
diff -r 187af2160af7 -r d1076a7a7c31 src/org/RhinoTests/ScriptContextClassTest.java
--- a/src/org/RhinoTests/ScriptContextClassTest.java	Mon Sep 23 10:37:44 2013 +0200
+++ b/src/org/RhinoTests/ScriptContextClassTest.java	Tue Sep 24 09:51:17 2013 +0200
@@ -1562,6 +1562,23 @@
     }
 
     /**
+     * Test for method javax.script.ScriptContext.getClass().newInstance()
+     */
+    protected void testNewInstance() {
+        try {
+            Object o = this.scriptContextClass.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.ScriptContext
      */
     @SuppressWarnings("cast")


More information about the distro-pkg-dev mailing list