changeset 17:50619c42d67c draft

Renamed all test scripts so its names are now more descriptive. Mention problems with JDK7 in BUGS file.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Mon, 30 Jul 2012 15:33:41 +0200
parents 60e68ea5a35f
children 77d7df3f99f8
files BUGS ChangeLog Makefile scripts/test1.js scripts/test2.js scripts/test3.js scripts/test4.js scripts/test5.js scripts/test6.js scripts/test7.js scripts/test_empty_script_1.js scripts/test_hello_world.js scripts/test_invalid_command_1.js scripts/test_invalid_command_2.js scripts/test_invalid_command_3.js scripts/test_invalid_parameter.js scripts/test_unknown_function.js src/org/RhinoTests/JavaScriptsTest.java src/org/RhinoTests/ScriptExceptionTest.java
diffstat 19 files changed, 80 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/BUGS	Thu Jul 26 14:39:16 2012 +0200
+++ b/BUGS	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,4 @@
+List of known bugs and limitations:
+
+- some tests need to be updated to run correctly under JDK7 (OpenJDK7 etc.)
+
--- a/ChangeLog	Thu Jul 26 14:39:16 2012 +0200
+++ b/ChangeLog	Mon Jul 30 15:33:41 2012 +0200
@@ -1,3 +1,27 @@
+2012-07-30  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* BUGS:
+	Mention problems with JDK7.
+	* scripts/test1.js:
+	* scripts/test2.js:
+	* scripts/test3.js:
+	* scripts/test4.js:
+	* scripts/test5.js:
+	* scripts/test6.js:
+	* scripts/test7.js:
+	* scripts/test_empty_script_1.js:
+	* scripts/test_hello_world.js:
+	* scripts/test_invalid_command_1.js:
+	* scripts/test_invalid_command_2.js:
+	* scripts/test_invalid_command_3.js:
+	* scripts/test_invalid_parameter.js:
+	* scripts/test_unknown_function.js:
+	* src/org/RhinoTests/JavaScriptsTest.java:
+	* src/org/RhinoTests/ScriptExceptionTest.java:
+	* Makefile:
+	Renamed test scripts so its names are now more
+	descriptive.
+
 2012-07-26  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/RhinoTests/CompiledScriptTest.java:
--- a/Makefile	Thu Jul 26 14:39:16 2012 +0200
+++ b/Makefile	Mon Jul 30 15:33:41 2012 +0200
@@ -95,12 +95,13 @@
 	$(BUILD_DIR)/$(TEST_PACKAGE)/SimpleScriptContextClassTest.class
 
 ALL_SCRIPTS = \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test1.js \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test2.js \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test3.js \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test4.js \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test5.js \
-	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test6.js
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_hello_world.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_empty_script_1.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_invalid_command_1.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_invalid_command_2.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_invalid_command_3.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_invalid_parameter.js \
+	$(BUILD_DIR)/$(TEST_PACKAGE)/$(SCRIPTS)/test_unknown_function.js
 
 all:	build runtests
 
--- a/scripts/test1.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-println('\tHello world');
--- a/scripts/test2.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-
--- a/scripts/test3.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-_unknown_function_('\tHello world!')
--- a/scripts/test4.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-println(bflmpsvz)
--- a/scripts/test5.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-xyzzy
--- a/scripts/test6.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-println('\t1st line');
-println('\t2nd line');
-xyzzy
--- a/scripts/test7.js	Thu Jul 26 14:39:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-println('\t1st line');
-println('\t2nd line');
-xyzzy
-println('\t4th line');
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_empty_script_1.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,1 @@
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_hello_world.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,1 @@
+println('\tHello world');
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_invalid_command_1.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,1 @@
+xyzzy
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_invalid_command_2.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,3 @@
+println('\t1st line');
+println('\t2nd line');
+xyzzy
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_invalid_command_3.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,4 @@
+println('\t1st line');
+println('\t2nd line');
+xyzzy
+println('\t4th line');
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_invalid_parameter.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,1 @@
+println(bflmpsvz)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/test_unknown_function.js	Mon Jul 30 15:33:41 2012 +0200
@@ -0,0 +1,1 @@
+_unknown_function_('\tHello world!')
--- a/src/org/RhinoTests/JavaScriptsTest.java	Thu Jul 26 14:39:16 2012 +0200
+++ b/src/org/RhinoTests/JavaScriptsTest.java	Mon Jul 30 15:33:41 2012 +0200
@@ -334,26 +334,38 @@
 
     /**
      * Test if script can be run from external file.
-     * @see scripts/test1.js
+     * @see scripts/test_hello_world.js
      * 
      * @throws ScriptException
      *             this exception is thrown when this test case failed.
      */
