diff options
author | Jana Fabrikova <[email protected]> | 2012-10-31 17:07:58 +0100 |
---|---|---|
committer | Jana Fabrikova <[email protected]> | 2012-10-31 17:07:58 +0100 |
commit | 70681430e560a92c59175e7894ccc7820b33ee71 (patch) | |
tree | f0dc67c117197471c2765ee344dad468b2fbffe2 | |
parent | c1a0c080ff1b1b9ba864780b3636b206726d4a89 (diff) |
Simplifying the testcases output in JSToJSet and JSToJGet reproducers.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java | 22 | ||||
-rw-r--r-- | tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java | 30 |
3 files changed, 32 insertions, 27 deletions
@@ -1,3 +1,10 @@ +2012-10-31 Jana Fabrikova <[email protected]> + + *tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: + Modifying the testcase output to a simpler text. + *tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: + Modifying the testcase output to a simpler text. + 2012-10-29 Omair Majid <[email protected]> * tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp, diff --git a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java index 014dbcc..3425c89 100644 --- a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java +++ b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java @@ -74,12 +74,12 @@ public class JSToJGetTest extends BrowserTest { private void evaluateStdoutContents(String testStr, ProcessResult pr) { // Assert that the applet was initialized. - Assert.assertTrue("JSToJGetTest stdout should contain \"" + initStr - + "\" but it didn't.", pr.stdout.contains(initStr)); + Assert.assertTrue("JSToJGetTest stdout should contain " + initStr + + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the applet was set up for the GM tests. - Assert.assertTrue("JSToJGetTest stdout should contain \"" + setupStr - + "\" but it didn't.", pr.stdout.contains(setupStr)); + Assert.assertTrue("JSToJGetTest stdout should contain " + setupStr + + " but it didnt.", pr.stdout.contains(setupStr)); // Assert that the tests have passed. String s0 = testStr + passStr; @@ -99,26 +99,24 @@ public class JSToJGetTest extends BrowserTest { } String failStr = "JSToJGet " + testStr - + ": \"passed\" not found in the applet stdout, which is: " - + pr.stdout.substring(indBegin, pr.stdout.length()); + + ": passed not found in the applet stdout."; if (ind1 != -1) { // int inde = pr.stdout.indexOf(expStr); // int indf = pr.stdout.indexOf(foundStr); - int indend = pr.stdout.indexOf(endStr); - failStr = pr.stdout.substring(ind1, indend + endStr.length()); + // int indend = pr.stdout.indexOf(endStr); + failStr = "JSToJGet: value mismatch in "+testStr; } if (ind2 != -1) { // int inde = pr.stdout.indexOf(expStr); // int indf = pr.stdout.indexOf(foundStr); - int indend = pr.stdout.indexOf(endStr); - failStr = pr.stdout.substring(ind2, indend + endStr.length()); + // int indend = pr.stdout.indexOf(endStr); + failStr = "JSToJGet: type mismatch in "+testStr; } if (ind3 != -1) { - failStr = "JSToJGet: " + testStr - + pr.stdout.substring(ind3, pr.stdout.length()); + failStr = "JSToJGet: an error occured during " + testStr; } Assert.assertTrue(failStr, (ind3 == -1));// no error on Java side diff --git a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java index 83aff4b..196c60a 100644 --- a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java +++ b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java @@ -66,12 +66,12 @@ public class JSToJSetTest extends BrowserTest { private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. - Assert.assertTrue("JSToJSetTest stdout should contain \"" + initStr - + "\" but it didn't.", pr.stdout.contains(initStr)); + Assert.assertTrue("JSToJSet: the stdout should contain " + initStr + + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok - Assert.assertTrue("The output should include: "+expectedStdout+", but is: "+pr.stdout, - pr.stdout.contains(expectedStdout)); + Assert.assertTrue("JSToJSet: the output should include: "+expectedStdout+", but it didnt.", + pr.stdout.contains(expectedStdout)); } @@ -83,23 +83,23 @@ public class JSToJSetTest extends BrowserTest { } private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, int testType) throws Exception { - String strURL = "/JSToJSet.html?"; - String expectedStdout = ""; - switch( testType ){ + String strURL = "/JSToJSet.html?"; + String expectedStdout = ""; + switch( testType ){ case 0://array element - strURL += fieldStr + ";" + valueStr; - expectedStdout = "New array value is: "+valueStr; + strURL += fieldStr + ";" + valueStr; + expectedStdout = "New array value is: "+valueStr; break; case 1://whole array, set 1st element - strURL += fieldStr + ";[" + valueStr; - expectedStdout = "New array value is: "+valueStr; - break; + strURL += fieldStr + ";[" + valueStr; + expectedStdout = "New array value is: "+valueStr; + break; case 2://char et al - to be set at JS side - strURL += fieldStr + ";JavaScript"; - expectedStdout = "New value is: "+valueStr; + strURL += fieldStr + ";JavaScript"; + expectedStdout = "New value is: "+valueStr; break; default: - break; + break; } ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); |