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 | |
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')
42 files changed, 190 insertions, 182 deletions
diff --git a/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java b/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java index 63e8d7c..0b8daff 100644 --- a/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java +++ b/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.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.ServerAccess.ProcessResult; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -58,4 +58,4 @@ public class AppletFolderInArchiveTagTests extends BrowserTest{ String s0 = "This was ran from a folder specified in the archive tag."; Assert.assertTrue("Expected '"+s0+"', stdout was: " + pr.stdout, pr.stdout.contains(s0)); } -}
\ No newline at end of file +} diff --git a/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java b/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java index 47a182b..e14c174 100644 --- a/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java +++ b/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java @@ -38,8 +38,8 @@ 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.ServerAccess.ProcessResult; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -76,14 +76,14 @@ public class ClasspathManifestTest extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("ClasspathManifestApplicationTest.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "ApplicationJNLPLocalTest"); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp"); checkAppFails(pr, "AppletJNLPRemoteTest"); } @@ -95,7 +95,7 @@ public class ClasspathManifestTest extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("ClasspathManifestAppletTest.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "AppletJNLPRLocalTest"); } @@ -103,7 +103,7 @@ public class ClasspathManifestTest extends BrowserTest { @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html"); + ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html"); checkAppFails(pr, "BrowserJNLPHrefRemoteTest"); } @@ -115,7 +115,7 @@ public class ClasspathManifestTest extends BrowserTest { List<String> commands=new ArrayList<String>(2); commands.add(server.getBrowserLocation()); commands.add("ClasspathManifestJNLPHrefTest.html"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "BrowserJNLPHrefLocalTest"); } @@ -123,7 +123,7 @@ public class ClasspathManifestTest extends BrowserTest { @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html"); + ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html"); Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); // Should be the only one to search manifest for classpath. Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); diff --git a/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java b/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java index 69c5736..de92292 100644 --- a/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java +++ b/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java @@ -40,10 +40,10 @@ import java.net.MalformedURLException; 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.BeforeClass; import org.junit.Test; diff --git a/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java b/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java index c2fda0a..6cfa884 100644 --- a/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java +++ b/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java @@ -1,4 +1,4 @@ -/* EmptySignedJar.java +/* EmptySignedJarTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. @@ -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 net.sourceforge.jnlp.annotations.Bug; @@ -53,21 +54,21 @@ public class EmptySignedJarTest { @Test public void checkingForRequiredResources() throws Exception { String s = "Running SignedJarResource.."; - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJarResource.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJarResource.jnlp"); Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(s)); } @Bug(id = "PR1049") @Test public void usingExtensionWithEmptyJar() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInExtensionJnlp.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInExtensionJnlp.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1049") @Test public void usingLauncherWithEmptyJar() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInLaunchingJnlp.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInLaunchingJnlp.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } } diff --git a/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java b/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java index 385e937..749e844 100644 --- a/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java +++ b/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.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 net.sourceforge.jnlp.annotations.Bug; @@ -55,7 +56,7 @@ public class ExtensionJnlpTest { @Test public void checkingForRequiredResources() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp"); Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(jarOutput)); String s = "Running SignedJnlpResource.."; @@ -66,21 +67,21 @@ public class ExtensionJnlpTest { @Bug(id = "PR1040") @Test public void usingSignedExtension() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1041") @Test public void mainJarInExtension() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1042") @Test public void checkingSignedJnlpInExtension() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp"); Assert.assertTrue("Stdout should contain " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); } } diff --git a/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java b/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java index 54cb203..02ffd7b 100644 --- a/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java +++ b/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java @@ -39,8 +39,8 @@ import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; -import net.sourceforge.jnlp.ServerAccess.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -78,7 +78,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @Test @Bug(id = {"RH816592","PR858"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplication() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); @@ -94,7 +94,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @Test @Bug(id = {"RH816592","PR858"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplet() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-new.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-new.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); @@ -105,7 +105,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @NeedsDisplay @TestInBrowsers(testIn={Browsers.all}) public void launchInternalClassloaderWithDownloadedResourceAsHtmlApplet() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html"); + ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html"); evaluate(pr); Assert.assertTrue("should be terminated but was not", pr.wasTerminated); } @@ -113,7 +113,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @Test @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplicationHack() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); @@ -122,7 +122,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @Test @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpAppletHack() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-hack.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-hack.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); @@ -133,7 +133,7 @@ public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) @TestInBrowsers(testIn={Browsers.all}) public void launchInternalClassloaderWithDownloadedResourceAsHtmlAppletHack() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html"); + ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html"); evaluate(pr); Assert.assertTrue("should be terminated but was not", pr.wasTerminated); } diff --git a/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java b/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java index dc8bb77..a0233eb 100644 --- a/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java +++ b/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java @@ -1,4 +1,4 @@ -/* MissingJar.java +/* MissingJarTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. @@ -38,10 +38,10 @@ 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 net.sourceforge.jnlp.ServerAccess.ProcessResult; -import org.junit.Assert; +import org.junit.Assert; import org.junit.Test; public class MissingJarTest { @@ -60,25 +60,25 @@ public class MissingJarTest { @Test public void MissingJarTest1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest3() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest4() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp"); evaluateResult(pr); } } diff --git a/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java b/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java index 8f9455d..e0d9488 100644 --- a/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java +++ b/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java @@ -1,4 +1,4 @@ -/* ReadPropertiesSignedTest.java +/* ReadPropertiesBySignedHackTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. @@ -35,11 +35,12 @@ 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.Collections; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; + import org.junit.Assert; import org.junit.Test; @@ -52,7 +53,7 @@ public class ReadPropertiesBySignedHackTest { @Test public void ReadPropertiesBySignedHackWithjoutXtrustAll() throws Exception { //no request for permissions - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp"); String s="java.lang.SecurityException: class \"ReadProperties\"'s signer information does not match signer information of other classes in the same package"; Assert.assertTrue("Stderr should contains "+s+" but did not",pr.stderr.contains(s)); String ss="ClassNotFoundException"; diff --git a/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java b/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java index 6b389e3..ee74183 100644 --- a/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java +++ b/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java @@ -35,11 +35,12 @@ 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.Collections; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; + import org.junit.Assert; import org.junit.Test; @@ -53,7 +54,7 @@ public class ReadPropertiesSignedTest { @Test public void ReadSignedPropertiesWithoutPermissionsWithXtrustAll() throws Exception { //no request for permissions - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp"); 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)); @@ -65,7 +66,7 @@ public class ReadPropertiesSignedTest { @Test public void ReadSignedPropertiesWithPermissionsWithXtrustAll() throws Exception { //request for allpermissions - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp"); 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)); @@ -76,16 +77,15 @@ public class ReadPropertiesSignedTest { @Test public void EnsureXtrustallNotAffectingUnsignedBehaviour() throws Exception { - ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp"); + ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp"); 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); - ServerAccess.ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); + ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); Assert.assertEquals(pr.stderr, pr2.stderr); Assert.assertEquals(pr.stdout, pr2.stdout); - } } diff --git a/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java b/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java index fb4e9ff..78e5590 100644 --- a/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java +++ b/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java @@ -38,7 +38,9 @@ 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; @@ -52,7 +54,7 @@ public class SignedJnlpApplicationTest { @Test public void launchingFileMatchesSignedApplication1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @@ -62,7 +64,7 @@ public class SignedJnlpApplicationTest { */ @Test public void launchingFileDoesNotMatchSignedApplication1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } @@ -71,7 +73,7 @@ public class SignedJnlpApplicationTest { */ @Test public void launchingFileDoesNotMatchSignedApplication2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } -}
\ No newline at end of file +} diff --git a/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java b/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java index d410790..d8bd03b 100644 --- a/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java +++ b/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java @@ -38,7 +38,9 @@ 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; @@ -49,14 +51,14 @@ public class SignedJnlpCaseOneTest { @Test public void launchingFileMatchesSigned() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @Test public void launchingFileDoesNotMatchSigned() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp"); String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; diff --git a/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java b/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java index 2869552..3fd066c 100644 --- a/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java +++ b/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.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; @@ -49,14 +50,14 @@ public class SignedJnlpCaseTwoTest { @Test public void launchingFileMatchesSigned() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @Test public void launchingFileDoesNotMatchSigned() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp"); String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; diff --git a/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java b/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java index 5f2dd78..46a218e 100644 --- a/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java +++ b/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java @@ -38,7 +38,9 @@ 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; @@ -52,7 +54,7 @@ public class SignedJnlpTemplateTest { @Test public void launchingFileMatchesSignedTemplate1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @@ -62,7 +64,7 @@ public class SignedJnlpTemplateTest { */ @Test public void launchingFileDoesNotMatchSignedTemplate2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } @@ -71,7 +73,7 @@ public class SignedJnlpTemplateTest { */ @Test public void launchingFileDoesNotMatchSignedTemplate3() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } -}
\ No newline at end of file +} diff --git a/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java b/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java index f33b203..605646e 100644 --- a/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java +++ b/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java @@ -37,20 +37,20 @@ 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; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; -import org.junit.Assert; +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 SpacesCanBeEverywhereTestsSigned extends BrowserTest { - @Bug(id="PR811") @Test @NeedsDisplay @@ -82,7 +82,7 @@ public class SpacesCanBeEverywhereTestsSigned 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="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "xception"; @@ -95,7 +95,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Test @NeedsDisplay public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2Signed() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too%20signed.jnlp"); + ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too%20signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "xception"; @@ -108,7 +108,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void SpacesCanBeEverywhereRemoteAppletTestsHtml2Signed() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("/spaces+applet+Tests+signed.html"); + ProcessResult pr = server.executeBrowser("/spaces+applet+Tests+signed.html"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "xception"; @@ -120,7 +120,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id={"PR811","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016144.html"}) @Test public void SpacesCanBeEverywhereRemoteTests1Signed() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1%20signed.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1%20signed.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -132,7 +132,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -144,7 +144,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery1() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test=20"); + ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test=20"); String s="Signed 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 +156,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery2() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test%3D20"); + ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test%3D20"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); @@ -169,7 +169,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests3Signed() throws Exception { - ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp"); + ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -186,7 +186,7 @@ public class SpacesCanBeEverywhereTestsSigned 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"; @@ -202,7 +202,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere2 signed.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -218,7 +218,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(server.getDir()+"/Spaces can be everywhere2 signed.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); + ProcessResult pr = ServerAccess.executeProcess(commands); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; @@ -234,7 +234,7 @@ public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("SpacesCanBeEverywhere1signed.jnlp"); - ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); + ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s="Signed 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/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? } diff --git a/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java b/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java index 8d4e8d6..9039ed7 100644 --- a/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java +++ b/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java @@ -64,26 +64,26 @@ public class ResourcesTest extends BrowserTest{ @NeedsDisplay public void testNonExisitngBrowserWillNotDeadlock() throws Exception { server.setCurrentBrowser(Browsers.none); - ServerAccess.ProcessResult pr = server.executeBrowser("not_existing_url.html"); + ProcessResult pr = server.executeBrowser("not_existing_url.html"); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); - junit.framework.Assert.assertNotNull(pr.deadlyException); + Assert.assertNotNull(pr.deadlyException); } @Test public void testUnexistingProcessWillFailRecognizedly() throws Exception { server.setCurrentBrowser(Browsers.none); List<String> al=Arrays.asList(new String[] {"definietly_not_Existing_process"}); - ServerAccess.ProcessResult pr = server.executeProcess(al); + ProcessResult pr = server.executeProcess(al); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); - junit.framework.Assert.assertNotNull(pr.deadlyException); + Assert.assertNotNull(pr.deadlyException); } @Test @@ -96,13 +96,13 @@ public class ResourcesTest extends BrowserTest{ @Test @TestInBrowsers(testIn=Browsers.none) public void testNonExisitngBrowserWillNotCauseMess() throws Exception { - ServerAccess.ProcessResult pr = server.executeBrowser("not_existing_url.html"); + ProcessResult pr = server.executeBrowser("not_existing_url.html"); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); - junit.framework.Assert.assertNotNull(pr.deadlyException); + Assert.assertNotNull(pr.deadlyException); } @Test @@ -288,7 +288,7 @@ public class ResourcesTest extends BrowserTest{ e2.append(s).append("\n"); } }; - ServerAccess.ProcessResult pr = server.executeBrowser("not_existing_url.html",lo,le); + ProcessResult pr = server.executeBrowser("not_existing_url.html",lo,le); server.setCurrentBrowser(BrowserFactory.getFactory().getFirst().getID()); Assert.assertNotNull(server.getCurrentBrowsers()); Assert.assertNotNull(server.getCurrentBrowser()); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java b/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java index dd7ab89..da47f6e 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java @@ -52,7 +52,7 @@ class ContentReader implements Runnable { StringBuilder sb = new StringBuilder(); private final InputStream is; private boolean done; - final List<ContentReaderListener> listeners = new ArrayList(1); + final List<ContentReaderListener> listeners = new ArrayList<ContentReaderListener>(1); public String getContent() { return sb.toString(); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java index 9b2dbbb..6c9cdd4 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java @@ -56,8 +56,8 @@ public class ProcessWrapper { private List<String> args; private File dir; - private final List<ContentReaderListener> stdoutl = new ArrayList(1); - private final List<ContentReaderListener> stderrl = new ArrayList(1); + private final List<ContentReaderListener> stdoutl = new ArrayList<ContentReaderListener>(1); + private final List<ContentReaderListener> stderrl = new ArrayList<ContentReaderListener>(1); private String[] vars; private ReactingProcess reactingProcess; @@ -73,9 +73,9 @@ public class ProcessWrapper { Assert.assertNotNull(toBeExecuted); Assert.assertTrue(toBeExecuted.trim().length() > 1); if (otherargs == null) { - otherargs = new ArrayList(1); + otherargs = new ArrayList<String>(1); } - List<String> urledArgs = new ArrayList(otherargs); + List<String> urledArgs = new ArrayList<String>(otherargs); urledArgs.add(0, toBeExecuted); urledArgs.add(s); this.args = urledArgs; @@ -201,7 +201,7 @@ public class ProcessWrapper { this.vars = vars; } - public ServerAccess.ProcessResult execute() throws Exception { + public ProcessResult execute() throws Exception { if (reactingProcess !=null ){ reactingProcess.beforeProcess(""); }; @@ -222,7 +222,7 @@ public class ProcessWrapper { } if (t.deadlyException != null) { pa.setCanRun(false); - return new ServerAccess.ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); + return new ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); } ContentReader crs = new ContentReader(t.getP().getInputStream(), stdoutl); ContentReader cre = new ContentReader(t.getP().getErrorStream(), stderrl); @@ -244,7 +244,7 @@ public class ProcessWrapper { pa.setCanRun(false); // ServerAccess.logOutputReprint(t.getP().exitValue()); when process is killed, this throws exception - ServerAccess.ProcessResult pr = new ServerAccess.ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); + ProcessResult pr = new ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); if (ServerAccess.PROCESS_LOG) { ServerAccess.log(pr.stdout, true, false); ServerAccess.log(pr.stderr, false, true); diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java index 31e81ad..6f45a23 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java @@ -55,6 +55,7 @@ import java.net.ServerSocket; import java.net.URL; import java.util.ArrayList; import java.util.List; +import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.Browsers; @@ -270,7 +271,7 @@ public class ServerAccess { if (this.currentBrowser==null) return null; List<String> l1=this.currentBrowser.getComaptibilitySwitches(); List<String> l2=this.currentBrowser.getDefaultSwitches(); - List<String> l= new ArrayList(); + List<String> l= new ArrayList<String>(); if (l1!=null)l.addAll(l1); if (l2!=null)l.addAll(l2); return l; @@ -832,15 +833,4 @@ public class ServerAccess { return new ProcessWrapper(args, dir, stdoutl, stderrl, vars).execute(); } - /** - * this is temprary solution until refactoring is fully done - * Use net.sourceforge.jnlp.ProcessResult instead - */ - @Deprecated - public static class ProcessResult extends net.sourceforge.jnlp.ProcessResult { - - public ProcessResult(String stdout, String stderr, Process process, boolean wasTerminated, Integer r, Throwable deadlyException) { - super(stdout, stderr, process, wasTerminated, r, deadlyException); - } - } - } +} |