-    protected void testRunSimpleScriptFromStoredInFile() throws ScriptException {
-        InputStream inputStream = this.getClass().getResourceAsStream("scripts/test1.js");
+    protected void testRunSimpleScriptStoredInFile() throws ScriptException {
+        InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_hello_world.js");
         this.scriptEngine.eval(new InputStreamReader(inputStream));
     }
 
     /**
-     * Test if exception is thrown when external script is empty.
-     * @see scripts/test2.js
+     * Test if empty script can be run from external file.
+     * @see scripts/test_empty_script_1.js
      * 
      * @throws Exception
      *             this exception is thrown when this test case failed.
      */
-    protected void testRunSimpleScriptFromStoredInFileNegative() throws Exception {
+    protected void testRunEmptyScript1StoredInFile() throws Exception {
+        InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_empty_script_1.js");
+        this.scriptEngine.eval(new InputStreamReader(inputStream));
+    }
+
+    /**
+     * Test if exception is thrown when external script contains error.
+     * @see scripts/test_unknown_function.js
+     * 
+     * @throws Exception
+     *             this exception is thrown when this test case failed.
+     */
+    protected void testRunScriptContainingUnknownFunctionFromFile() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test2.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_unknown_function.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -364,14 +376,14 @@
 
     /**
      * Test if exception is thrown when external script contains error.
-     * @see scripts/test3.js
+     * @see scripts/test_invalid_parameter.js
      * 
      * @throws Exception
      *             this exception is thrown when this test case failed.
      */
-    protected void testRunScriptContainingUnknownFunctionFromFile() throws Exception {
+    protected void testRunScriptContainingError1FromFile() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test3.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_parameter.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -382,32 +394,14 @@
 
     /**
      * Test if exception is thrown when external script contains error.
-     * @see scripts/test4.js
-     * 
-     * @throws Exception
-     *             this exception is thrown when this test case failed.
-     */
-    protected void testRunScriptContainingError1FromFile() throws Exception {
-        try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test4.js");
-            this.scriptEngine.eval(new InputStreamReader(inputStream));
-        }
-        catch (ScriptException e) {
-            return; // ok, it's correct if this exception is thrown
-        }
-        throw new Exception("ScriptException not thrown as expected");
-    }
-
-    /**
-     * Test if exception is thrown when external script contains error.
-     * @see scripts/test5.js
+     * @see scripts/test_invalid_command_1.js
      * 
      * @throws Exception
      *             this exception is thrown when this test case failed.
      */
     protected void testRunScriptContainingError2FromFile() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test5.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_command_1.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
--- a/src/org/RhinoTests/ScriptExceptionTest.java	Thu Jul 26 14:39:16 2012 +0200
+++ b/src/org/RhinoTests/ScriptExceptionTest.java	Mon Jul 30 15:33:41 2012 +0200
@@ -243,7 +243,7 @@
      */
     protected void testBasicScriptExceptionTestErrorInExternalScript1() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test3.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_unknown_function.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -262,7 +262,7 @@
      */
     protected void testBasicScriptExceptionTestErrorInExternalScript2() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test4.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_parameter.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -281,7 +281,7 @@
      */
     protected void testBasicScriptExceptionTestErrorInExternalScript3() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test5.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_command_1.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -300,7 +300,7 @@
      */
     protected void testBasicScriptExceptionTestErrorInExternalScript4() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test4.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_parameter.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -361,7 +361,7 @@
      */
     protected void testScriptExceptionTestLineNumber3() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test3.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_unknown_function.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -381,7 +381,7 @@
      */
     protected void testScriptExceptionTestLineNumber4() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test4.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_parameter.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -401,7 +401,7 @@
      */
     protected void testScriptExceptionTestLineNumber5() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test5.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_command_1.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -421,7 +421,7 @@
      */
     protected void testScriptExceptionTestLineNumber6() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test6.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_command_2.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {
@@ -441,7 +441,7 @@
      */
     protected void testScriptExceptionTestLineNumber7() throws Exception {
         try {
-            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test7.js");
+            InputStream inputStream = this.getClass().getResourceAsStream("scripts/test_invalid_command_3.js");
             this.scriptEngine.eval(new InputStreamReader(inputStream));
         }
         catch (ScriptException e) {