changeset 44:fc600356b864 draft

Added five new tests to the test suite src/org/RhinoTests/SimpleScriptContextClassTest.java.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Tue, 02 Oct 2012 10:59:08 +0200
parents 581f4fa2e76f
children 66320ce2a04f
files ChangeLog src/org/RhinoTests/SimpleScriptContextClassTest.java
diffstat 2 files changed, 64 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 01 10:43:13 2012 +0200
+++ b/ChangeLog	Tue Oct 02 10:59:08 2012 +0200
@@ -1,3 +1,8 @@
+2012-10-02  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/RhinoTests/SimpleScriptContextClassTest.java:
+	Added five new tests to this test suite.
+
 2012-10-01  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/ScriptExceptionClassTest.java:
--- a/src/org/RhinoTests/SimpleScriptContextClassTest.java	Mon Oct 01 10:43:13 2012 +0200
+++ b/src/org/RhinoTests/SimpleScriptContextClassTest.java	Tue Oct 02 10:59:08 2012 +0200
@@ -70,7 +70,7 @@
     /**
      * Object that represents the type of one SimpleScriptContext instance.
      */
-    Class simpleScriptContextClass = null;
+    Class<?> simpleScriptContextClass = null;
 
     @Override
     protected void setUp(String[] args) {
@@ -142,10 +142,64 @@
     }
 
     /**
+     * Test for method javax.script.SimpleScriptContext.getClass().isAnnotation()
+     */
+    protected void testIsAnnotation() {
+        assertFalse(this.simpleScriptContextClass.isAnnotation(),
+                "Method SimpleScriptContext.getClass().isAnnotation() returns wrong value");
+    }
+
+    /**
+     * Test for method javax.script.SimpleScriptContext.getClass().isAnnotationPresent()
+     */
+    protected void testIsAnnotationPresent() {
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.annotation.Annotation.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.annotation.Annotation.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.annotation.Documented.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.annotation.Documented.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.annotation.Inherited.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.annotation.Inherited.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.annotation.Retention.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.annotation.Retention.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.annotation.Target.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.annotation.Target.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.Deprecated.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.Deprecated.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.Override.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.Override.class) returns wrong value");
+        assertFalse(this.simpleScriptContextClass.isAnnotationPresent(java.lang.SuppressWarnings.class),
+                "Method SimpleScriptContext.getClass().isAnnotationPresent(java.lang.SuppressWarnings.class) returns wrong value");
+    }
+
+    /**
+     * Test for method javax.script.SimpleScriptContext.getClass().isAnonymousClass()
+     */
+    protected void testIsAnonymousClass() {
+        assertFalse(this.simpleScriptContextClass.isAnonymousClass(),
+                "Method SimpleScriptContext.getClass().isAnonymousClass() returns wrong value");
+    }
+
+    /**
+     * Test for method javax.script.SimpleScriptContext.getClass().isArray()
+     */
+    protected void testIsArray() {
+        assertFalse(this.simpleScriptContextClass.isArray(),
+                "Method SimpleScriptContext.getClass().isArray() returns wrong value");
+    }
+
+    /**
+     * Test for method javax.script.SimpleScriptContext.getClass().isEnum()
+     */
+    protected void testIsEnum() {
+        assertFalse(this.simpleScriptContextClass.isEnum(),
+                "Method SimpleScriptContext.getClass().isEnum() returns wrong value");
+    }
+
+    /**
      * Test for method javax.script.SimpleScriptContext.getClass().getInterfaces()
      */
     protected void testGetInterfaces() {
-        List interfaces = Arrays.asList(this.simpleScriptContextClass.getInterfaces());
+        List<Class<?>> interfaces = Arrays.asList(this.simpleScriptContextClass.getInterfaces());
         assertTrue(interfaces.contains(ScriptContext.class),
                 "list of implemented interfaces does not contain ScriptContext");
     }
@@ -213,7 +267,7 @@
      * Test for method javax.script.SimpleScriptContext.getClass().getSuperclass()
      */
     protected void testGetSuperclass() {
-        Class superClass = this.simpleScriptContextClass.getSuperclass();
+        Class<?> superClass = this.simpleScriptContextClass.getSuperclass();
         String superClassName = superClass.getName();
         assertEquals(superClassName, "java.lang.Object",
                 "Method SimpleScriptContext.getClass().getSuperclass() returns wrong value " + superClassName);
@@ -223,7 +277,7 @@
      * Test for method javax.script.SimpleScriptContext.getClass().getConstructors()
      */
     protected void testGetConstructors() {
-        Constructor[] constructors = this.simpleScriptContextClass.getConstructors();
+        Constructor<?>[] constructors = this.simpleScriptContextClass.getConstructors();
         assertEquals(constructors.length, 1, "only one constructor should be set");
         String constructorName;
         String constructorString;
@@ -239,7 +293,7 @@
      * Test for method javax.script.SimpleScriptContext.getClass().getDeclaredConstructors()
      */
     protected void testGetDeclaredConstructors() {
-        Constructor[] constructors = this.simpleScriptContextClass.getDeclaredConstructors();
+        Constructor<?>[] constructors = this.simpleScriptContextClass.getDeclaredConstructors();
         assertEquals(constructors.length, 1, "only one constructor should be set");
         String constructorName;
         String constructorString;