/hg/rhino-tests: Nine new tests added into ScriptContextClassTes...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Jan 29 00:44:13 PST 2013


changeset 5292981a360e in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=5292981a360e
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Jan 29 09:47:12 2013 +0100

	Nine new tests added into ScriptContextClassTest test suite.


diffstat:

 ChangeLog                                      |   5 +
 src/org/RhinoTests/ScriptContextClassTest.java |  93 +++++++++++++++++++++++++-
 2 files changed, 97 insertions(+), 1 deletions(-)

diffs (136 lines):

diff -r 5920d0eeed31 -r 5292981a360e ChangeLog
--- a/ChangeLog	Mon Jan 28 09:58:25 2013 +0100
+++ b/ChangeLog	Tue Jan 29 09:47:12 2013 +0100
@@ -1,3 +1,8 @@
+2013-01-29  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/ScriptContextClassTest.java:
+	Nine new tests added into ScriptContextClassTest test suite.
+
 2013-01-28  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/BindingsClassTest.java:
diff -r 5920d0eeed31 -r 5292981a360e src/org/RhinoTests/ScriptContextClassTest.java
--- a/src/org/RhinoTests/ScriptContextClassTest.java	Mon Jan 28 09:58:25 2013 +0100
+++ b/src/org/RhinoTests/ScriptContextClassTest.java	Tue Jan 29 09:47:12 2013 +0100
@@ -1,7 +1,7 @@
 /*
   Rhino test framework
 
-   Copyright (C) 2011, 2012  Red Hat
+   Copyright (C) 2011, 2012, 2013  Red Hat
 
 This file is part of IcedTea.
 
@@ -45,6 +45,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.TreeMap;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
@@ -261,6 +262,15 @@
     }
 
     /**
+     * Test for method javax.script.ScriptContext.getClass().getCanonicalName()
+     */
+    protected void testGetCanonicalName() {
+        String canonicalName = this.scriptContextClass.getCanonicalName();
+        assertEquals(canonicalName, "javax.script.ScriptContext",
+                "Method javax.script.ScriptContext.getClass().getCanonicalName() returns wrong value " + canonicalName);
+    }
+
+    /**
      * Test for method javax.script.ScriptContext.getClass().getSuperclass()
      */
     protected void testGetSuperclass() {
@@ -544,6 +554,87 @@
     }
 
     /**
+     * Test for method javax.script.ScriptContext.getClass().getAnnotation()
+     */
+    protected void testGetAnnotation() {
+        Annotation annotation;
+        annotation = this.scriptContextClass.getAnnotation(java.lang.annotation.Annotation.class);
+        assertNull(annotation, "annotation java.lang.annotation.Annotation should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.annotation.Documented.class);
+        assertNull(annotation, "annotation java.lang.annotation.Documented should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.annotation.Inherited.class);
+        assertNull(annotation, "annotation java.lang.annotation.Inherited should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.annotation.Retention.class);
+        assertNull(annotation, "annotation java.lang.annotation.Retention should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.annotation.Target.class);
+        assertNull(annotation, "annotation java.lang.annotation.Target should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.Deprecated.class);
+        assertNull(annotation, "annotation java.lang.Deprecated should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.Override.class);
+        assertNull(annotation, "annotation java.lang.Override should not be returned");
+        annotation = this.scriptContextClass.getAnnotation(java.lang.SuppressWarnings.class);
+        assertNull(annotation, "annotation java.lang.SuppressWarnings should not be returned");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getComponentType()
+     */
+    protected void testGetComponentType() {
+        Class<?> cls = this.scriptContextClass.getComponentType();
+        assertNull(cls, "getComponentType() should returns null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getClasses()
+     */
+    protected void testGetClasses() {
+        Class<?>[] cls = this.scriptContextClass.getClasses();
+        assertNotNull(cls, "getClasses() returns null");
+        assertEquals(cls.length, 0, "getClasses() returns wrong value!");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getDeclaredClasses()
+     */
+    protected void testGetDeclaredClasses() {
+        Class<?>[] cls = this.scriptContextClass.getDeclaredClasses();
+        assertNotNull(cls, "getDeclaredClasses() returns null");
+        assertEquals(cls.length, 0, "getDeclaredClasses() returns wrong value!");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getDeclaringClass()
+     */
+    protected void testGetDeclaringClass() {
+        Class<?> cls = this.scriptContextClass.getDeclaringClass();
+        assertNull(cls, "getDeclaringClass() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getEnclosingClass()
+     */
+    protected void testGetEnclosingClass() {
+        Class<?> cls = this.scriptContextClass.getEnclosingClass();
+        assertNull(cls, "getEnclosingClass() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getEnclosingConstructor()
+     */
+    protected void testGetEnclosingConstructor() {
+        Constructor<?> cons = this.scriptContextClass.getEnclosingConstructor();
+        assertNull(cons, "getEnclosingConstructor() does not return null");
+    }
+
+    /**
+     * Test for method javax.script.ScriptContext.getClass().getEnclosingMethod()
+     */
+    protected void testGetEnclosingMethod() {
+        Method m = this.scriptContextClass.getEnclosingMethod();
+        assertNull(m, "getEnclosingMethod() does not return null");
+    }
+
+    /**
      * Test for instanceof operator applied to a class javax.script.ScriptContext
      */
     @SuppressWarnings("cast")



More information about the distro-pkg-dev mailing list