aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java')
-rw-r--r--tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java25
1 files changed, 6 insertions, 19 deletions
diff --git a/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java b/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java
index a3a2b92..be47347 100644
--- a/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java
+++ b/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java
@@ -36,7 +36,9 @@ exception statement from your version.
*/
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import net.sourceforge.jnlp.ContentReaderListener;
import net.sourceforge.jnlp.ProcessResult;
import net.sourceforge.jnlp.ServerAccess;
import net.sourceforge.jnlp.annotations.Bug;
@@ -44,13 +46,14 @@ import net.sourceforge.jnlp.annotations.NeedsDisplay;
import net.sourceforge.jnlp.browsertesting.BrowserTest;
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.annotations.TestInBrowsers;
+import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener;
import org.junit.Assert;
import org.junit.Test;
@Bug(id={"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016127.html","PR804","PR811"})
public class SpacesCanBeEverywhereTests extends BrowserTest {
-
+public static final String s = "Spaces can be everywhere.jsr was launched correctly";
@Bug(id="PR811")
@Test
@NeedsDisplay
@@ -83,10 +86,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
* only on ocal files, and probably only from test run - it can be ignored
*/
ProcessResult pr = ServerAccess.executeProcess(commands);
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
- String cc = "xception";
- Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
Assert.assertFalse("should not be terminated, but was", pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
@@ -96,11 +96,8 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@NeedsDisplay
public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2() throws Exception {
ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too.jnlp");
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
- String cc = "xception";
- Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
- Assert.assertFalse("should NOT be terminated, but was not", pr.wasTerminated);
+ Assert.assertFalse("should NOT be terminated, but was", pr.wasTerminated);
}
@Bug(id="PR811")
@@ -108,11 +105,8 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@NeedsDisplay
@TestInBrowsers(testIn = {Browsers.all})
public void SpacesCanBeEverywhereRemoteAppletTestsHtml2() throws Exception {
- ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html");
- String s="Spaces can be everywhere.jsr was launched correctly";
+ ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html", Arrays.asList(new ContentReaderListener[] {new StringBasedClosingListener(s)}), null);
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
- String cc = "xception";
- Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
Assert.assertTrue("should be terminated, but was not", pr.wasTerminated);
}
@@ -133,7 +127,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@Test
public void SpacesCanBeEverywhereRemoteTests2() throws Exception {
ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp");
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -145,7 +138,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@Test
public void SpacesCanBeEverywhereRemoteTests2_withQuery1() throws Exception {
ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test=10");
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -158,7 +150,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@Test
public void SpacesCanBeEverywhereRemoteTests2_withQuery2() throws Exception {
ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test%3D10");
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -170,7 +161,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
@Test
public void SpacesCanBeEverywhereRemoteTests3() throws Exception {
ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1.jnlp");
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -203,7 +193,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
commands.add(ServerAccess.HEADLES_OPTION);
commands.add("Spaces can be everywhere2.jnlp");
ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -219,7 +208,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
commands.add(ServerAccess.HEADLES_OPTION);
commands.add(server.getDir()+"/Spaces can be everywhere2.jnlp");
ProcessResult pr = ServerAccess.executeProcess(commands);
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
@@ -235,7 +223,6 @@ public class SpacesCanBeEverywhereTests extends BrowserTest {
commands.add(ServerAccess.HEADLES_OPTION);
commands.add("SpacesCanBeEverywhere1.jnlp");
ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
- String s="Spaces can be everywhere.jsr was launched correctly";
Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
String cc = "ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));