diff options
author | Andrew Azores <[email protected]> | 2013-11-07 09:59:22 -0500 |
---|---|---|
committer | Andrew Azores <[email protected]> | 2013-11-07 09:59:22 -0500 |
commit | cc383fcf7288977d01608d9da4d9d84d167e1aad (patch) | |
tree | f5b899aa9cd705f7d1aba497874c8c787018903d /tests/reproducers/simple | |
parent | 8f59c1b0bf5fed4fce80ebcc0bc588e62dde706d (diff) |
Reproducer test cleanup to remove deprecation warnings and type checking warnings.
ServerAccess.ProcessResult removed and reference replaced with ProcessResult.
junit.framework.assert replaced in favour of org.junit.Assert.
Added parameterized typing to instantiation of several fields and local variables
where the declaration was already parameterized.
Diffstat (limited to 'tests/reproducers/simple')
24 files changed, 95 insertions, 87 deletions
diff --git a/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java b/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java index e9952ff..5888ed3 100644 --- a/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java +++ b/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java @@ -37,10 +37,10 @@ exception statement from your version. import java.util.Arrays; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; -import net.sourceforge.jnlp.ServerAccess.ProcessResult; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; public class AccessClassInPackageTest { @@ -72,12 +72,12 @@ public class AccessClassInPackageTest { }; private static final List<String> xta = Arrays.asList(new String[]{"-Xtrustall"}); - private void testShouldFail(ServerAccess.ProcessResult pr, String s) { + private void testShouldFail(ProcessResult pr, String s) { String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; Assert.assertTrue("stderr should match `" + c + "`, but didn't ", pr.stderr.matches(c)); } - private void testShouldNOTFail(ServerAccess.ProcessResult pr, String s) { + private void testShouldNOTFail(ProcessResult pr, String s) { String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; Assert.assertFalse("stderr should NOT match `" + c + "`, but did ", pr.stderr.matches(c)); } @@ -89,19 +89,19 @@ public class AccessClassInPackageTest { Assert.assertEquals((Integer) 0, pr.returnValue); } - private void testShouldPass(ServerAccess.ProcessResult pr, String s) { + private void testShouldPass(ProcessResult pr, String s) { String c = "Class was obtained: " + s; Assert.assertTrue("stdout should contains `" + c + "`, but didn't ", pr.stdout.contains(c)); } - private void testShouldNOTPass(ServerAccess.ProcessResult pr, String s) { + private void testShouldNOTPass(ProcessResult pr, String s) { String c = "Class was obtained: " + s; Assert.assertFalse("stdout should not contains `" + c + "`, but did ", pr.stdout.contains(c)); } @Test public void AccessClassInPackageJAVAXJNLP() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]); commonPitfall(pr); testShouldPass(pr, pass[0]); testShouldNOTFail(pr, badExceptions[0]); @@ -109,7 +109,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageSELF() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]); commonPitfall(pr); testShouldPass(pr, pass[1]); testShouldNOTFail(pr, badExceptions[1]); @@ -117,7 +117,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageNETSF() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]); commonPitfall(pr); testShouldFail(pr, badExceptions[2]); testShouldNOTPass(pr, pass[2]); @@ -125,7 +125,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageSUNSEC() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]); commonPitfall(pr); commonPitfall(pr); testShouldFail(pr, badExceptions[3]); @@ -135,7 +135,7 @@ public class AccessClassInPackageTest { //now signed vaiants @Test public void AccessClassInPackageSignedJAVAXJNLP() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]); + ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]); commonPitfall(pr); testShouldPass(pr, pass[0]); testShouldNOTFail(pr, badExceptions[0]); @@ -143,7 +143,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageSignedSELF() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]); + ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]); commonPitfall(pr); testShouldPass(pr, pass[1]); testShouldNOTFail(pr, badExceptions[1]); @@ -151,7 +151,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageSignedNETSF() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]); + ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]); commonPitfall(pr); testShouldPass(pr, pass[2]); testShouldNOTFail(pr, badExceptions[2]); @@ -159,7 +159,7 @@ public class AccessClassInPackageTest { @Test public void AccessClassInPackageSignedSUNSEC() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]); + ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]); commonPitfall(pr); testShouldPass(pr, pass[3]); testShouldNOTFail(pr, badExceptions[3]); diff --git a/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java b/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java index 0372f4c..cb0f92e 100644 --- a/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java +++ b/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java @@ -35,6 +35,7 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; @@ -48,7 +49,7 @@ public class AllStackTracesTest { @Test public void AllStackTracesTest1() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp"); String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getStackTrace" + ".*"; Assert.assertTrue("stderr should match `"+c+"`, but didn't ",pr.stderr.matches(c)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java b/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java index 11b0bb0..3f50f76 100644 --- a/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java +++ b/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java @@ -35,12 +35,13 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; public class AppletReadsInvalidJarTests extends BrowserTest{ @@ -52,7 +53,7 @@ public class AppletReadsInvalidJarTests extends BrowserTest{ /*This SHOULD NOT execute the applet!*/ @Test public void AppletJNLPTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp"); + ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp"); Assert.assertFalse("AppletReadsInvalidJar stdout should NOT contain '" + CORRECT_EXECUTION + "', but did (applet should not have ran!).", pr.stdout.contains(CORRECT_EXECUTION)); Assert.assertTrue("AppletReadsInvalidJar stderr should contain 'ZipException', but did not.", pr.stderr.contains(JNLP_EXPECTED_EXCEPTION)); @@ -62,7 +63,7 @@ public class AppletReadsInvalidJarTests extends BrowserTest{ @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletInFirefoxTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html"); + ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html"); Assert.assertTrue("AppletReadsInvalidJar stdout should contain '" + CORRECT_EXECUTION + "' but did not.", pr.stdout.contains(CORRECT_EXECUTION)); } diff --git a/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java index 8d67f0f..368e054 100644 --- a/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java @@ -35,13 +35,13 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ -import junit.framework.Assert; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; import org.junit.Test; public class AppletTagWithMissingCodeAttribute extends BrowserTest { diff --git a/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java index 75e19f4..e1a5f6b 100644 --- a/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java +++ b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java @@ -87,7 +87,7 @@ public class AppletTestTests extends BrowserTest { Assert.assertTrue(pr1.wasTerminated); //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); // just verify loging is recording browser - ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); + ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); Assert.assertTrue(pr.wasTerminated); } finally { diff --git a/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java b/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java index 46b7300..2de9f5a 100644 --- a/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java +++ b/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java @@ -35,9 +35,10 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; public class CreateClassLoaderTest { @@ -46,7 +47,7 @@ public class CreateClassLoaderTest { @Test public void CreateClassLoaderLunch1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "createClassLoader" + ".*"; Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java b/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java index 783a932..c615425 100644 --- a/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java +++ b/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java @@ -35,13 +35,13 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ -import junit.framework.Assert; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Assert; import org.junit.Test; public class EmbeddedJnlpInAppletTest extends BrowserTest { diff --git a/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java b/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java index 60bc169..13ea22e 100644 --- a/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java +++ b/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java @@ -39,9 +39,9 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import junit.framework.Assert; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; import org.junit.Test; public class GeneratedIdTest { diff --git a/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java b/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java index e82aca4..162c8ed 100644 --- a/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java +++ b/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java @@ -35,10 +35,10 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - import java.util.Arrays; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -49,7 +49,7 @@ public class InformationTitleVendorParserTest { public void runTest(String jnlpName, String exception) throws Exception { List<String> verbosed = Arrays.asList(new String[] { "-verbose" }); - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(verbosed, "/" + jnlpName + ".jnlp"); + ProcessResult pr=server.executeJavawsHeadless(verbosed, "/" + jnlpName + ".jnlp"); String s1 = "Good simple javaws exapmle"; Assert.assertFalse("test" + jnlpName + " stdout should not contain " + s1 + " but did.", pr.stdout.contains(s1)); Assert.assertTrue("testForTitle stderr should contain " + exception + " but did not.", pr.stderr.contains(exception)); diff --git a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java index a83e5bb..36c3d3f 100644 --- a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java +++ b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java @@ -83,7 +83,7 @@ public class LocalesTestTest { ServerAccess.logOutputReprint("Setting locales"); Map<String, String> p = System.getenv(); Set<Entry<String, String>> r = p.entrySet(); - List<Entry<String, String>> rr = new ArrayList(r); + List<Entry<String, String>> rr = new ArrayList<Entry<String, String>>(r); Collections.sort(rr, new Comparator<Entry<String, String>>() { @Override diff --git a/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java b/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java index 3a1b16c..e4ec1f4 100644 --- a/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java +++ b/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java @@ -62,7 +62,7 @@ public class LocalisedInformationElementTest { ServerAccess.logOutputReprint("Setting locales"); Map<String, String> p = System.getenv(); Set<Entry<String, String>> r = p.entrySet(); - List<Entry<String, String>> rr = new ArrayList(r); + List<Entry<String, String>> rr = new ArrayList<Entry<String, String>>(r); Collections.sort(rr, new Comparator<Entry<String, String>>() { @Override diff --git a/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java b/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java index 47baa6f..a2e0c0f 100644 --- a/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java +++ b/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java @@ -35,10 +35,11 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; @Bug(id="http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-February/017435.html") @@ -49,30 +50,30 @@ public class ManifestedJar1Test { //actually this on eis never printed as stderr will not recieve this message in headless mode :( private static final String twoMainException = "net.sourceforge.jnlp.ParseException: Invalid XML document syntax"; - private void assertManifestedJar1(String id, ServerAccess.ProcessResult q) { + private void assertManifestedJar1(String id, ProcessResult q) { String s = "Hello from ManifestedJar1"; Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); } - private void assertManifestedJar2(String id, ServerAccess.ProcessResult q) { + private void assertManifestedJar2(String id, ProcessResult q) { String s = "Hello from ManifestedJar2"; Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); } - private void assertNotManifestedJar1(String id, ServerAccess.ProcessResult q) { + private void assertNotManifestedJar1(String id, ProcessResult q) { String s = "Hello from ManifestedJar1"; Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); } - private void assertAppError(String id, ServerAccess.ProcessResult q) { + private void assertAppError(String id, ProcessResult q) { Assert.assertTrue(id + " stderr should contains `" + nonLunchableMessage + "`, but didnn't ", q.stderr.contains(nonLunchableMessage)); } - private void assertNotManifestedJar2(String id, ServerAccess.ProcessResult q) { + private void assertNotManifestedJar2(String id, ProcessResult q) { String s = "Hello from ManifestedJar2"; Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); } - private void assertNotDead(String id, ServerAccess.ProcessResult pr) { + private void assertNotDead(String id, ProcessResult pr) { String cc = "ClassNotFoundException"; Assert.assertFalse(id + " stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse(id + " should not be terminated, but was", pr.wasTerminated); @@ -85,7 +86,7 @@ public class ManifestedJar1Test { */ public void manifestedJar1nothing2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1nothing2nothingNoAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } @@ -97,7 +98,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1noAppDesc() throws Exception { String id = "ManifestedJar-1noAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } @@ -109,7 +110,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1mainNoAppDesc() throws Exception { String id = "ManifestedJar-1mainNoAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } @@ -121,7 +122,7 @@ public class ManifestedJar1Test { @Test public void ManifestedJar1mainHaveAppDesc() throws Exception { String id = "ManifestedJar-1mainHaveAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } @@ -133,7 +134,7 @@ public class ManifestedJar1Test { @Test public void ManifestedJar1main2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1main2nothingNoAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } @@ -145,7 +146,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1main2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1main2nothingNoAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } @@ -160,7 +161,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1main2mainNoAppDesc() throws Exception { String id = "ManifestedJar-1main2mainNoAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } @@ -174,7 +175,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1main2mainAppDesc() throws Exception { String id = "ManifestedJar-1main2mainAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertNotDead(id, pr); @@ -189,7 +190,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1noAppDescAtAll() throws Exception { String id = "ManifestedJar-1noAppDescAtAll"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertAppError(id, pr); @@ -208,7 +209,7 @@ public class ManifestedJar1Test { @Test public void manifestedJar1nothing2nothingAppDesc() throws Exception { String id = "ManifestedJar-1nothing2nothingAppDesc"; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertNotManifestedJar2(id, pr); assertNotManifestedJar1(id, pr); assertNotDead(id, pr); diff --git a/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java b/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java index 5d82da4..a755944 100644 --- a/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java +++ b/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java @@ -35,9 +35,9 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; - import org.junit.Test; public class ReadEnvironmentTest { @@ -46,7 +46,7 @@ public class ReadEnvironmentTest { @Test public void ReadEnvironmentLunch1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getenv.USER" + ".*"; Assert.assertTrue("stderr should match"+s+"but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java b/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java index dfe9590..9244529 100644 --- a/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java +++ b/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java @@ -35,7 +35,7 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -47,7 +47,7 @@ public class ReadPropertiesTest { @Test public void ReadPropertiesLunch1() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; @@ -59,7 +59,7 @@ public class ReadPropertiesTest { @Test public void ReadPropertiesLunch2() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.home.{0,5}read" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java b/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java index 1d745c7..71934e5 100644 --- a/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java +++ b/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java @@ -35,6 +35,7 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -45,7 +46,7 @@ public class RedirectStreamsTest { @Test public void RedirectStreamsTest1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setIO" + ".*"; Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java b/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java index 73bbd9d..6ea120c 100644 --- a/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java +++ b/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java @@ -35,6 +35,7 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -45,7 +46,7 @@ public class ReplaceSecurityManagerTest { @Test public void ReplaceSecurityManagerLunch1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setSecurityManager" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; diff --git a/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java b/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java index f45aedb..0796db7 100644 --- a/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java +++ b/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java @@ -35,6 +35,7 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -45,7 +46,7 @@ public class SetContextClassLoaderTest { @Test public void SetContextClassLoader1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setContextClassLoader" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; 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 cb2a98f..a3a2b92 100644 --- a/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java +++ b/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java @@ -37,6 +37,7 @@ exception statement from your version. import java.util.ArrayList; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; @@ -81,7 +82,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { * it is in headless mode. This can be considered as bug, but because it is * only on ocal files, and probably only from test run - it can be ignored */ - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); + 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"; @@ -94,7 +95,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Test @NeedsDisplay public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too.jnlp"); + 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"; @@ -107,7 +108,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @NeedsDisplay @TestInBrowsers(testIn = {Browsers.all}) public void SpacesCanBeEverywhereRemoteAppletTestsHtml2() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html"); + ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html"); 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"; @@ -119,7 +120,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Bug(id={"PR811","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016144.html"}) @Test public void SpacesCanBeEverywhereRemoteTests1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -131,7 +132,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp"); + 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"; @@ -143,7 +144,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2_withQuery1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test=10"); + 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"; @@ -156,7 +157,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2_withQuery2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test%3D10"); + 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"; @@ -168,7 +169,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests3() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1.jnlp"); + 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"; @@ -185,7 +186,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere1.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -201,7 +202,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere2.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); + 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"; @@ -217,7 +218,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(server.getDir()+"/Spaces can be everywhere2.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); + 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"; @@ -233,7 +234,7 @@ public class SpacesCanBeEverywhereTests extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("SpacesCanBeEverywhere1.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); + 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"; diff --git a/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java b/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java index e48509d..928cc5b 100644 --- a/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java +++ b/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java @@ -38,6 +38,7 @@ exception statement from your version. import java.util.Arrays; import java.util.Collections; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -50,19 +51,19 @@ public class UnsignedJnlpApplicationTest { @Test public void jnlpFileIsUnchecked1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpFileIsUnchecked2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpFileIsUnchecked3() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } } diff --git a/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java b/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java index b2aec62..e2e9bbe 100644 --- a/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java +++ b/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java @@ -38,6 +38,7 @@ exception statement from your version. import java.util.Arrays; import java.util.Collections; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; @@ -50,19 +51,19 @@ public class UnsignedJnlpTemplateTest { @Test public void jnlpTemplateIsUnchecked1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpTemplateIsUnchecked2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpTemplateIsUnchecked3() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } -}
\ No newline at end of file +} diff --git a/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java b/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java index e035c97..27b809e 100644 --- a/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java +++ b/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java @@ -34,12 +34,10 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - -import junit.framework.Assert; - import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; +import org.junit.Assert; import org.junit.Test; public class VersionedJarTest { @@ -61,4 +59,4 @@ public class VersionedJarTest { Assert.assertTrue("Stdout should contain '" + VERSIONED + "', but did not.", pr.stdout.contains(VERSIONED)); Assert.assertFalse("Stderr should NOT contain '" +FAILURE + "', but did.", pr.stderr.contains(FAILURE)); } -}
\ No newline at end of file +} diff --git a/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java b/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java index e753819..b3445d6 100644 --- a/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java +++ b/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java @@ -36,8 +36,8 @@ exception statement from your version. */ import java.util.ArrayList; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; -import net.sourceforge.jnlp.ServerAccess.ProcessResult; import org.junit.Assert; import java.util.Arrays; import java.util.List; @@ -80,7 +80,7 @@ public class DeadLockTestTest { public void testDeadLockTestTerminatedBody(String jnlp) throws Exception { List<String> before = countJavaInstances(); ServerAccess.logOutputReprint("java1 " + jnlp + " : " + before.size()); - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, jnlp); + ProcessResult pr = server.executeJavawsHeadless(null, jnlp); assertDeadlockTestLaunched(pr); List<String> after = countJavaInstances(); ServerAccess.logOutputReprint("java2 " + jnlp + " : " + after.size()); @@ -167,7 +167,7 @@ public class DeadLockTestTest { ServerAccess.logOutputReprint("Killing " + string); ServerAccess.PROCESS_LOG = false; try { - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"kill", "-9", string})); + ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"kill", "-9", string})); } finally { ServerAccess.PROCESS_LOG = true; } @@ -182,7 +182,7 @@ public class DeadLockTestTest { List<String> result = new ArrayList<String>(); ServerAccess.PROCESS_LOG = false; try { - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"ps", "-eo", "pid,ppid,stat,fname"})); + ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"ps", "-eo", "pid,ppid,stat,fname"})); Matcher m = Pattern.compile("\\s*\\d+\\s+\\d+ .+ java\\s*").matcher(pr.stdout); int i = 0; while (m.find()) { diff --git a/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java b/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java index 176d417..0904404 100644 --- a/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java +++ b/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java @@ -46,7 +46,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import junit.framework.Assert; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; @@ -57,6 +56,7 @@ import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; +import org.junit.Assert; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -190,7 +190,7 @@ public class XDGspecificationTests extends BrowserTest { private String[] removeXdgVAlues() { Map<String, String> p = System.getenv(); Set<Entry<String, String>> r = p.entrySet(); - List<Entry<String, String>> rr = new ArrayList(r); + List<Entry<String, String>> rr = new ArrayList<Entry<String, String>>(r); Collections.sort(rr, new Comparator<Entry<String, String>>() { @Override @@ -228,7 +228,7 @@ public class XDGspecificationTests extends BrowserTest { boolean config = false; Map<String, String> p = System.getenv(); Set<Entry<String, String>> r = p.entrySet(); - List<Entry<String, String>> rr = new ArrayList(r); + List<Entry<String, String>> rr = new ArrayList<Entry<String, String>>(r); Collections.sort(rr, new Comparator<Entry<String, String>>() { @Override @@ -351,7 +351,7 @@ public class XDGspecificationTests extends BrowserTest { } private static List<File> getContentOfDirectory(File f) { - List<File> result = new ArrayList(); + List<File> result = new ArrayList<File>(); if (f == null || !f.exists() || !f.isDirectory()) { return result; } diff --git a/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java b/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java index 9a77da4..16dffb4 100644 --- a/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java +++ b/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java @@ -35,9 +35,10 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; public class SimpleTest2Test { @@ -47,14 +48,13 @@ public class SimpleTest2Test { @Test public void testSimpletest2lunchException() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest2.jnlp"); + 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"; Assert.assertTrue("stderr should contains "+ss+" but did not",pr.stderr.contains(ss)); Assert.assertFalse("testSimpletest2lunchException should not be terminated, but was",pr.wasTerminated); - //Assert.assertFalse(0==pr.returnValue);exception and still returned 0? } |