Mercurial > hg > release > icedtea-web-1.8
changeset 1270:fff25f4c1ff6
Added tests for html switch for Sandbox attribute
* tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java
* tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java
* tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java
* tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java
* tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java
* tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java
* tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java
* tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java
* tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java
* tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java
line wrap: on
line diff
--- a/ChangeLog Wed Jul 22 13:16:26 2015 +0200 +++ b/ChangeLog Wed Jul 22 14:39:17 2015 +0200 @@ -1,3 +1,17 @@ +2015-07-22 Jiri Vanek <jvanek@redhat.com> + + Added tests for html switch for Sandbox attribute + * tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java + * tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java + * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java + * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java + * tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java + * tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java + * tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java + * tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java + * tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java + * tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java + 2015-07-22 Fridrich Strba <fridrich.strba@suse.com> * Makefile.am: (generate-docs.stamp) added '-' to tail of tail command as
--- a/tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -78,6 +79,15 @@ Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtml() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[] {OptionsDefinitions.OPTIONS.HTML.option}), "SandboxSignedAllPerm.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + @Test //no security dialog //pass
--- a/tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,5 +1,7 @@ import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -120,6 +122,14 @@ Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtml() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[] {OptionsDefinitions.OPTIONS.HTML.option}), "SandboxSignedInvalid.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -125,6 +126,14 @@ Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtml() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[] {OptionsDefinitions.OPTIONS.HTML.option}), "SandboxSignedMissing.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; @@ -190,6 +191,29 @@ Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtmlYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-html"), server.getUrl("SandboxSignedMissing.html")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("YES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertTrue(p.stdout.contains(aok.getCondition())); + Assert.assertFalse(p.stderr.contains(aer.getCondition())); + } + + @Test + public void javawsHtmlNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-html"), server.getUrl("SandboxSignedMissing.html")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + }
--- a/tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -123,4 +124,11 @@ } + @Test + public void javawsHtml() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[] {OptionsDefinitions.OPTIONS.HTML.option}), "SandboxSignedSandbox.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,10 +1,12 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; +import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; @@ -104,7 +106,6 @@ @Test @TestInBrowsers(testIn = Browsers.one) - //or this one should fail public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedAllPerm.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); @@ -113,4 +114,11 @@ Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + @Test + public void javawsHtml() throws Exception { + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "SandboxUnsignedAllPerm.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,5 +1,7 @@ import java.io.IOException; +import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -111,5 +113,12 @@ Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + @Test + public void javawsHtml() throws Exception { + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "SandboxUnsignedInvalid.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -115,6 +116,14 @@ Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtml() throws Exception{ + ProcessResult p = server.executeJavaws(Arrays.asList(new String[] {OptionsDefinitions.OPTIONS.HTML.option}), "SandboxUnsignedMissing.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java Wed Jul 22 14:39:17 2015 +0200 @@ -172,6 +172,38 @@ Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } + + @Test + public void javawsHtmlYesYes() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-html"), server.getUrl("SandboxUnsignedMissing.html")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("YES\nYES\n"); + ProcessResult p = pw.execute(); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + @Test + public void javawsHtmlYesNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-html"), server.getUrl("SandboxUnsignedMissing.html")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("YES\nNO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } + + @Test + public void javawsHtmlNo() throws Exception{ + ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-html"), server.getUrl("SandboxUnsignedMissing.html")); + pw.addStdOutListener(new AutoOkClosingListener()); + pw.setWriter("NO\n"); + ProcessResult p = pw.execute(); + Assert.assertFalse(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }
--- a/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java Wed Jul 22 13:16:26 2015 +0200 +++ b/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java Wed Jul 22 14:39:17 2015 +0200 @@ -1,6 +1,7 @@ import java.io.IOException; import java.util.Arrays; +import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; @@ -112,5 +113,12 @@ Assert.assertTrue(p.stderr.contains(aer.getCondition())); } + @Test + public void javawsHtml() throws Exception { + ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "SandboxUnsignedSandbox.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); + Assert.assertTrue(p.stdout.contains(confirmation)); + Assert.assertFalse(p.stdout.contains(aok.getCondition())); + Assert.assertTrue(p.stderr.contains(aer.getCondition())); + } }