aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java')
-rw-r--r--tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java b/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java
index 732eb9d..4adcea3 100644
--- a/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java
@@ -36,8 +36,8 @@ exception statement from your version.
*/
import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess.AutoClose;
import net.sourceforge.jnlp.annotations.Bug;
-import net.sourceforge.jnlp.annotations.KnownToFail;
import net.sourceforge.jnlp.annotations.NeedsDisplay;
import net.sourceforge.jnlp.annotations.TestInBrowsers;
import net.sourceforge.jnlp.browsertesting.BrowserTest;
@@ -50,6 +50,8 @@ import org.junit.Test;
public class MultipleSignaturesTestTests extends BrowserTest{
public static final String GSJE = "Good simple javaws exapmle";
+ public static final String launchExcDiffCerts = "Fatal: Application Error: The JNLP application is not fully signed by a single cert.";
+ public static final String accExcString = "java.security.AccessControlException: access denied";
@Test
@NeedsDisplay
@@ -65,16 +67,28 @@ public class MultipleSignaturesTestTests extends BrowserTest{
@NeedsDisplay
@TestInBrowsers(testIn=Browsers.one)
public void multipleSignaturesTestHtmlApplet() throws Exception {
- ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest.html");
+ ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest.html", AutoClose.CLOSE_ON_CORRECT_END);
String s = GSJE;
Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
- String cc = "xception";
- Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+ Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString));
}
@Test
+ @NeedsDisplay
+ @TestInBrowsers(testIn=Browsers.one)
+ @Bug(id={"PR822"})
+ public void multipleSignaturesTestHtmlAppletUsesPermissions() throws Exception {
+ ProcessResult pr = server.executeBrowser("/MultipleSignaturesTestUsesPermissions.html", AutoClose.CLOSE_ON_CORRECT_END);
+ // This calls ReadPropertiesSigned with user.home, it is not easy to think of a pattern to match this
+ // Instead we make sure _something_ was printed
+ Assert.assertFalse("stdout should NOT be empty, but was", pr.stdout.isEmpty());
+ Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString));
+ }
+
+
+ @Test
public void multipleSignaturesTestJnlpApplication() throws Exception {
- ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1.jnlp");
+ ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1.jnlp");
//well this is questionable - application is signed but is not requesting
// permissions, but still usage of foreign code is allowed.
String s = GSJE;
@@ -85,14 +99,11 @@ public class MultipleSignaturesTestTests extends BrowserTest{
}
@Test
- @Bug(id={"PR822"})
- @KnownToFail
public void multipleSignaturesTestJnlpApplicationRequesting() throws Exception {
- ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_requesting.jnlp");
- //This is buggy - application is signed, but requesting for permissions fails
+ // This jar is fully signed - however a JNLP application requires that one of the signers signs everything
+ ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1_requesting.jnlp");
String s = GSJE;
- Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
- String cc = "xception";
- Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+ Assert.assertFalse("stdout should NOT contain `" + s + "`, but did", pr.stdout.contains(s));
+ Assert.assertTrue("stderr should contain `" + launchExcDiffCerts + "`, but did not", pr.stderr.contains(launchExcDiffCerts));
}
}