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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Jul 29 03:10:24 PDT 2013


changeset 7c346e26d3d8 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=7c346e26d3d8
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Jul 29 12:13:59 2013 +0200

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


diffstat:

 ChangeLog                                            |   7 +++
 src/org/RhinoTests/ScriptEngineFactoryClassTest.java |  38 ++++++++++++++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)

diffs (82 lines):

diff -r a12dc926e709 -r 7c346e26d3d8 ChangeLog
--- a/ChangeLog	Fri Jul 26 11:03:56 2013 +0200
+++ b/ChangeLog	Mon Jul 29 12:13:59 2013 +0200
@@ -1,3 +1,10 @@
+2013-07-29  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptEngineFactoryClassTest.java:
+	Added four new tests testGetEnumConstants(), testGetTypeParameters(),
+	testGetSigners() and testDesiredAssertionStatus()
+	into ScriptEngineFactoryClassTest.
+
 2013-07-26  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/ScriptEngineManagerClassTest.java:
diff -r a12dc926e709 -r 7c346e26d3d8 src/org/RhinoTests/ScriptEngineFactoryClassTest.java
--- a/src/org/RhinoTests/ScriptEngineFactoryClassTest.java	Fri Jul 26 11:03:56 2013 +0200
+++ b/src/org/RhinoTests/ScriptEngineFactoryClassTest.java	Mon Jul 29 12:13:59 2013 +0200
@@ -52,6 +52,8 @@
 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.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
@@ -914,12 +916,15 @@
     protected void testGetAnnotations() {
         // following annotations should be provided
         final String[] annotationsThatShouldExists_jdk6 = {
+            // this should be really empty
         };
 
         final String[] annotationsThatShouldExists_jdk7 = {
+            // this should be really empty
         };
 
         final String[] annotationsThatShouldExists_jdk8 = {
+            // this should be really empty
         };
 
         // get all annotations
@@ -1074,6 +1079,39 @@
     }
 
     /**
+     * Test for method javax.script.ScriptEngineFactory.getClass().getEnumConstants()
+     */
+    protected void testGetEnumConstants() {
+        Object[] enumConstants = this.scriptEngineFactoryClass.getEnumConstants();
+        assertNull(enumConstants, "getEnumConstants() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngineFactory.getClass().getTypeParameters()
+     */
+    protected void testGetTypeParameters() {
+        TypeVariable<?>[] typeParameters = this.scriptEngineFactoryClass.getTypeParameters();
+        assertNotNull(typeParameters, "getTypeParameters() return null");
+        assertEquals(0, typeParameters.length, "array of wrong size returned by getTypeParameters() " + typeParameters.length);
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngineFactory.getClass().getSigners()
+     */
+    protected void testGetSigners() {
+        Object[] signers = this.scriptEngineFactoryClass.getSigners();
+        assertNull(signers, "getSigners() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptEngineFactory.getClass().desiredAssertionStatus()
+     */
+    protected void testDesiredAssertionStatus() {
+        assertFalse(this.scriptEngineFactoryClass.desiredAssertionStatus(),
+                "Method ScriptEngineFactory.getClass().desiredAssertionStatus() returns wrong value");
+    }
+
+    /**
      * Test for instanceof operator applied to a class javax.script.ScriptEngineFactory
      */
     @SuppressWarnings("cast")



More information about the distro-pkg-dev mailing list