diff options
Diffstat (limited to 'tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java')
-rw-r--r-- | tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java b/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java index bbd8faa..0e9e402 100644 --- a/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java +++ b/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java @@ -45,14 +45,17 @@ public class ReplaceSecurityManagerTest { @Test public void ReplaceSecurityManagerLunch1() throws Exception { - System.out.println("connecting RedirectStreams request"); + System.out.println("connecting ReplaceSecurityManager request"); + System.err.println("connecting ReplaceSecurityManager request"); ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp"); System.out.println(pr.stdout); System.err.println(pr.stderr); - Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission setSecurityManager)")); - Assert.assertFalse(pr.stderr.contains("ClassNotFoundException")); - Assert.assertFalse(pr.stdout.length() > 2); - Assert.assertFalse(pr.wasTerminated); + String s="java.security.AccessControlException: access denied (java.lang.RuntimePermission setSecurityManager)"; + Assert.assertTrue("stderr should contains "+s+" but didn't",pr.stderr.contains(s)); + String cc="ClassNotFoundException"; + Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); + Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2); + Assert.assertFalse("ReplaceSecurityManagerLunch1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } |