/hg/rhino-tests: Added four new tests testGetEnumConstants(), te...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Jul 31 04:53:35 PDT 2013


changeset 75127200e6a0 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=75127200e6a0
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Jul 31 13:57:08 2013 +0200

	Added four new tests testGetEnumConstants(), testGetTypeParameters(),
	testGetSigners() and testDesiredAssertionStatus()
	into ScriptEngineClassTest.


diffstat:

 ChangeLog                                     |   7 +++++
 src/org/RhinoTests/ScriptEngineClassTest.java |  37 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diffs (78 lines):

diff -r 8ebc2504f836 -r 75127200e6a0 ChangeLog
--- a/ChangeLog	Tue Jul 30 11:12:14 2013 +0200
+++ b/ChangeLog	Wed Jul 31 13:57:08 2013 +0200
@@ -1,3 +1,10 @@
+2013-07-31  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineClassTest.java:
+	Added four new tests testGetEnumConstants(), testGetTypeParameters(),
+	testGetSigners() and testDesiredAssertionStatus()
+	into ScriptEngineClassTest.
+
 2013-07-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
diff -r 8ebc2504f836 -r 75127200e6a0 src/org/RhinoTests/ScriptEngineClassTest.java
--- a/src/org/RhinoTests/ScriptEngineClassTest.java	Tue Jul 30 11:12:14 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineClassTest.java	Wed Jul 31 13:57:08 2013 +0200
@@ -52,9 +52,12 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
 
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineManager;
+import javax.script.ScriptEngine;
 
 
 
@@ -1022,6 +1025,7 @@
     protected void testGetAnnotations() {
         // following annotations should be provided
         final String[] annotationsThatShouldExists_jdk6 = {
+            // this should be really empty
         };
 
         final String[] annotationsThatShouldExists_jdk7 = {
@@ -1182,6 +1186,39 @@
     }
 
     /**
+     * Test for method javax.script.ScriptEngine.getClass().getEnumConstants()
+     */
+    protected void testGetEnumConstants() {
+        Object[] enumConstants = this.scriptEngineClass.getEnumConstants();
+        assertNull(enumConstants, "getEnumConstants() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngine.getClass().getTypeParameters()
+     */
+    protected void testGetTypeParameters() {
+        TypeVariable<?>[] typeParameters = this.scriptEngineClass.getTypeParameters();
+        assertNotNull(typeParameters, "getTypeParameters() return null");
+        assertEquals(0, typeParameters.length, "array of wrong size returned by getTypeParameters() " + typeParameters.length);
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngine.getClass().getSigners()
+     */
+    protected void testGetSigners() {
+        Object[] signers = this.scriptEngineClass.getSigners();
+        assertNull(signers, "getSigners() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngine.getClass().desiredAssertionStatus()
+     */
+    protected void testDesiredAssertionStatus() {
+        assertFalse(this.scriptEngineClass.desiredAssertionStatus(),
+                "Method ScriptEngine.getClass().desiredAssertionStatus() returns wrong value");
+    }
+
+    /**
      * Test for instanceof operator applied to a class javax.script.ScriptEngine
      */
     @SuppressWarnings("cast")



More information about the distro-pkg-dev mailing list