/hg/rhino-tests: Added missing import into AbstractScriptEngineC...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Dec 3 00:59:29 PST 2012


changeset 9561522de605 in /hg/rhino-tests
details: http://icedtea.classpath.org/hg/rhino-tests?cmd=changeset;node=9561522de605
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Dec 03 10:02:31 2012 +0100

	Added missing import into AbstractScriptEngineClassTest and CompilableClassTest.
	Added eight new tests into CompilableTest and JavaScriptSnippets.


diffstat:

 ChangeLog                                             |   10 +
 src/org/RhinoTests/AbstractScriptEngineClassTest.java |    1 +
 src/org/RhinoTests/CompilableClassTest.java           |    1 +
 src/org/RhinoTests/CompilableTest.java                |  120 ++++++++++++++++++
 src/org/RhinoTests/JavaScriptSnippets.java            |   40 ++++++
 5 files changed, 172 insertions(+), 0 deletions(-)

diffs (219 lines):

diff -r 564fa4235e3e -r 9561522de605 ChangeLog
--- a/ChangeLog	Fri Nov 30 17:06:26 2012 +0100
+++ b/ChangeLog	Mon Dec 03 10:02:31 2012 +0100
@@ -1,3 +1,13 @@
+2012-12-03  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
+	* src/org/RhinoTests/CompilableClassTest.java:
+	Added missing import.
+
+	* src/org/RhinoTests/CompilableTest.java:
+	* src/org/RhinoTests/JavaScriptSnippets.java:
+	Added eight new tests.
+
 2012-11-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/RhinoTests/AbstractScriptEngineClassTest.java:
diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/AbstractScriptEngineClassTest.java
--- a/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Fri Nov 30 17:06:26 2012 +0100
+++ b/src/org/RhinoTests/AbstractScriptEngineClassTest.java	Mon Dec 03 10:02:31 2012 +0100
@@ -46,6 +46,7 @@
 import java.util.Map;
 import java.util.HashMap;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/CompilableClassTest.java
--- a/src/org/RhinoTests/CompilableClassTest.java	Fri Nov 30 17:06:26 2012 +0100
+++ b/src/org/RhinoTests/CompilableClassTest.java	Mon Dec 03 10:02:31 2012 +0100
@@ -46,6 +46,7 @@
 import java.util.Map;
 import java.util.HashMap;
 
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/CompilableTest.java
--- a/src/org/RhinoTests/CompilableTest.java	Fri Nov 30 17:06:26 2012 +0100
+++ b/src/org/RhinoTests/CompilableTest.java	Mon Dec 03 10:02:31 2012 +0100
@@ -208,6 +208,126 @@
     }
 
     /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString7() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_7);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString8() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_8);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString9() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_9);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString10() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_10);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString11() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_11);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString12() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_12);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString13() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_13);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
+     * Test if it is possible to compile script from a string.
+     * 
+     * @throws ScriptException
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testCompileEmptyScriptStoredInString14() throws ScriptException {
+        Compilable compilingEngine = (Compilable)this.scriptEngine;
+        assertNotNull(compilingEngine, "cannot get compiling engine");
+        if (compilingEngine != null) {
+            CompiledScript script = compilingEngine.compile(JavaScriptSnippets.EMPTY_SCRIPT_14);
+            assertNotNull(script, "cannot compile script");
+        }
+    }
+
+    /**
      * Test if it is possible to compile and then run script from a string.
      * 
      * @throws ScriptException
diff -r 564fa4235e3e -r 9561522de605 src/org/RhinoTests/JavaScriptSnippets.java
--- a/src/org/RhinoTests/JavaScriptSnippets.java	Fri Nov 30 17:06:26 2012 +0100
+++ b/src/org/RhinoTests/JavaScriptSnippets.java	Mon Dec 03 10:02:31 2012 +0100
@@ -78,6 +78,46 @@
     protected static final String EMPTY_SCRIPT_6 = " \t \t ";
 
     /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_7 = "\n";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_8 = "\n\n";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_9 = "\n\t";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_10 = "\t\n";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_11 = "\t\n\t";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_12 = "\n \n";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_13 = " \n \n";
+
+    /**
+     * Almost empty, but still valid script.
+     */
+    protected static final String EMPTY_SCRIPT_14 = "\n \n ";
+
+    /**
      * Numeric expression.
      */
     protected static final String NUMERIC_EXPRESSION_1 = "1+2";



More information about the distro-pkg-dev mailing list