/hg/icedtea-web: Simplifying the testcases output in JSToJSet an...
jfabriko at icedtea.classpath.org
jfabriko at icedtea.classpath.org
Wed Oct 31 09:06:53 PDT 2012
changeset 34a7d51b30f5 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=34a7d51b30f5
author: Jana Fabrikova <jfabriko at redhat.com>
date: Wed Oct 31 17:07:58 2012 +0100
Simplifying the testcases output in JSToJSet and JSToJGet reproducers.
diffstat:
ChangeLog | 7 ++
tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java | 22 +++----
tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java | 30 +++++-----
3 files changed, 32 insertions(+), 27 deletions(-)
diffs (122 lines):
diff -r 9327b9bd2d37 -r 34a7d51b30f5 ChangeLog
--- a/ChangeLog Mon Oct 29 15:07:56 2012 -0400
+++ b/ChangeLog Wed Oct 31 17:07:58 2012 +0100
@@ -1,3 +1,10 @@
+2012-10-31 Jana Fabrikova <jfabriko at redhat.com>
+
+ *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 <omajid at redhat.com>
* tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp,
diff -r 9327b9bd2d37 -r 34a7d51b30f5 tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java
--- a/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java Mon Oct 29 15:07:56 2012 -0400
+++ b/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java Wed Oct 31 17:07:58 2012 +0100
@@ -74,12 +74,12 @@
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 @@
}
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 -r 9327b9bd2d37 -r 34a7d51b30f5 tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java
--- a/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java Mon Oct 29 15:07:56 2012 -0400
+++ b/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java Wed Oct 31 17:07:58 2012 +0100
@@ -66,12 +66,12 @@
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 @@
}
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());
More information about the distro-pkg-dev
mailing list