Mercurial > hg > rhino-tests
changeset 40:0c41d28346b9 draft
Five new tests & fixed some minor issues in the test case
src/org/RhinoTests/CompiledScriptClassTest.java.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Fri, 21 Sep 2012 13:04:34 +0200 |
parents | c07fce915c2b |
children | 466d720bca82 |
files | ChangeLog src/org/RhinoTests/CompiledScriptClassTest.java |
diffstat | 2 files changed, 63 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Sep 20 12:05:21 2012 +0200 +++ b/ChangeLog Fri Sep 21 13:04:34 2012 +0200 @@ -1,3 +1,8 @@ +2012-09-21 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/RhinoTests/CompiledScriptClassTest.java: + Five new tests & fixed some minor issues. + 2012-09-20 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/RhinoTests/CompilableTest.java:
--- a/src/org/RhinoTests/CompiledScriptClassTest.java Thu Sep 20 12:05:21 2012 +0200 +++ b/src/org/RhinoTests/CompiledScriptClassTest.java Fri Sep 21 13:04:34 2012 +0200 @@ -190,10 +190,64 @@ } /** + * Test for method javax.script.CompiledScript.getClass().isAnnotation() + */ + protected void testIsAnnotation() { + assertFalse(this.compiledScriptClass.isAnnotation(), + "Method CompiledScript.getClass().isAnnotation() returns wrong value"); + } + + /** + * Test for method javax.script.CompiledScript.getClass().isAnnotationPresent() + */ + protected void testIsAnnotationPresent() { + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.annotation.Annotation.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.annotation.Annotation.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.annotation.Documented.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.annotation.Documented.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.annotation.Inherited.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.annotation.Inherited.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.annotation.Retention.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.annotation.Retention.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.annotation.Target.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.annotation.Target.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.Deprecated.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.Deprecated.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.Override.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.Override.class) returns wrong value"); + assertFalse(this.compiledScriptClass.isAnnotationPresent(java.lang.SuppressWarnings.class), + "Method CompiledScript.getClass().isAnnotationPresent(java.lang.SuppressWarnings.class) returns wrong value"); + } + + /** + * Test for method javax.script.CompiledScript.getClass().isAnonymousClass() + */ + protected void testIsAnonymousClass() { + assertFalse(this.compiledScriptClass.isAnonymousClass(), + "Method CompiledScript.getClass().isAnonymousClass() returns wrong value"); + } + + /** + * Test for method javax.script.CompiledScript.getClass().isArray() + */ + protected void testIsArray() { + assertFalse(this.compiledScriptClass.isArray(), + "Method CompiledScript.getClass().isArray() returns wrong value"); + } + + /** + * Test for method javax.script.CompiledScript.getClass().isEnum() + */ + protected void testIsEnum() { + assertFalse(this.compiledScriptClass.isEnum(), + "Method CompiledScript.getClass().isEnum() returns wrong value"); + } + + /** * Test for method javax.script.CompiledScript.getClass().getInterfaces() */ protected void testGetInterfaces() { - List interfaces = Arrays.asList(this.compiledScriptClass.getInterfaces()); + List<Class<?>> interfaces = Arrays.asList(this.compiledScriptClass.getInterfaces()); assertTrue(interfaces.isEmpty(), "list of implemented interfaces should be empty"); } @@ -261,7 +315,7 @@ * Test for method javax.script.CompiledScript.getClass().getSuperclass() */ protected void testGetSuperclass() { - Class superClass = this.compiledScriptClass.getSuperclass(); + Class<?> superClass = this.compiledScriptClass.getSuperclass(); String superClassName = superClass.getName(); assertEquals(superClassName, "java.lang.Object", "Method CompiledScript.getClass().getSuperclass() returns wrong value " + superClassName); @@ -271,7 +325,7 @@ * Test for method javax.script.CompiledScript.getClass().getConstructors() */ protected void testGetConstructors() { - Constructor[] constructors = this.compiledScriptClass.getConstructors(); + Constructor<?>[] constructors = this.compiledScriptClass.getConstructors(); assertEquals(constructors.length, 1, "only one constructor should be set"); String constructorName; String constructorString; @@ -287,7 +341,7 @@ * Test for method javax.script.CompiledScript.getClass().getDeclaredConstructors() */ protected void testGetDeclaredConstructors() { - Constructor[] constructors = this.compiledScriptClass.getDeclaredConstructors(); + Constructor<?>[] constructors = this.compiledScriptClass.getDeclaredConstructors(); assertEquals(constructors.length, 1, "only one constructor should be set"); String constructorName; String constructorString;