aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-11-25 16:54:23 +0100
committerJiri Vanek <[email protected]>2013-11-25 16:54:23 +0100
commitb8da03fd7a7aac183acebf7ccd26196ccafca9bc (patch)
tree945106c698d36e154761be126d24fd53848bccd7 /tests
parent18e9c2de7a762336e0b558f3007340d5eb2e9e44 (diff)
Removed most of checks to no output from reproducers
Diffstat (limited to 'tests')
-rw-r--r--tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java50
-rw-r--r--tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java1
-rw-r--r--tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java3
-rw-r--r--tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java1
-rw-r--r--tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java1
-rw-r--r--tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java1
-rw-r--r--tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java1
-rw-r--r--tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java2
-rw-r--r--tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java1
-rw-r--r--tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java1
-rw-r--r--tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java1
-rw-r--r--tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java1
12 files changed, 33 insertions, 31 deletions
diff --git a/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java b/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java
index 40beca0..053e8fa 100644
--- a/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java
+++ b/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java
@@ -37,6 +37,7 @@
import java.net.MalformedURLException;
import java.net.URL;
+import net.sourceforge.jnlp.JNLPFile;
import net.sourceforge.jnlp.ProcessResult;
import org.junit.Assert;
import org.junit.Test;
@@ -70,6 +71,9 @@ public class RemoteApplicationSettings {
URL u;
+ public String clean(String s){
+ return s.replaceAll("\\s*" + JNLPFile.TITLE_NOT_FOUND + "\\s*", "").trim();
+ }
@Override
public URL getUrl() {
return u;
@@ -88,8 +92,8 @@ public class RemoteApplicationSettings {
@Override
public void evaluate(ProcessResult pr) {
- Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0);
- Assert.assertTrue(pr.stderr.length() == 0 || pr.stderr.contains(IllegalStateException.class.getName()));
+ Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0);
+ Assert.assertTrue(clean(pr.stderr).length() == 0 || pr.stderr.contains(IllegalStateException.class.getName()));
}
}
@@ -102,8 +106,8 @@ public class RemoteApplicationSettings {
@Override
public void evaluate(ProcessResult pr) {
- Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0);
- Assert.assertTrue(pr.stderr.length() == 0 || pr.stderr.contains("Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed"));
+ Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0);
+ Assert.assertTrue(clean(pr.stderr).length() == 0 || pr.stderr.contains("Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed"));
}
}
@@ -116,7 +120,7 @@ public class RemoteApplicationSettings {
@Override
public void evaluate(ProcessResult pr) {
- Assert.assertTrue(stdout, pr.stdout.length() == 0);
+ Assert.assertTrue(stdout, clean(pr.stdout).length() == 0);
Assert.assertTrue(pr.stderr.contains("Splash closed"));
Assert.assertFalse(pr.stderr.contains("Exception"));
@@ -131,10 +135,8 @@ public class RemoteApplicationSettings {
@Override
public void evaluate(ProcessResult pr) {
- Assert.assertTrue(pr.stdout.length() > 0);
- Assert.assertTrue(pr.stderr.length() > 0);
- Assert.assertFalse(pr.stderr.contains("Exception"));
- Assert.assertFalse(pr.stdout.contains("Exception"));
+ Assert.assertTrue(pr.stdout.length() == 0);
+ Assert.assertTrue(pr.stderr.length() == 0);
}
}
@@ -153,35 +155,49 @@ public class RemoteApplicationSettings {
}
}
- public static class Arbores extends NoOutputs {
+ public abstract static class NearlyNoOutputs extends StringBasedURL {
+
+ public NearlyNoOutputs(String r) {
+ super(r);
+ }
+
+ @Override
+ public void evaluate(ProcessResult pr) {
+ Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0);
+ Assert.assertTrue(stderrEmpty, clean(pr.stderr).length() == 0);
+
+ }
+ }
+
+ public static class Arbores extends NearlyNoOutputs {
public Arbores() {
super("http://www.arbores.ca/AnnuityCalc.jnlp");
}
}
- public static class PhetSims extends NoOutputs {
+ public static class PhetSims extends NearlyNoOutputs {
public PhetSims() {
super("http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp");
}
}
- public static class TopCoder extends NoOutputs {
+ public static class TopCoder extends NearlyNoOutputs {
public TopCoder() {
super("http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp");
}
}
- public static class SunSwingDemo extends NoOutputs {
+ public static class SunSwingDemo extends NearlyNoOutputs {
public SunSwingDemo() throws MalformedURLException {
super("http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.jnlp");
}
}
- public static class ArboresDeposit extends NoOutputs {
+ public static class ArboresDeposit extends NearlyNoOutputs {
public ArboresDeposit() throws MalformedURLException {
super("http://www.arbores.ca/Deposit.jnlp");
@@ -192,8 +208,8 @@ public class RemoteApplicationSettings {
@Override
public void evaluate(ProcessResult pr) {
- Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0);
- Assert.assertTrue(pr.stderr.length() == 0 || (pr.stderr.contains("Cannot read File Manager history data file,")
+ Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0);
+ Assert.assertTrue(clean(pr.stderr).length() == 0 || (clean(pr.stderr).contains("Cannot read File Manager history data file,")
&& pr.stderr.contains("FileMgr will be initialized with default options")));
}
@@ -203,7 +219,7 @@ public class RemoteApplicationSettings {
}
}
- public static class FuseSwing extends NoOutputs {
+ public static class FuseSwing extends NearlyNoOutputs {
public FuseSwing() {
super("http://www.progx.org/users/Gfx/apps/fuse-swing-demo.jnlp");
diff --git a/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java b/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java
index e0d9488..dc69a26 100644
--- a/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java
+++ b/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java
@@ -58,7 +58,6 @@ public class ReadPropertiesBySignedHackTest {
Assert.assertTrue("Stderr should contains "+s+" but did not",pr.stderr.contains(s));
String ss="ClassNotFoundException";
Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss));
- Assert.assertTrue("stdout lenght should be <2 but was "+pr.stdout.length(),pr.stdout.length()<2); // /home/user or /root or eanything else :(
Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
diff --git a/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java b/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java
index ee74183..9c1b6fa 100644
--- a/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java
+++ b/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java
@@ -58,7 +58,6 @@ public class ReadPropertiesSignedTest {
Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher));
String ss="ClassNotFoundException";
Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss));
- Assert.assertTrue("stdout lenght should be <2 but was "+pr.stdout.length(),pr.stdout.length()<2); // /home/user or /root or eanything else :(
Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
@@ -70,7 +69,6 @@ public class ReadPropertiesSignedTest {
Assert.assertFalse("Stderr should NOT match "+accessMatcher+" but did",pr.stderr.matches(accessMatcher));
String ss="ClassNotFoundException";
Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss));
- Assert.assertTrue("stdout lenght should be >= but was "+pr.stdout.length(),pr.stdout.length()>=4); // /home/user or /root or eanything else :(
Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
@@ -81,7 +79,6 @@ public class ReadPropertiesSignedTest {
Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher));
String ss="ClassNotFoundException";
Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss));
- Assert.assertFalse("stdout lenght should not be >2 but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
diff --git a/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java b/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
index a83cc08..c95b5ff 100644
--- a/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
+++ b/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
@@ -61,7 +61,6 @@ public class AddShutdownHookTest extends BrowserTest {
ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp");
Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr));
Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr));
- Assert.assertFalse("stdout length should be <=2, but was " + pr.stdout.length(), pr.stdout.length() > 2);
Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was", pr.wasTerminated);
Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr));
Assert.assertEquals((Integer) 0, pr.returnValue);
diff --git a/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java b/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java
index cb0f92e..37a99f8 100644
--- a/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java
+++ b/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java
@@ -54,7 +54,6 @@ public class AllStackTracesTest {
Assert.assertTrue("stderr should match `"+c+"`, but didn't ",pr.stderr.matches(c));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did ",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("AllStackTracesTest1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java b/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
index 2de9f5a..91babeb 100644
--- a/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
+++ b/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
@@ -52,7 +52,6 @@ public class CreateClassLoaderTest {
Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("CreateClassLoaderLunch1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java b/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
index a755944..f44b0b1 100644
--- a/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
+++ b/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
@@ -51,7 +51,6 @@ public class ReadEnvironmentTest {
Assert.assertTrue("stderr should match"+s+"but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("ReadEnvironmentLunch1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java b/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java
index 9244529..6398b80 100644
--- a/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java
+++ b/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java
@@ -52,7 +52,6 @@ public class ReadPropertiesTest {
Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("ReadPropertiesLunch1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
@@ -64,7 +63,6 @@ public class ReadPropertiesTest {
Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("ReadPropertiesLunch2 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer)0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java b/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java
index 71934e5..d9d952d 100644
--- a/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java
+++ b/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java
@@ -51,7 +51,6 @@ public class RedirectStreamsTest {
Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("RedirectStreams should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java b/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
index 6ea120c..518a24c 100644
--- a/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
+++ b/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
@@ -51,7 +51,6 @@ public class ReplaceSecurityManagerTest {
Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("ReplaceSecurityManagerLunch1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java b/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
index 0796db7..f2d2648 100644
--- a/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
+++ b/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
@@ -51,7 +51,6 @@ public class SetContextClassLoaderTest {
Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
String cc="ClassNotFoundException";
Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc));
- Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);
Assert.assertFalse("SetContextClassLoader1 should not be terminated, but was",pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
diff --git a/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java b/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java
index 16dffb4..e0131aa 100644
--- a/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java
+++ b/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java
@@ -49,7 +49,6 @@ public class SimpleTest2Test {
@Test
public void testSimpletest2lunchException() throws Exception {
ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest2.jnlp");
- Assert.assertTrue("stdout should be < 1 , but was "+pr.stdout.trim().length(),pr.stdout.trim().length() < 1);
String s="Correct exception";
Assert.assertTrue("stderr should contains "+s+" but didn't",pr.stderr.contains(s));
String ss="Exception";