Changeset 429 for trunk/icedtea-web/tests/reproducers
- Timestamp:
- Sep 24, 2014, 9:34:21 PM (11 years ago)
- Location:
- trunk/icedtea-web/tests/reproducers
- Files:
-
- 2 deleted
- 52 edited
- 78 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/icedtea-web/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile
r418 r429 1 1 TESTNAME=AppletFolderInArchiveTag 2 2 ARCHIVE_TEST_FOLDER=archive_tag_folder_test 3 JAVAC_CLASSPATH=$( JNLP_TESTS_ENGINE_DIR):$(NETX_DIR)/lib/classes.jar4 DEPLOY_SUBDIR=$( JNLP_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER)3 JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar 4 DEPLOY_SUBDIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER) 5 5 INDEX_HTML_BODY="<html><body><h1>Required to recognize folder structure</h1></body></html>" 6 6 -
trunk/icedtea-web/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp. ServerAccess.ProcessResult;38 import net.sourceforge.jnlp.ProcessResult; 39 39 import net.sourceforge.jnlp.annotations.Bug; 40 40 import net.sourceforge.jnlp.annotations.NeedsDisplay; -
trunk/icedtea-web/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile
r418 r429 1 1 TESTNAME=UnsignedContentInMETAINF 2 JAVAC_CLASSPATH=$( JNLP_TESTS_ENGINE_DIR):$(NETX_DIR)/lib/classes.jar3 DEPLOY_DIR=$( JNLP_TESTS_SERVER_DEPLOYDIR)2 JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar 3 DEPLOY_DIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) 4 4 JAVAC=$(BOOT_DIR)/bin/javac 5 5 JAR=$(BOOT_DIR)/bin/jar 6 ABS_SRC_PATH=$( JNLP_TESTS_SRCDIR)/custom/$(TESTNAME)/srcs6 ABS_SRC_PATH=$(REPRODUCERS_TESTS_SRCDIR)/custom/$(TESTNAME)/srcs 7 7 8 8 prepare-reproducer: -
trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html
r418 r429 38 38 <html><head></head><body bgcolor="red"> 39 39 <p> 40 <applet code="AppletTestSigned.class" archive=" XslowXAppletTestSigned.jar" codebase="." width="100" height="100">40 <applet code="AppletTestSigned.class" archive="AppletTestSigned.jar" codebase="." width="100" height="100"> 41 41 <param name="key1" value="value1"> 42 42 <param name="key2" value="#value2"> -
trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java
r418 r429 49 49 Thread.sleep(n); 50 50 System.out.println("AppletTestSigned killing himself after " + n + " ms of life"); 51 System.out.println("*** APPLET FINISHED ***"); 51 52 System.exit(0); 52 53 } catch (Exception ex) { -
trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java
r418 r429 44 44 import net.sourceforge.jnlp.browsertesting.Browsers; 45 45 import net.sourceforge.jnlp.annotations.TestInBrowsers; 46 import net.sourceforge.jnlp.closinglisteners.Rule; 47 import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; 48 import static net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener.*; 46 49 import org.junit.Assert; 47 50 … … 51 54 52 55 private final List<String> l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); 56 private static final String s0 = "AppletTestSigned was started"; 57 private static final String s1 = "value1"; 58 private static final String s2 = "value2"; 59 private static final String s3 = "AppletTestSigned was initialised"; 60 private static final String s7 = "AppletTestSigned killing himself after 2000 ms of life"; 61 private static final ContainsRule startedRule = new ContainsRule(s0); 62 private static final ContainsRule variable1Rule = new ContainsRule(s1); 63 private static final ContainsRule variable2Rule = new ContainsRule(s2); 64 private static final ContainsRule initialisedRule = new ContainsRule(s3); 65 private static final ContainsRule killedRule = new ContainsRule(s7); 66 private static final RulesFolowingClosingListener okListener=new RulesFolowingClosingListener(startedRule, variable1Rule, variable2Rule, initialisedRule, killedRule); 53 67 54 @Test68 // @Test 55 69 public void AppletTestSignedTest() throws Exception { 56 70 ProcessResult pr = server.executeJavawsHeadless(l, "/AppletTestSigned.jnlp"); … … 61 75 62 76 private void evaluateSignedApplet(ProcessResult pr, boolean javawsApplet) { 63 String s3 = "AppletTestSigned was initialised"; 64 Assert.assertTrue("AppletTestSigned stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); 65 String s0 = "AppletTestSigned was started"; 66 Assert.assertTrue("AppletTestSigned stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); 67 String s1 = "value1"; 68 Assert.assertTrue("AppletTestSigned stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); 69 String s2 = "value2"; 70 Assert.assertTrue("AppletTestSigned stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); 71 String ss = "xception"; 72 Assert.assertFalse("AppletTestSigned stderr should not contain " + ss + " but did", pr.stderr.contains(ss)); 73 String s7 = "AppletTestSigned killing himself after 2000 ms of life"; 74 Assert.assertTrue("AppletTestSigned stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); 77 Assert.assertTrue("AppletTestSigned stdout " + initialisedRule.toPassingString() + " but didn't", initialisedRule.evaluate(pr.stdout)); 78 Assert.assertTrue("AppletTestSigned stdout " + startedRule.toPassingString() + " but didn't", startedRule.evaluate(pr.stdout)); 79 Assert.assertTrue("AppletTestSigned stdout " + variable1Rule.toPassingString() + " but didn't", variable1Rule.evaluate(pr.stdout)); 80 Assert.assertTrue("AppletTestSigned stdout " + variable2Rule.toPassingString() + " but didn't", variable2Rule.evaluate(pr.stdout)); 81 Assert.assertTrue("AppletTestSigned stdout " + killedRule.toPassingString() + " but didn't", killedRule.evaluate(pr.stdout)); 75 82 if (!javawsApplet) { 76 83 /*this is working correctly in most browser, but not in all. temporarily disabling … … 85 92 @Test 86 93 @TestInBrowsers(testIn = {Browsers.all}) 87 public void AppletTestSignedFirefoxTest () throws Exception {94 public void AppletTestSignedFirefoxTestXslowX() throws Exception { 88 95 ServerAccess.PROCESS_TIMEOUT = 30 * 1000; 89 96 try { 90 ProcessResult pr = server.executeBrowser("/AppletTestSigned .html");97 ProcessResult pr = server.executeBrowser("/AppletTestSigned2.html", okListener, null); 91 98 evaluateSignedApplet(pr, false); 92 Assert.assertTrue(pr.wasTerminated);99 //Assert.assertTrue(pr.wasTerminated); 93 100 //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null 94 101 } finally { … … 96 103 } 97 104 } 105 106 @Test 107 @TestInBrowsers(testIn = {Browsers.all}) 108 public void AppletTestSignedFirefoxTest() throws Exception { 109 ProcessResult pr = server.executeBrowser("/AppletTestSigned.html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); 110 evaluateSignedApplet(pr, false); 111 //Assert.assertTrue(pr.wasTerminated); 112 //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null 113 } 98 114 } -
trunk/icedtea-web/tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java
r418 r429 45 45 import java.util.Arrays; 46 46 import java.util.List; 47 import java.util.PropertyResourceBundle; 47 48 import java.util.regex.Matcher; 48 49 import java.util.regex.Pattern; 49 50 import net.sourceforge.jnlp.ServerAccess; 50 import net.sourceforge.jnlp. ServerAccess.ProcessResult;51 import net.sourceforge.jnlp.ProcessResult; 51 52 import net.sourceforge.jnlp.annotations.KnownToFail; 53 import net.sourceforge.jnlp.config.Defaults; 54 import net.sourceforge.jnlp.tools.MessageProperties; 52 55 import org.junit.AfterClass; 53 56 import org.junit.Assert; … … 61 64 private static final List<String> trustedVerboses = Arrays.asList(new String[]{"-Xtrustall", ServerAccess.HEADLES_OPTION,"-verbose"}); 62 65 private static final List<String> verbosed = Arrays.asList(new String[]{"-verbose", ServerAccess.HEADLES_OPTION}); 63 private static final String home = System.getProperty("user.home"); 64 private static final String name = System.getProperty("user.name"); 65 private static final String tmp = System.getProperty("java.io.tmpdir"); 66 private static final File icedteaDir = new File(home + "/" + ".icedtea"); 67 private static final File icedteaCache = new File(icedteaDir, "cache"); 68 private static final File icedteaCacheFile = new File(icedteaCache, "recently_used"); 69 private static final File netxLock = new File(tmp + "/" + name + "/netx/locks/netx_running"); 66 70 67 private static final String lre = "LruCacheException"; 71 68 private static final String ioobe = "IndexOutOfBoundsException"; … … 74 71 private static final String corruptString = "156dsf1562kd5"; 75 72 76 String testS = "#netx file\n" 77 + "#Mon Dec 12 16:20:46 CET 2011\n" 78 + "1323703236508,0=/home/xp13/.icedtea/cache/0/http/localhost/ReadPropertiesBySignedHack.jnlp\n" 79 + "1323703243086,2=/home/xp14/.icedtea/cache/2/http/localhost/ReadProperties.jar\n" 80 + "1323703243082,1=/home/xp15/.icedtea/cache/1/http/localhost/ReadPropertiesBySignedHack.jar"; 73 private static final File icedteaCache = new File(Defaults.USER_CACHE_HOME, "cache"); 74 private static final File icedteaCacheFile = new File(icedteaCache, "recently_used"); 75 private static final File netxLock = new File(System.getProperty("java.io.tmpdir"), 76 System.getProperty("user.name") + File.separator + 77 "netx" + File.separator + 78 "locks" + File.separator + 79 "netx_running"); 80 81 String testS = "#netx file\n" 82 + "#Mon Dec 12 16:20:46 CET 2011\n" 83 + "1323703236508,0=/home/xp13/.icedtea/cache/0/http/localhost/ReadPropertiesBySignedHack.jnlp\n" 84 + "1323703243086,2=/home/xp14/.icedtea/cache/2/http/localhost/ReadProperties.jar\n" 85 + "1323703243082,1=/home/xp15/.icedtea/cache/1/http/localhost/ReadPropertiesBySignedHack.jar"; 81 86 82 87 @Test … … 94 99 } 95 100 96 private class ParallelSimpleTestRunner extends Thread { 97 public boolean b=false; 98 @Override 99 public void run() { 100 try { 101 102 ServerAccess.ProcessResult pr = runSimpleTest1(); 103 evaluateSimpleTest1OkCache(pr); 104 b=true; 105 } catch (Exception ex) { 106 throw new RuntimeException(ex); 107 } 108 } 109 }; 101 private class ParallelSimpleTestRunner extends Thread { 102 public boolean b=false; 103 @Override 104 public void run() { 105 try { 106 ProcessResult pr = runSimpleTest1(); 107 evaluateSimpleTest1OkCache(pr); 108 b=true; 109 } catch (Exception ex) { 110 throw new RuntimeException(ex); 111 } 112 } 113 } 110 114 111 115 @Test … … 261 265 public void run() { 262 266 try { 263 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(verbosed, "/deadlocktest.jnlp");267 ProcessResult pr = server.executeJavawsHeadless(verbosed, "/deadlocktest.jnlp"); 264 268 } catch (Exception ex) { 265 269 throw new RuntimeException(ex); … … 270 274 Thread.sleep(1000); 271 275 pr = tryToClearcache(); 272 String q = "Can not clear cache at this time"; 273 Assert.assertTrue("Stderr should contain " + q + ", but did not.", pr.stderr.contains(q));274 assertCacheIsNotEmpty();275 }276 277 276 277 String cacheClearError = MessageProperties.getMessage("CCannotClearCache"); 278 Assert.assertTrue("Stderr should contain " + cacheClearError + ", but did not.", pr.stderr.contains(cacheClearError)); 279 assertCacheIsNotEmpty(); 280 } 281 278 282 //next four tests are designed to ensure, that corrupted cache will not break already loaded cached files 279 283 public static final String CR1 = "CacheReproducer1"; … … 338 342 if (netxLock.isFile()) { 339 343 boolean b = netxLock.delete(); 340 junit.framework.Assert.assertTrue(b);344 Assert.assertTrue(b); 341 345 } 342 346 … … 378 382 } 379 383 String sb = breakOne(s, 0); 380 junit.framework.Assert.assertEquals(s, sb);384 Assert.assertEquals(s, sb); 381 385 for (int x = 1; x <= 3; x++) { 382 386 String[] sx = breakOne(s, x).split("\n"); … … 427 431 428 432 private static String breakPaths(String s) { 429 return s.replaceAll( home+".*", "/ho");433 return s.replaceAll(System.getProperty("user.home") + ".*", "/ho"); 430 434 } 431 435 … … 448 452 } 449 453 450 private static ServerAccess.ProcessResult runSimpleTest1() throws Exception {454 private static ProcessResult runSimpleTest1() throws Exception { 451 455 return runSimpleTest1(verbosed, "simpletest1"); 452 456 } 453 457 454 private static ServerAccess.ProcessResult runSimpleTest1(List<String> args, String s) throws Exception {455 ServerAccess.ProcessResult pr2 = server.executeJavawsHeadless(args, "/" + s + ".jnlp");458 private static ProcessResult runSimpleTest1(List<String> args, String s) throws Exception { 459 ProcessResult pr2 = server.executeJavawsHeadless(args, "/" + s + ".jnlp"); 456 460 return pr2; 457 461 } 458 462 459 private static ServerAccess.ProcessResult runSimpleTest1Signed() throws Exception {463 private static ProcessResult runSimpleTest1Signed() throws Exception { 460 464 return runSimpleTestSigned("SimpletestSigned1"); 461 465 } 462 466 463 private static ServerAccess.ProcessResult runSimpleTestSigned(String id) throws Exception {467 private static ProcessResult runSimpleTestSigned(String id) throws Exception { 464 468 return runSimpleTest1(trustedVerboses, id); 465 469 } 466 470 467 private static void evaluateSimpleTest1OkCache( ServerAccess.ProcessResult pr2) throws Exception {471 private static void evaluateSimpleTest1OkCache(ProcessResult pr2) throws Exception { 468 472 String s = "Good simple javaws exapmle"; 469 473 Assert.assertTrue("test stdout should contain " + s + " but didn't", pr2.stdout.contains(s)); … … 473 477 474 478 private static ProcessResult tryToClearcache() throws Exception { 475 ServerAccess.ProcessResult pr1 = ServerAccess.executeProcess(clear);479 ProcessResult pr1 = ServerAccess.executeProcess(clear); 476 480 return pr1; 477 481 } -
trunk/icedtea-web/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java
r418 r429 39 39 import java.util.List; 40 40 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 import net.sourceforge.jnlp.ServerAccess.ProcessResult;43 import net.sourceforge.jnlp.annotations.Bug;44 43 import net.sourceforge.jnlp.annotations.KnownToFail; 45 44 import net.sourceforge.jnlp.annotations.NeedsDisplay; … … 51 50 import org.junit.Test; 52 51 53 @Bug(id = "PR975")54 52 public class ClasspathManifestTest extends BrowserTest { 55 53 … … 79 77 commands.add(ServerAccess.HEADLES_OPTION); 80 78 commands.add("ClasspathManifestApplicationTest.jnlp"); 81 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());79 ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); 82 80 checkAppFails(pr, "ApplicationJNLPLocalTest"); 83 81 } … … 86 84 @Test 87 85 public void AppletJNLPRemoteTest() throws Exception { 88 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp");86 ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp"); 89 87 checkAppFails(pr, "AppletJNLPRemoteTest"); 90 88 } … … 98 96 commands.add(ServerAccess.HEADLES_OPTION); 99 97 commands.add("ClasspathManifestAppletTest.jnlp"); 100 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());98 ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); 101 99 checkAppFails(pr, "AppletJNLPRLocalTest"); 102 100 } … … 106 104 @Test 107 105 public void BrowserJNLPHrefRemoteTest() throws Exception { 108 ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html");106 ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html"); 109 107 checkAppFails(pr, "BrowserJNLPHrefRemoteTest"); 110 108 } … … 118 116 commands.add(server.getBrowserLocation()); 119 117 commands.add("ClasspathManifestJNLPHrefTest.html"); 120 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());118 ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); 121 119 checkAppFails(pr, "BrowserJNLPHrefLocalTest"); 122 120 } … … 126 124 @Test 127 125 public void BrowserAppletRemoteTest() throws Exception { 128 ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html");126 ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html"); 129 127 Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); 130 128 // Should be the only one to search manifest for classpath. 131 129 Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); 132 Assert.assertFalse("ClasspathManifest.BrowserAppletRemoteTest stderr should not contain " + ss + " but did", pr.stderr.contains(ss));133 130 } 134 131 } -
trunk/icedtea-web/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 43 import net.sourceforge.jnlp.annotations.Bug; … … 56 57 @Test 57 58 public void checkingForRequiredResources() throws Exception { 58 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp");59 ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp"); 59 60 Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(jarOutput)); 60 61 … … 67 68 @Test 68 69 public void usingSignedExtension() throws Exception { 69 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp");70 ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp"); 70 71 Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); 71 72 } … … 74 75 @Test 75 76 public void mainJarInExtension() throws Exception { 76 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp");77 ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp"); 77 78 Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); 78 79 } … … 81 82 @Test 82 83 public void checkingSignedJnlpInExtension() throws Exception { 83 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp");84 ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp"); 84 85 Assert.assertTrue("Stdout should contain " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); 85 86 } -
trunk/icedtea-web/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java
r418 r429 40 40 import java.util.Collections; 41 41 import java.util.List; 42 import net.sourceforge.jnlp.ProcessResult; 42 43 import net.sourceforge.jnlp.ServerAccess; 43 import net.sourceforge.jnlp.ServerAccess.ProcessResult;44 44 import net.sourceforge.jnlp.annotations.Bug; 45 45 import net.sourceforge.jnlp.annotations.NeedsDisplay; … … 79 79 @Bug(id = {"RH816592","PR858"}) 80 80 public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplication() throws Exception { 81 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp");81 ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp"); 82 82 evaluate(pr); 83 83 Assert.assertFalse("should not be terminated but was", pr.wasTerminated); … … 88 88 String ss = "Good simple javaws exapmle"; 89 89 Assert.assertTrue("Stdout should contains " + ss + " but didn't", pr.stdout.contains(ss)); 90 String s = "xception";91 Assert.assertFalse("Stderr should not contains " + s + " but did", pr.stderr.contains(s));92 90 } 93 91 … … 95 93 @Bug(id = {"RH816592","PR858"}) 96 94 public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplet() throws Exception { 97 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-new.jnlp");95 ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-new.jnlp"); 98 96 evaluate(pr); 99 97 Assert.assertFalse("should not be terminated but was", pr.wasTerminated); … … 106 104 @TestInBrowsers(testIn={Browsers.all}) 107 105 public void launchInternalClassloaderWithDownloadedResourceAsHtmlApplet() throws Exception { 108 ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html");106 ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html"); 109 107 evaluate(pr); 110 108 Assert.assertTrue("should be terminated but was not", pr.wasTerminated); … … 114 112 @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) 115 113 public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplicationHack() throws Exception { 116 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp");114 ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp"); 117 115 evaluate(pr); 118 116 Assert.assertFalse("should not be terminated but was", pr.wasTerminated); … … 123 121 @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) 124 122 public void launchInternalClassloaderWithDownloadedResourceAsJnlpAppletHack() throws Exception { 125 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-hack.jnlp");123 ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-hack.jnlp"); 126 124 evaluate(pr); 127 125 Assert.assertFalse("should not be terminated but was", pr.wasTerminated); … … 134 132 @TestInBrowsers(testIn={Browsers.all}) 135 133 public void launchInternalClassloaderWithDownloadedResourceAsHtmlAppletHack() throws Exception { 136 ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html");134 ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html"); 137 135 evaluate(pr); 138 136 Assert.assertTrue("should be terminated but was not", pr.wasTerminated); -
trunk/icedtea-web/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java
r418 r429 1 /* MissingJar .java1 /* MissingJarTest.java 2 2 Copyright (C) 2011 Red Hat, Inc. 3 3 … … 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 import net.sourceforge.jnlp.ServerAccess.ProcessResult; 43 43 44 import org.junit.Assert; 44 45 45 import org.junit.Test; 46 46 … … 61 61 @Test 62 62 public void MissingJarTest1() throws Exception { 63 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp");63 ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp"); 64 64 evaluateResult(pr); 65 65 } … … 67 67 @Test 68 68 public void MissingJarTest2() throws Exception { 69 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp");69 ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp"); 70 70 evaluateResult(pr); 71 71 } … … 73 73 @Test 74 74 public void MissingJarTest3() throws Exception { 75 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp");75 ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp"); 76 76 evaluateResult(pr); 77 77 } … … 79 79 @Test 80 80 public void MissingJarTest4() throws Exception { 81 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp");81 ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp"); 82 82 evaluateResult(pr); 83 83 } -
trunk/icedtea-web/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java
r418 r429 1 /* ReadProperties SignedTest.java1 /* ReadPropertiesBySignedHackTest.java 2 2 Copyright (C) 2011 Red Hat, Inc. 3 3 … … 36 36 */ 37 37 38 39 38 import java.util.Arrays; 40 39 import java.util.Collections; 41 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 42 42 import net.sourceforge.jnlp.ServerAccess; 43 43 44 import org.junit.Assert; 44 45 import org.junit.Test; … … 53 54 public void ReadPropertiesBySignedHackWithjoutXtrustAll() throws Exception { 54 55 //no request for permissions 55 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp");56 ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp"); 56 57 String s="java.lang.SecurityException: class \"ReadProperties\"'s signer information does not match signer information of other classes in the same package"; 57 58 Assert.assertTrue("Stderr should contains "+s+" but did not",pr.stderr.contains(s)); 58 59 String ss="ClassNotFoundException"; 59 60 Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); 60 Assert.assertTrue("stdout lenght should be <2 but was "+pr.stdout.length(),pr.stdout.length()<2); // /home/user or /root or eanything else :(61 61 Assert.assertFalse("should not be terminated but was",pr.wasTerminated); 62 62 Assert.assertEquals((Integer)0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java
r418 r429 36 36 */ 37 37 38 39 38 import java.util.Arrays; 40 39 import java.util.Collections; 41 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 42 42 import net.sourceforge.jnlp.ServerAccess; 43 43 44 import org.junit.Assert; 44 45 import org.junit.Test; … … 54 55 public void ReadSignedPropertiesWithoutPermissionsWithXtrustAll() throws Exception { 55 56 //no request for permissions 56 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp");57 ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp"); 57 58 Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher)); 58 59 String ss="ClassNotFoundException"; 59 60 Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); 60 Assert.assertTrue("stdout lenght should be <2 but was "+pr.stdout.length(),pr.stdout.length()<2); // /home/user or /root or eanything else :(61 61 Assert.assertFalse("should not be terminated but was",pr.wasTerminated); 62 62 Assert.assertEquals((Integer)0, pr.returnValue); … … 66 66 public void ReadSignedPropertiesWithPermissionsWithXtrustAll() throws Exception { 67 67 //request for allpermissions 68 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp");68 ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp"); 69 69 Assert.assertFalse("Stderr should NOT match "+accessMatcher+" but did",pr.stderr.matches(accessMatcher)); 70 70 String ss="ClassNotFoundException"; 71 71 Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); 72 Assert.assertTrue("stdout lenght should be >= but was "+pr.stdout.length(),pr.stdout.length()>=4); // /home/user or /root or eanything else :(73 72 Assert.assertFalse("should not be terminated but was",pr.wasTerminated); 74 73 Assert.assertEquals((Integer)0, pr.returnValue); … … 77 76 @Test 78 77 public void EnsureXtrustallNotAffectingUnsignedBehaviour() throws Exception { 79 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp");78 ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp"); 80 79 Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher)); 81 80 String ss="ClassNotFoundException"; 82 81 Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); 83 Assert.assertFalse("stdout lenght should not be >2 but was "+pr.stdout.length(),pr.stdout.length()>2);84 82 Assert.assertFalse("should not be terminated but was",pr.wasTerminated); 85 83 Assert.assertEquals((Integer)0, pr.returnValue); 86 ServerAccess.ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");84 ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); 87 85 Assert.assertEquals(pr.stderr, pr2.stderr); 88 86 Assert.assertEquals(pr.stdout, pr2.stdout); 89 90 87 } 91 88 } -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html
r418 r429 38 38 39 39 <!-- Uses show-document to go to a page that clears the cookie --> 40 40 41 41 <html><head></head><body bgcolor="red"> 42 42 <p> 43 43 <applet code="CheckingCookies.class" archive="SavingCookies.jar" codebase="." width="100" height="100"> 44 44 45 45 <param name="show-document" value="ClearPersistentCookie.html"> 46 46 47 47 </applet> 48 48 </p> -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html
r418 r429 41 41 42 42 <param name="persistent" value="no"> 43 43 44 44 <param name="cookie" value="TEST=deleted; Expires=Thu, 01 Jan 1970 00:00:01 GMT"> 45 45 -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html
r418 r429 41 41 42 42 <param name="persistent" value="yes"> 43 43 44 44 <param name="cookie" value="TEST=persistent"> 45 45 46 46 </applet> 47 47 </p> -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html
r418 r429 42 42 <param name="show-document" value="CheckCookieAndGotoClear.html"> 43 43 <param name="persistent" value="yes"> 44 44 45 45 <param name="cookie" value="TEST=persistent"> 46 46 -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html
r418 r429 41 41 42 42 <param name="persistent" value="no"> 43 43 44 44 <param name="cookie" value="TEST=session"> 45 45 -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java
r418 r429 1 1 /* SavingCookies.java 2 2 Store cookies in the java cookie store, and go to a page that confirms they are there. 3 3 4 4 Copyright (C) 2012 Red Hat, Inc. 5 5 -
trunk/icedtea-web/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java
r418 r429 51 51 52 52 public class SavingCookiesTests extends BrowserTest { 53 53 54 54 static final String ENTERING_CHECK = "Entered CheckingCookies"; 55 55 static final String CHECKING_COMPLETION = "Finished CheckingCookies"; … … 86 86 }; 87 87 if (url.endsWith(".html")) { 88 pr = server.executeBrowser(url, stdoutListener, stdoutListener);88 pr = server.executeBrowser(url, stdoutListener, null); 89 89 } else if (url.endsWith(".jnlp")) { 90 pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, stdoutListener);90 pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, null, null); 91 91 } 92 92 } catch (Exception ex) { … … 106 106 final String COOKIE_SANITY_CHECK = "Found cookie: TEST="; 107 107 ProcessResult pr = server.executeBrowser("/CheckCookie.html"); 108 108 109 109 Assert.assertFalse("stdout should NOT contain '" + COOKIE_SANITY_CHECK + "' but did.", pr.stdout.contains(COOKIE_SANITY_CHECK)); 110 110 Assert.assertTrue("stdout should contain '" + CHECKING_COMPLETION + "' but did not.", pr.stdout.contains(CHECKING_COMPLETION)); 111 111 } 112 112 113 113 @Test 114 114 @TestInBrowsers(testIn = { Browsers.one }) … … 130 130 Thread.sleep(100); 131 131 } 132 132 133 133 ProcessResult check = server.executeBrowser("/CheckCookie.html"); 134 134 save.join(); 135 135 136 136 Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", save.pr.stdout.contains(ENTERING_CHECK)); 137 137 //XXX: It is necessary to check save.pr's stdout, because it does not show up in 'check.stdout' for some reason … … 155 155 public void AppletPersistentCookieShowDoc() throws Exception { 156 156 ProcessResult pr = server.executeBrowser("/SavePersistentCookieAndGotoCheck.html"); 157 157 158 158 Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", pr.stdout.contains(ENTERING_CHECK)); 159 159 Assert.assertTrue("stdout should contain '" + COOKIE_PERSISTENT_CHECK + "' but did not.", pr.stdout.contains(COOKIE_PERSISTENT_CHECK)); -
trunk/icedtea-web/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 43 42 44 import org.junit.Assert; 43 45 import org.junit.Test; … … 53 55 @Test 54 56 public void launchingFileMatchesSignedApplication1() throws Exception { 55 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp");57 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp"); 56 58 String s = "Running signed application in main"; 57 59 Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); … … 63 65 @Test 64 66 public void launchingFileDoesNotMatchSignedApplication1() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp");67 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp"); 66 68 Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); 67 69 } … … 72 74 @Test 73 75 public void launchingFileDoesNotMatchSignedApplication2() throws Exception { 74 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp");76 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp"); 75 77 Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); 76 78 } -
trunk/icedtea-web/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 43 42 44 import org.junit.Assert; 43 45 import org.junit.Test; … … 50 52 @Test 51 53 public void launchingFileMatchesSigned() throws Exception { 52 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp");54 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp"); 53 55 String s = "Running signed application in main"; 54 56 Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); … … 57 59 @Test 58 60 public void launchingFileDoesNotMatchSigned() throws Exception { 59 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp");61 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp"); 60 62 String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + 61 63 "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + -
trunk/icedtea-web/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 43 import org.junit.Assert; … … 50 51 @Test 51 52 public void launchingFileMatchesSigned() throws Exception { 52 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp");53 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp"); 53 54 String s = "Running signed application in main"; 54 55 Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); … … 57 58 @Test 58 59 public void launchingFileDoesNotMatchSigned() throws Exception { 59 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp");60 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp"); 60 61 String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + 61 62 "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + -
trunk/icedtea-web/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 43 42 44 import org.junit.Assert; 43 45 import org.junit.Test; … … 53 55 @Test 54 56 public void launchingFileMatchesSignedTemplate1() throws Exception { 55 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp");57 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp"); 56 58 String s = "Running signed application in main"; 57 59 Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); … … 63 65 @Test 64 66 public void launchingFileDoesNotMatchSignedTemplate2() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp");67 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp"); 66 68 Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); 67 69 } … … 72 74 @Test 73 75 public void launchingFileDoesNotMatchSignedTemplate3() throws Exception { 74 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp");76 ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp"); 75 77 Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); 76 78 } -
trunk/icedtea-web/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java
r418 r429 38 38 import java.util.ArrayList; 39 39 import java.util.List; 40 import net.sourceforge.jnlp.ProcessResult; 40 41 import net.sourceforge.jnlp.ServerAccess; 41 42 import net.sourceforge.jnlp.annotations.Bug; … … 44 45 import net.sourceforge.jnlp.browsertesting.Browsers; 45 46 import net.sourceforge.jnlp.annotations.TestInBrowsers; 47 46 48 import org.junit.Assert; 47 48 49 import org.junit.Test; 49 50 50 51 @Bug(id={"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016127.html","PR804","PR811"}) 51 52 public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { 52 53 53 54 54 @Bug(id="PR811") … … 83 83 * only on ocal files, and probably only from test run - it can be ignored 84 84 */ 85 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); 86 String s="Signed spaces can be everywhere.jsr was launched correctly"; 87 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 88 String cc = "xception"; 89 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 85 ProcessResult pr = ServerAccess.executeProcess(commands); 86 String s="Signed spaces can be everywhere.jsr was launched correctly"; 87 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 90 88 Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); 91 89 Assert.assertEquals((Integer) 0, pr.returnValue); … … 96 94 @NeedsDisplay 97 95 public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2Signed() throws Exception { 98 ServerAccess.ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too%20signed.jnlp"); 99 String s="Signed spaces can be everywhere.jsr was launched correctly"; 100 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 101 String cc = "xception"; 102 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 96 ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too%20signed.jnlp"); 97 String s="Signed spaces can be everywhere.jsr was launched correctly"; 98 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 103 99 Assert.assertFalse("should NOT be terminated, but was not", pr.wasTerminated); 104 100 } … … 109 105 @TestInBrowsers(testIn = {Browsers.one}) 110 106 public void SpacesCanBeEverywhereRemoteAppletTestsHtml2Signed() throws Exception { 111 ServerAccess.ProcessResult pr = server.executeBrowser("/spaces+applet+Tests+signed.html"); 112 String s="Signed spaces can be everywhere.jsr was launched correctly"; 113 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 114 String cc = "xception"; 115 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 107 ProcessResult pr = server.executeBrowser("/spaces+applet+Tests+signed.html"); 108 String s="Signed spaces can be everywhere.jsr was launched correctly"; 109 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 116 110 Assert.assertTrue("should be terminated, but was not", pr.wasTerminated); 117 111 } … … 121 115 @Test 122 116 public void SpacesCanBeEverywhereRemoteTests1Signed() throws Exception { 123 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1%20signed.jnlp");117 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1%20signed.jnlp"); 124 118 String s = "Good simple javaws exapmle"; 125 119 Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); … … 133 127 @Test 134 128 public void SpacesCanBeEverywhereRemoteTests2Signed() throws Exception { 135 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp");129 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp"); 136 130 String s="Signed spaces can be everywhere.jsr was launched correctly"; 137 131 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); … … 145 139 @Test 146 140 public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery1() throws Exception { 147 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test=20");141 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test=20"); 148 142 String s="Signed spaces can be everywhere.jsr was launched correctly"; 149 143 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); … … 157 151 @Test 158 152 public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery2() throws Exception { 159 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test%3D20");153 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test%3D20"); 160 154 161 155 String s="Signed spaces can be everywhere.jsr was launched correctly"; … … 170 164 @Test 171 165 public void SpacesCanBeEverywhereRemoteTests3Signed() throws Exception { 172 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp");166 ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp"); 173 167 String s="Signed spaces can be everywhere.jsr was launched correctly"; 174 168 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); … … 187 181 commands.add(ServerAccess.HEADLES_OPTION); 188 182 commands.add("Spaces can be everywhere1.jnlp"); 189 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());183 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 190 184 String s = "Good simple javaws exapmle"; 191 185 Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); … … 203 197 commands.add(ServerAccess.HEADLES_OPTION); 204 198 commands.add("Spaces can be everywhere2 signed.jnlp"); 205 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());199 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 206 200 String s="Signed spaces can be everywhere.jsr was launched correctly"; 207 201 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); … … 219 213 commands.add(ServerAccess.HEADLES_OPTION); 220 214 commands.add(server.getDir()+"/Spaces can be everywhere2 signed.jnlp"); 221 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands);215 ProcessResult pr = ServerAccess.executeProcess(commands); 222 216 String s="Signed spaces can be everywhere.jsr was launched correctly"; 223 217 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); … … 235 229 commands.add(ServerAccess.HEADLES_OPTION); 236 230 commands.add("SpacesCanBeEverywhere1signed.jnlp"); 237 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());231 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 238 232 String s="Signed spaces can be everywhere.jsr was launched correctly"; 239 233 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); -
trunk/icedtea-web/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java
r418 r429 38 38 import java.util.Arrays; 39 39 import java.util.List; 40 import net.sourceforge.jnlp.ProcessResult; 40 41 import net.sourceforge.jnlp.ServerAccess; 41 import net.sourceforge.jnlp.ServerAccess.ProcessResult; 42 42 43 import org.junit.Assert; 43 44 44 import org.junit.Test; 45 45 … … 73 73 private static final List<String> xta = Arrays.asList(new String[]{"-Xtrustall"}); 74 74 75 private void testShouldFail( ServerAccess.ProcessResult pr, String s) {75 private void testShouldFail(ProcessResult pr, String s) { 76 76 String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; 77 77 Assert.assertTrue("stderr should match `" + c + "`, but didn't ", pr.stderr.matches(c)); 78 78 } 79 79 80 private void testShouldNOTFail( ServerAccess.ProcessResult pr, String s) {80 private void testShouldNOTFail(ProcessResult pr, String s) { 81 81 String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; 82 82 Assert.assertFalse("stderr should NOT match `" + c + "`, but did ", pr.stderr.matches(c)); … … 90 90 } 91 91 92 private void testShouldPass( ServerAccess.ProcessResult pr, String s) {92 private void testShouldPass(ProcessResult pr, String s) { 93 93 String c = "Class was obtained: " + s; 94 94 Assert.assertTrue("stdout should contains `" + c + "`, but didn't ", pr.stdout.contains(c)); 95 95 } 96 96 97 private void testShouldNOTPass( ServerAccess.ProcessResult pr, String s) {97 private void testShouldNOTPass(ProcessResult pr, String s) { 98 98 String c = "Class was obtained: " + s; 99 99 Assert.assertFalse("stdout should not contains `" + c + "`, but did ", pr.stdout.contains(c)); … … 102 102 @Test 103 103 public void AccessClassInPackageJAVAXJNLP() throws Exception { 104 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]);104 ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]); 105 105 commonPitfall(pr); 106 106 testShouldPass(pr, pass[0]); … … 110 110 @Test 111 111 public void AccessClassInPackageSELF() throws Exception { 112 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]);112 ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]); 113 113 commonPitfall(pr); 114 114 testShouldPass(pr, pass[1]); … … 118 118 @Test 119 119 public void AccessClassInPackageNETSF() throws Exception { 120 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]);120 ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]); 121 121 commonPitfall(pr); 122 122 testShouldFail(pr, badExceptions[2]); … … 126 126 @Test 127 127 public void AccessClassInPackageSUNSEC() throws Exception { 128 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]);128 ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]); 129 129 commonPitfall(pr); 130 130 commonPitfall(pr); … … 136 136 @Test 137 137 public void AccessClassInPackageSignedJAVAXJNLP() throws Exception { 138 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]);138 ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]); 139 139 commonPitfall(pr); 140 140 testShouldPass(pr, pass[0]); … … 144 144 @Test 145 145 public void AccessClassInPackageSignedSELF() throws Exception { 146 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]);146 ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]); 147 147 commonPitfall(pr); 148 148 testShouldPass(pr, pass[1]); … … 152 152 @Test 153 153 public void AccessClassInPackageSignedNETSF() throws Exception { 154 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]);154 ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]); 155 155 commonPitfall(pr); 156 156 testShouldPass(pr, pass[2]); … … 160 160 @Test 161 161 public void AccessClassInPackageSignedSUNSEC() throws Exception { 162 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]);162 ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]); 163 163 commonPitfall(pr); 164 164 testShouldPass(pr, pass[3]); -
trunk/icedtea-web/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java
r418 r429 1 2 import java.applet.Applet; 3 1 4 /* AddShutdownHook.java 2 Copyright (C) 2011 Red Hat, Inc.5 Copyright (C) 2011 Red Hat, Inc. 3 6 4 This file is part of IcedTea.7 This file is part of IcedTea. 5 8 6 IcedTea is free software; you can redistribute it and/or7 modify it under the terms of the GNU General Public License as published by8 the Free Software Foundation, version 2.9 IcedTea is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License as published by 11 the Free Software Foundation, version 2. 9 12 10 IcedTea is distributed in the hope that it will be useful,11 but WITHOUT ANY WARRANTY; without even the implied warranty of12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13 General Public License for more details.13 IcedTea is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 General Public License for more details. 14 17 15 You should have received a copy of the GNU General Public License16 along with IcedTea; see the file COPYING. If not, write to17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA18 02110-1301 USA.18 You should have received a copy of the GNU General Public License 19 along with IcedTea; see the file COPYING. If not, write to 20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 02110-1301 USA. 19 22 20 Linking this library statically or dynamically with other modules is21 making a combined work based on this library. Thus, the terms and22 conditions of the GNU General Public License cover the whole23 combination.23 Linking this library statically or dynamically with other modules is 24 making a combined work based on this library. Thus, the terms and 25 conditions of the GNU General Public License cover the whole 26 combination. 24 27 25 As a special exception, the copyright holders of this library give you26 permission to link this library with independent modules to produce an27 executable, regardless of the license terms of these independent28 modules, and to copy and distribute the resulting executable under29 terms of your choice, provided that you also meet, for each linked30 independent module, the terms and conditions of the license of that31 module. An independent module is a module which is not derived from32 or based on this library. If you modify this library, you may extend33 this exception to your version of the library, but you are not34 obligated to do so. If you do not wish to do so, delete this35 exception statement from your version.28 As a special exception, the copyright holders of this library give you 29 permission to link this library with independent modules to produce an 30 executable, regardless of the license terms of these independent 31 modules, and to copy and distribute the resulting executable under 32 terms of your choice, provided that you also meet, for each linked 33 independent module, the terms and conditions of the license of that 34 module. An independent module is a module which is not derived from 35 or based on this library. If you modify this library, you may extend 36 this exception to your version of the library, but you are not 37 obligated to do so. If you do not wish to do so, delete this 38 exception statement from your version. 36 39 */ 40 public class AddShutdownHook extends Applet { 37 41 38 public class AddShutdownHook {39 42 public static void main(String[] args) { 40 43 41 Runtime.getRuntime().addShutdownHook(new Thread() { 42 public void run() { 43 // no op 44 } 45 }); 46 44 Runtime.getRuntime().addShutdownHook(new Thread() { 45 public void run() { 46 // no op 47 } 48 }); 49 50 } 51 52 @Override 53 public void start() { 54 main(null); 55 System.err.println("WRONG - ShutdownHook was probably added"); 47 56 } 48 57 } -
trunk/icedtea-web/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
r418 r429 1 1 /* AddShutdownHookTest.java 2 Copyright (C) 2011 Red Hat, Inc.2 Copyright (C) 2011 Red Hat, Inc. 3 3 4 This file is part of IcedTea.4 This file is part of IcedTea. 5 5 6 IcedTea is free software; you can redistribute it and/or7 modify it under the terms of the GNU General Public License as published by8 the Free Software Foundation, version 2.6 IcedTea is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, version 2. 9 9 10 IcedTea is distributed in the hope that it will be useful,11 but WITHOUT ANY WARRANTY; without even the implied warranty of12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13 General Public License for more details.10 IcedTea is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 General Public License for more details. 14 14 15 You should have received a copy of the GNU General Public License16 along with IcedTea; see the file COPYING. If not, write to17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA18 02110-1301 USA.15 You should have received a copy of the GNU General Public License 16 along with IcedTea; see the file COPYING. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 02110-1301 USA. 19 19 20 Linking this library statically or dynamically with other modules is21 making a combined work based on this library. Thus, the terms and22 conditions of the GNU General Public License cover the whole23 combination.20 Linking this library statically or dynamically with other modules is 21 making a combined work based on this library. Thus, the terms and 22 conditions of the GNU General Public License cover the whole 23 combination. 24 24 25 As a special exception, the copyright holders of this library give you26 permission to link this library with independent modules to produce an27 executable, regardless of the license terms of these independent28 modules, and to copy and distribute the resulting executable under29 terms of your choice, provided that you also meet, for each linked30 independent module, the terms and conditions of the license of that31 module. An independent module is a module which is not derived from32 or based on this library. If you modify this library, you may extend33 this exception to your version of the library, but you are not34 obligated to do so. If you do not wish to do so, delete this35 exception statement from your version.25 As a special exception, the copyright holders of this library give you 26 permission to link this library with independent modules to produce an 27 executable, regardless of the license terms of these independent 28 modules, and to copy and distribute the resulting executable under 29 terms of your choice, provided that you also meet, for each linked 30 independent module, the terms and conditions of the license of that 31 module. An independent module is a module which is not derived from 32 or based on this library. If you modify this library, you may extend 33 this exception to your version of the library, but you are not 34 obligated to do so. If you do not wish to do so, delete this 35 exception statement from your version. 36 36 */ 37 37 38 import net.sourceforge.jnlp.ServerAccess; 38 import net.sourceforge.jnlp.ClosingListener; 39 import net.sourceforge.jnlp.ProcessResult; 40 import net.sourceforge.jnlp.annotations.TestInBrowsers; 41 import net.sourceforge.jnlp.browsertesting.BrowserTest; 42 import net.sourceforge.jnlp.browsertesting.Browsers; 43 import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; 44 import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; 39 45 import org.junit.Assert; 40 46 41 47 import org.junit.Test; 42 48 43 public class AddShutdownHookTest {49 public class AddShutdownHookTest extends BrowserTest { 44 50 45 private static ServerAccess server = new ServerAccess(); 51 public static final String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; 52 public static final String cnfString = "ClassNotFoundException"; 53 public static final String confirmFailure = "WRONG - ShutdownHook was probably added"; 54 public static final RulesFolowingClosingListener.MatchesRule mr = new RulesFolowingClosingListener.MatchesRule(s); 55 public static final RulesFolowingClosingListener.ContainsRule cnf = new RulesFolowingClosingListener.ContainsRule(cnfString); 56 public static final RulesFolowingClosingListener.ContainsRule cf = new RulesFolowingClosingListener.ContainsRule(confirmFailure); 57 public static final RulesFolowingClosingListener rfc = new RulesFolowingClosingListener(mr); 46 58 47 59 @Test 48 60 public void AddShutdownHookTestLunch1() throws Exception { 49 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); 50 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; 51 Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); 52 String cc="ClassNotFoundException"; 53 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 54 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2); 55 Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was",pr.wasTerminated); 61 ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); 62 Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); 63 Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); 64 Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was", pr.wasTerminated); 65 Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); 56 66 Assert.assertEquals((Integer) 0, pr.returnValue); 57 67 } 68 69 @Test 70 @TestInBrowsers(testIn = Browsers.one) 71 public void AddShutdownHookApplet() throws Exception { 72 ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", null, rfc); 73 74 if (server.getCurrentBrowsers() == Browsers.firefox) { 75 //lookslike only firefox is able to recieve this 76 Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); 77 } 78 Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); 79 Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); 80 } 58 81 } -
trunk/icedtea-web/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import org.junit.Assert; … … 49 50 @Test 50 51 public void AllStackTracesTest1() throws Exception { 51 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp");52 ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp"); 52 53 String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getStackTrace" + ".*"; 53 54 Assert.assertTrue("stderr should match `"+c+"`, but didn't ",pr.stderr.matches(c)); 54 55 String cc="ClassNotFoundException"; 55 56 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did ",pr.stderr.contains(cc)); 56 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);57 57 Assert.assertFalse("AllStackTracesTest1 should not be terminated, but was",pr.wasTerminated); 58 58 Assert.assertEquals((Integer)0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java
r418 r429 38 38 import java.applet.Applet; 39 39 public class AppletBaseURL extends Applet { 40 41 private class Killer extends Thread {42 43 public int n = 1000;44 45 @Override46 public void run() {47 try {48 Thread.sleep(n);49 System.out.println("Aplet killing himself after " + n + " ms of life");50 System.exit(0);51 } catch (Exception ex) {52 }53 }54 }55 private Killer killer;56 57 40 @Override 58 41 public void init() { 59 42 System.out.println("Document base is " + getDocumentBase() + " for this applet"); 60 43 System.out.println("Codebase is " + getCodeBase() + " for this applet"); 61 killer = new Killer(); 62 killer.start(); 44 System.out.println("*** APPLET FINISHED ***"); 45 46 // Exits JNLP-launched applets, throws exception on normal applet: 47 System.exit(0); 63 48 } 64 49 } -
trunk/icedtea-web/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ServerAccess.ProcessResult; 38 import net.sourceforge.jnlp.ProcessResult; 39 import net.sourceforge.jnlp.ServerAccess.AutoClose; 39 40 import net.sourceforge.jnlp.annotations.Bug; 40 41 import net.sourceforge.jnlp.annotations.NeedsDisplay; … … 49 50 50 51 private void evaluateApplet(ProcessResult pr, String baseName) { 51 String s8= "(?s).*Codebase is http://localhost:[0-9]{5}/ for this applet(?s).*";52 Assert.assertTrue("AppletBaseURL stdout should match" + s8 + " but didn't", pr.stdout.matches(s8));53 String s9 = "(?s).*Document base is http://localhost:[0-9]{5}/" + baseName + " for this applet(?s).*";54 Assert.assertTrue("AppletBaseURL stdout should match" + s9 + " but didn't", pr.stdout.matches(s9));55 String ss = "xception";56 Assert.assertFalse("AppletBaseURL stderr should not contain" + ss + " but did", pr.stderr.contains(ss));52 String codebaseRule = "(?s).*Codebase is http://localhost:[0-9]{5}/ for this applet(?s).*"; 53 Assert.assertTrue("AppletBaseURL stdout should match" + codebaseRule + " but didn't", 54 pr.stdout.matches(codebaseRule)); 55 String documentbaseRule = "(?s).*Document base is http://localhost:[0-9]{5}/" + baseName + " for this applet(?s).*"; 56 Assert.assertTrue("AppletBaseURL stdout should match" + documentbaseRule + " but didn't", 57 pr.stdout.matches(documentbaseRule)); 57 58 } 58 59 … … 60 61 @Test 61 62 public void AppletWebstartBaseURLTest() throws Exception { 62 ProcessResult pr = server.executeJavaws( null,"/AppletBaseURLTest.jnlp");63 ProcessResult pr = server.executeJavaws("/AppletBaseURLTest.jnlp"); 63 64 evaluateApplet(pr, ""); 64 65 Assert.assertFalse(pr.wasTerminated); … … 71 72 @TestInBrowsers(testIn={Browsers.one}) 72 73 public void AppletInFirefoxTest() throws Exception { 73 ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html" );74 ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); 74 75 pr.process.destroy(); 75 76 evaluateApplet(pr, "AppletBaseURLTest.html"); … … 82 83 @TestInBrowsers(testIn={Browsers.one}) 83 84 public void AppletWithJNLPHrefTest() throws Exception { 84 ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html" );85 ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); 85 86 pr.process.destroy(); 86 87 evaluateApplet(pr, "AppletJNLPHrefBaseURLTest.html"); -
trunk/icedtea-web/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import net.sourceforge.jnlp.annotations.TestInBrowsers; 40 41 import net.sourceforge.jnlp.browsertesting.BrowserTest; 41 42 import net.sourceforge.jnlp.browsertesting.Browsers; 43 42 44 import org.junit.Assert; 43 44 45 import org.junit.Test; 45 46 … … 53 54 @Test 54 55 public void AppletJNLPTest() throws Exception { 55 ServerAccess.ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp");56 ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp"); 56 57 57 58 Assert.assertFalse("AppletReadsInvalidJar stdout should NOT contain '" + CORRECT_EXECUTION + "', but did (applet should not have ran!).", pr.stdout.contains(CORRECT_EXECUTION)); … … 63 64 @TestInBrowsers(testIn={Browsers.one}) 64 65 public void AppletInFirefoxTest() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html");66 ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html"); 66 67 67 68 Assert.assertTrue("AppletReadsInvalidJar stdout should contain '" + CORRECT_EXECUTION + "' but did not.", pr.stdout.contains(CORRECT_EXECUTION)); -
trunk/icedtea-web/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java
r418 r429 39 39 */ 40 40 public class AppletTakesLastParam extends Applet { 41 42 private class Killer extends Thread {43 44 public int n = 2000;45 46 @Override47 public void run() {48 try {49 Thread.sleep(n);50 System.out.println("Applet killing itself after " + n + " ms");51 System.exit(0);52 } catch (Exception ex) {53 }54 }55 }56 private Killer killer = new Killer();57 58 @Override59 41 public void init() { 60 42 System.out.println(getParameter("param")); 61 killer.start(); 43 System.out.println("*** APPLET FINISHED ***"); 44 45 // Exits JNLP-launched applets, throws exception on normal applet: 46 System.exit(0); 62 47 } 63 48 } -
trunk/icedtea-web/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java
r418 r429 1 /* AppletT estTests.java1 /* AppletTakesLastParamTests.java 2 2 Copyright (C) 2011 Red Hat, Inc. 3 3 … … 36 36 */ 37 37 38 import net.sourceforge.jnlp. ServerAccess;39 import net.sourceforge.jnlp.ServerAccess. ProcessResult;38 import net.sourceforge.jnlp.ProcessResult; 39 import net.sourceforge.jnlp.ServerAccess.AutoClose; 40 40 import net.sourceforge.jnlp.browsertesting.BrowserTest; 41 41 import net.sourceforge.jnlp.browsertesting.Browsers; … … 46 46 47 47 public class AppletTakesLastParamTests extends BrowserTest { 48 private void evaluate(ProcessResult pr) { 49 String firstParam = "value1"; 50 String secondParam = "value2"; 48 51 49 @Test 50 public void AppletTest() throws Exception { 51 ServerAccess.ProcessResult pr = server.executeJavaws(null, "/appletTakesLastParam.jnlp"); 52 evaluateApplet(pr); 53 } 54 55 private void evaluateApplet(ProcessResult pr) { 56 String s0 = "value1"; 57 Assert.assertTrue("AppletTakesLastParam stdout should not contain " + s0 + " but did.", !pr.stdout.contains(s0)); 58 String s1 = "value2"; 59 Assert.assertTrue("AppletTakesLastParam stdout should contain " + s1 + " but did not.", pr.stdout.contains(s1)); 52 Assert.assertFalse("AppletTakesLastParam stdout should not contain " + firstParam + " but did.", 53 pr.stdout.contains(firstParam)); 54 Assert.assertTrue("AppletTakesLastParam stdout should contain " + secondParam + " but did not.", 55 pr.stdout.contains(secondParam)); 60 56 } 61 57 62 58 @Test 63 59 @TestInBrowsers(testIn = {Browsers.one}) 64 public void AppletInFirefoxTest() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html"); 66 evaluateApplet(pr); 60 public void appletTakesLastParam() throws Exception { 61 ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html", AutoClose.CLOSE_ON_BOTH); 62 evaluate(pr); 63 } 64 @Test 65 public void jnlpTakesLastParam() throws Exception { 66 ProcessResult pr = server.executeJavaws("/appletTakesLastParam.jnlp"); 67 evaluate(pr); 67 68 } 68 69 } -
trunk/icedtea-web/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java
r418 r429 1 /* AppletTestTests.java1 /* 2 2 Copyright (C) 2011 Red Hat, Inc. 3 3 … … 36 36 */ 37 37 38 import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; 38 39 import net.sourceforge.jnlp.ProcessResult; 39 40 import net.sourceforge.jnlp.ServerAccess; … … 48 49 public class AppletTestTests extends BrowserTest { 49 50 51 private final String s7 = "Aplet killing himself after 2000 ms of life"; 52 private final String s2 = "value2"; 53 private final String s1 = "value1"; 54 private final String s0 = "applet was started"; 55 private final String s3 = "applet was initialised"; 56 57 private class CountingClosingListenerImpl extends CountingClosingListener { 58 59 @Override 60 protected boolean isAlowedToFinish(String s) { 61 return (s.contains(s0) && s.contains(s1) && s.contains(s2) && s.contains(s3) && s.contains(s7)); 62 } 63 } 64 50 65 @Test 51 66 @TestInBrowsers(testIn = {Browsers.googleChrome}) … … 56 71 //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); 57 72 //just verify loging is recording browser 58 ProcessResult pr1 = server.executeBrowser("/appletAutoTests .html");73 ProcessResult pr1 = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 59 74 if (pr1.process == null) { 60 75 Assert.assertTrue("If proces was null here, then google-chrome had to not exist, and so " … … 65 80 return; 66 81 } 67 evaluateApplet(pr1, false);82 evaluateApplet(pr1, false); 68 83 Assert.assertTrue(pr1.wasTerminated); 69 84 //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); 70 85 // just verify loging is recording browser 71 ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests.html");72 evaluateApplet(pr, false);86 ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 87 evaluateApplet(pr, false); 73 88 Assert.assertTrue(pr.wasTerminated); 74 89 } finally { … … 81 96 public void AppletTest() throws Exception { 82 97 ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp"); 83 evaluateApplet(pr, true);98 evaluateApplet(pr, true); 84 99 Assert.assertFalse(pr.wasTerminated); 85 100 Assert.assertEquals((Integer) 0, pr.returnValue); … … 87 102 88 103 private void evaluateApplet(ProcessResult pr, boolean javawsApplet) { 89 String s3 = "applet was initialised";90 104 Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); 91 String s0 = "applet was started";92 105 Assert.assertTrue("AppletTest stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s0)); 93 String s1 = "value1";94 106 Assert.assertTrue("AppletTest stdout should contains " + s1 + " bud didn't", pr.stdout.contains(s1)); 95 String s2 = "value2";96 107 Assert.assertTrue("AppletTest stdout should contains " + s2 + " bud didn't", pr.stdout.contains(s2)); 97 String ss = "xception";98 Assert.assertFalse("AppletTest stderr should not contains " + ss + " but did", pr.stderr.contains(ss));99 String s7 = "Aplet killing himself after 2000 ms of life";100 108 Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7)); 101 109 if (!javawsApplet) { 102 110 /*this is working correctly in most browser, but not in all. temporarily disabling 103 String s4 = "applet was stopped";104 Assert.assertTrue("AppletTest stdout should contains" + s4 + " bud did't", pr.stdout.contains(s4));105 String s5 = "applet will be destroyed";106 Assert.assertTrue("AppletTest stdout should contains" + s5 + " bud did't", pr.stdout.contains(s5));111 String s4 = "applet was stopped"; 112 Assert.assertTrue("AppletTest stdout should contain " + s4 + " bud did't", pr.stdout.contains(s4)); 113 String s5 = "applet will be destroyed"; 114 Assert.assertTrue("AppletTest stdout should contain " + s5 + " bud did't", pr.stdout.contains(s5)); 107 115 */ 108 116 } … … 117 125 ServerAccess.PROCESS_TIMEOUT = 30 * 1000; 118 126 try { 119 ProcessResult pr = server.executeBrowser("/appletAutoTests2.html" );120 evaluateApplet(pr, false);121 Assert.assertTrue(pr.wasTerminated);127 ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 128 evaluateApplet(pr, false); 129 //Assert.assertTrue(pr.wasTerminated); this checks asre evil 122 130 //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null 123 131 } finally { … … 133 141 ServerAccess.PROCESS_TIMEOUT = 30 * 1000; 134 142 try { 135 ProcessResult pr = server.executeBrowser("/appletAutoTests.html" );143 ProcessResult pr = server.executeBrowser("/appletAutoTests.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 136 144 pr.process.destroy(); 137 evaluateApplet(pr, false);145 evaluateApplet(pr, false); 138 146 Assert.assertTrue(pr.wasTerminated); 139 147 //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null … … 142 150 } 143 151 } 152 153 154 @Test 155 @TestInBrowsers(testIn = {Browsers.one}) 156 @NeedsDisplay 157 public void appletZeroWH() throws Exception { 158 ProcessResult pr = server.executeBrowser("/appletZeroWH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 159 evaluateApplet(pr, false); 160 } 161 162 @Test 163 @TestInBrowsers(testIn = {Browsers.one}) 164 @NeedsDisplay 165 public void appletZeroW() throws Exception { 166 ProcessResult pr = server.executeBrowser("/appletZeroW.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 167 evaluateApplet(pr, false); 168 } 169 170 @Test 171 @TestInBrowsers(testIn = {Browsers.one}) 172 @NeedsDisplay 173 public void appletZeroH() throws Exception { 174 ProcessResult pr = server.executeBrowser("/appletZeroH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); 175 evaluateApplet(pr, false); 176 } 144 177 } -
trunk/icedtea-web/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 40 39 41 import org.junit.Assert; 40 41 42 import org.junit.Test; 42 43 … … 47 48 @Test 48 49 public void CreateClassLoaderLunch1() throws Exception { 49 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp");50 ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp"); 50 51 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "createClassLoader" + ".*"; 51 52 Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); 52 53 String cc="ClassNotFoundException"; 53 54 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 54 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);55 55 Assert.assertFalse("CreateClassLoaderLunch1 should not be terminated, but was",pr.wasTerminated); 56 56 Assert.assertEquals((Integer) 0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java
r418 r429 36 36 */ 37 37 38 39 38 import java.util.Arrays; 40 39 import java.util.List; 41 40 41 import net.sourceforge.jnlp.ProcessResult; 42 42 import net.sourceforge.jnlp.ServerAccess; 43 43 import org.junit.Assert; … … 50 50 public void runTest(String jnlpName, String exception) throws Exception { 51 51 List<String> verbosed = Arrays.asList(new String[] { "-verbose" }); 52 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(verbosed, "/" + jnlpName + ".jnlp");52 ProcessResult pr=server.executeJavawsHeadless(verbosed, "/" + jnlpName + ".jnlp"); 53 53 String s1 = "Good simple javaws exapmle"; 54 54 Assert.assertFalse("test" + jnlpName + " stdout should not contain " + s1 + " but did.", pr.stdout.contains(s1)); -
trunk/icedtea-web/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java
r418 r429 63 63 Map<String, String> p = System.getenv(); 64 64 Set<Entry<String, String>> r = p.entrySet(); 65 List<Entry<String, String>> rr = new ArrayList (r);65 List<Entry<String, String>> rr = new ArrayList<Entry<String, String>>(r); 66 66 Collections.sort(rr, new Comparator<Entry<String, String>>() { 67 67 … … 94 94 String s = "LocalisedInformationElement launched"; 95 95 Assert.assertTrue(id + " stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); 96 //to strict?97 //String ss = "xception";98 //Assert.assertFalse(id + " stderr should not contains " + ss + " but did", pr.stderr.contains(ss));99 96 String locMatch = "(?s).*default locale: \\w{2}.*"; 100 97 Assert.assertTrue(id + " stdout should match " + locMatch + " bud didn't", pr.stdout.matches(locMatch)); -
trunk/icedtea-web/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java
r418 r429 36 36 */ 37 37 38 import java.util.Arrays; 39 import net.sourceforge.jnlp.ProcessResult; 38 40 import net.sourceforge.jnlp.ServerAccess; 39 41 import net.sourceforge.jnlp.annotations.Bug; 42 import net.sourceforge.jnlp.runtime.Translator; 43 40 44 import org.junit.Assert; 41 42 45 import org.junit.Test; 43 46 … … 50 53 private static final String twoMainException = "net.sourceforge.jnlp.ParseException: Invalid XML document syntax"; 51 54 52 private void assertManifestedJar1(String id, ServerAccess.ProcessResult q) {55 private void assertManifestedJar1(String id, ProcessResult q) { 53 56 String s = "Hello from ManifestedJar1"; 54 57 Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); 55 58 } 56 59 57 private void assertManifestedJar2(String id, ServerAccess.ProcessResult q) {60 private void assertManifestedJar2(String id, ProcessResult q) { 58 61 String s = "Hello from ManifestedJar2"; 59 62 Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); 60 63 } 61 64 62 private void assertNotManifestedJar1(String id, ServerAccess.ProcessResult q) {65 private void assertNotManifestedJar1(String id, ProcessResult q) { 63 66 String s = "Hello from ManifestedJar1"; 64 67 Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); 65 68 } 66 private void assertAppError(String id, ServerAccess.ProcessResult q) {69 private void assertAppError(String id, ProcessResult q) { 67 70 Assert.assertTrue(id + " stderr should contains `" + nonLunchableMessage + "`, but didnn't ", q.stderr.contains(nonLunchableMessage)); 68 71 } 69 72 70 private void assertNotManifestedJar2(String id, ServerAccess.ProcessResult q) {73 private void assertNotManifestedJar2(String id, ProcessResult q) { 71 74 String s = "Hello from ManifestedJar2"; 72 75 Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); 73 76 } 74 77 75 private void assertNotDead(String id, ServerAccess.ProcessResult pr) {78 private void assertNotDead(String id, ProcessResult pr) { 76 79 String cc = "ClassNotFoundException"; 77 80 Assert.assertFalse(id + " stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); … … 86 89 public void manifestedJar1nothing2nothingNoAppDesc() throws Exception { 87 90 String id = "ManifestedJar-1nothing2nothingNoAppDesc"; 88 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");91 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 89 92 assertManifestedJar1(id, pr); 90 93 assertNotDead(id, pr); … … 98 101 public void manifestedJar1noAppDesc() throws Exception { 99 102 String id = "ManifestedJar-1noAppDesc"; 100 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");103 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 101 104 assertManifestedJar1(id, pr); 102 105 assertNotDead(id, pr); … … 110 113 public void manifestedJar1mainNoAppDesc() throws Exception { 111 114 String id = "ManifestedJar-1mainNoAppDesc"; 112 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");115 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 113 116 assertManifestedJar1(id, pr); 114 117 assertNotDead(id, pr); … … 122 125 public void ManifestedJar1mainHaveAppDesc() throws Exception { 123 126 String id = "ManifestedJar-1mainHaveAppDesc"; 124 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");127 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 125 128 assertManifestedJar2(id, pr); 126 129 assertNotDead(id, pr); … … 134 137 public void ManifestedJar1main2nothingNoAppDesc() throws Exception { 135 138 String id = "ManifestedJar-1main2nothingNoAppDesc"; 136 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");139 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 137 140 assertManifestedJar2(id, pr); 138 141 assertNotDead(id, pr); … … 146 149 public void manifestedJar1main2nothingNoAppDesc() throws Exception { 147 150 String id = "ManifestedJar-1main2nothingNoAppDesc"; 148 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");151 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 149 152 assertManifestedJar2(id, pr); 150 153 assertNotDead(id, pr); … … 154 157 * 155 158 * Two jars, both with manifest, sboth with main tag, no app desc 156 * 157 * thisis passing, SUSPICIOUS, but to lunch at least something is better then to lunch nothing at all. 158 * althoug it maybe SHOULD throw twoMainException 159 * first jar is taken 160 * 159 161 */ 160 162 @Test 161 163 public void manifestedJar1main2mainNoAppDesc() throws Exception { 162 164 String id = "ManifestedJar-1main2mainNoAppDesc"; 163 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 164 assertManifestedJar1(id, pr); 165 assertNotDead(id, pr); 165 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 166 assertManifestedJar1(id, pr); 167 assertNotManifestedJar2(id, pr); 168 assertNotDead(id, pr); 169 } 170 171 /** 172 * 173 * Two jars, both with manifest, sboth with main tag, no app desc 174 * two main jars reported 175 * 176 */ 177 @Test 178 public void manifestedJar1main2mainNoAppDescStrict() throws Exception { 179 String id = "ManifestedJar-1main2mainNoAppDesc"; 180 ProcessResult pr = server.executeJavawsHeadless(Arrays.asList(new String[]{"-strict"}), "/" + id + ".jnlp"); 181 assertNotManifestedJar1(id, pr); 182 assertNotManifestedJar2(id, pr); 183 assertNotDead(id, pr); 184 Assert.assertTrue(pr.stderr.contains(Translator.R("PTwoMains")) || pr.stdout.contains(Translator.R("PTwoMains"))); 166 185 } 167 186 … … 175 194 public void manifestedJar1main2mainAppDesc() throws Exception { 176 195 String id = "ManifestedJar-1main2mainAppDesc"; 177 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");196 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 178 197 assertNotManifestedJar1(id, pr); 179 198 assertNotManifestedJar2(id, pr); … … 190 209 public void manifestedJar1noAppDescAtAll() throws Exception { 191 210 String id = "ManifestedJar-1noAppDescAtAll"; 192 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");211 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 193 212 assertNotManifestedJar1(id, pr); 194 213 assertNotManifestedJar2(id, pr); … … 209 228 public void manifestedJar1nothing2nothingAppDesc() throws Exception { 210 229 String id = "ManifestedJar-1nothing2nothingAppDesc"; 211 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");212 assert NotManifestedJar2(id, pr);230 ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); 231 assertManifestedJar2(id, pr); 213 232 assertNotManifestedJar1(id, pr); 214 233 assertNotDead(id, pr); -
trunk/icedtea-web/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import org.junit.Assert; 40 41 41 import org.junit.Test; 42 42 … … 47 47 @Test 48 48 public void ReadEnvironmentLunch1() throws Exception { 49 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp");49 ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp"); 50 50 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getenv.USER" + ".*"; 51 51 Assert.assertTrue("stderr should match"+s+"but didn't",pr.stderr.matches(s)); 52 52 String cc="ClassNotFoundException"; 53 53 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 54 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);55 54 Assert.assertFalse("ReadEnvironmentLunch1 should not be terminated, but was",pr.wasTerminated); 56 55 Assert.assertEquals((Integer) 0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java
r418 r429 36 36 */ 37 37 38 38 import net.sourceforge.jnlp.ProcessResult; 39 39 import net.sourceforge.jnlp.ServerAccess; 40 40 import org.junit.Assert; … … 48 48 @Test 49 49 public void ReadPropertiesLunch1() throws Exception { 50 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");50 ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); 51 51 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*"; 52 52 Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); 53 53 String cc="ClassNotFoundException"; 54 54 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 55 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);56 55 Assert.assertFalse("ReadPropertiesLunch1 should not be terminated, but was",pr.wasTerminated); 57 56 Assert.assertEquals((Integer)0, pr.returnValue); … … 60 59 @Test 61 60 public void ReadPropertiesLunch2() throws Exception { 62 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp");61 ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp"); 63 62 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.home.{0,5}read" + ".*"; 64 63 Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); 65 64 String cc="ClassNotFoundException"; 66 65 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 67 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);68 66 Assert.assertFalse("ReadPropertiesLunch2 should not be terminated, but was",pr.wasTerminated); 69 67 Assert.assertEquals((Integer)0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import org.junit.Assert; … … 46 47 @Test 47 48 public void RedirectStreamsTest1() throws Exception { 48 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp");49 ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp"); 49 50 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setIO" + ".*"; 50 51 Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); 51 52 String cc="ClassNotFoundException"; 52 53 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 53 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);54 54 Assert.assertFalse("RedirectStreams should not be terminated, but was",pr.wasTerminated); 55 55 Assert.assertEquals((Integer) 0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import org.junit.Assert; … … 46 47 @Test 47 48 public void ReplaceSecurityManagerLunch1() throws Exception { 48 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp");49 ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp"); 49 50 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setSecurityManager" + ".*"; 50 51 Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); 51 52 String cc="ClassNotFoundException"; 52 53 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 53 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);54 54 Assert.assertFalse("ReplaceSecurityManagerLunch1 should not be terminated, but was",pr.wasTerminated); 55 55 Assert.assertEquals((Integer) 0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 39 40 import org.junit.Assert; … … 46 47 @Test 47 48 public void SetContextClassLoader1() throws Exception { 48 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp");49 ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp"); 49 50 String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setContextClassLoader" + ".*"; 50 51 Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); 51 52 String cc="ClassNotFoundException"; 52 53 Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); 53 Assert.assertFalse("stdout length should be <=2, but was "+pr.stdout.length(),pr.stdout.length()>2);54 54 Assert.assertFalse("SetContextClassLoader1 should not be terminated, but was",pr.wasTerminated); 55 55 Assert.assertEquals((Integer) 0, pr.returnValue); -
trunk/icedtea-web/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java
r418 r429 37 37 38 38 import java.util.ArrayList; 39 import java.util.Arrays; 39 40 import java.util.List; 41 import net.sourceforge.jnlp.ContentReaderListener; 42 import net.sourceforge.jnlp.ProcessResult; 40 43 import net.sourceforge.jnlp.ServerAccess; 41 44 import net.sourceforge.jnlp.annotations.Bug; … … 44 47 import net.sourceforge.jnlp.browsertesting.Browsers; 45 48 import net.sourceforge.jnlp.annotations.TestInBrowsers; 49 import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; 46 50 import org.junit.Assert; 47 51 import org.junit.Test; … … 50 54 public class SpacesCanBeEverywhereTests extends BrowserTest { 51 55 52 56 public static final String s = "Spaces can be everywhere.jsr was launched correctly"; 53 57 @Bug(id="PR811") 54 58 @Test … … 82 86 * only on ocal files, and probably only from test run - it can be ignored 83 87 */ 84 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); 85 String s="Spaces can be everywhere.jsr was launched correctly"; 86 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 87 String cc = "xception"; 88 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 88 ProcessResult pr = ServerAccess.executeProcess(commands); 89 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 89 90 Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); 90 91 Assert.assertEquals((Integer) 0, pr.returnValue); … … 95 96 @NeedsDisplay 96 97 public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2() throws Exception { 97 ServerAccess.ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too.jnlp"); 98 String s="Spaces can be everywhere.jsr was launched correctly"; 99 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 100 String cc = "xception"; 101 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 102 Assert.assertFalse("should NOT be terminated, but was not", pr.wasTerminated); 98 ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too.jnlp"); 99 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 100 Assert.assertFalse("should NOT be terminated, but was", pr.wasTerminated); 103 101 } 104 102 … … 108 106 @TestInBrowsers(testIn = {Browsers.all}) 109 107 public void SpacesCanBeEverywhereRemoteAppletTestsHtml2() throws Exception { 110 ServerAccess.ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html"); 111 String s="Spaces can be everywhere.jsr was launched correctly"; 112 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 113 String cc = "xception"; 114 Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); 108 ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html", Arrays.asList(new ContentReaderListener[] {new StringBasedClosingListener(s)}), null); 109 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 115 110 Assert.assertTrue("should be terminated, but was not", pr.wasTerminated); 116 111 } … … 120 115 @Test 121 116 public void SpacesCanBeEverywhereRemoteTests1() throws Exception { 122 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1.jnlp");117 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1.jnlp"); 123 118 String s = "Good simple javaws exapmle"; 124 119 Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); … … 132 127 @Test 133 128 public void SpacesCanBeEverywhereRemoteTests2() throws Exception { 134 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp"); 135 String s="Spaces can be everywhere.jsr was launched correctly"; 129 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp"); 136 130 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 137 131 String cc = "ClassNotFoundException"; … … 144 138 @Test 145 139 public void SpacesCanBeEverywhereRemoteTests2_withQuery1() throws Exception { 146 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test=10"); 147 String s="Spaces can be everywhere.jsr was launched correctly"; 140 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test=10"); 148 141 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 149 142 String cc = "ClassNotFoundException"; … … 157 150 @Test 158 151 public void SpacesCanBeEverywhereRemoteTests2_withQuery2() throws Exception { 159 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test%3D10"); 160 String s="Spaces can be everywhere.jsr was launched correctly"; 152 ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test%3D10"); 161 153 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 162 154 String cc = "ClassNotFoundException"; … … 169 161 @Test 170 162 public void SpacesCanBeEverywhereRemoteTests3() throws Exception { 171 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1.jnlp"); 172 String s="Spaces can be everywhere.jsr was launched correctly"; 163 ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1.jnlp"); 173 164 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 174 165 String cc = "ClassNotFoundException"; … … 186 177 commands.add(ServerAccess.HEADLES_OPTION); 187 178 commands.add("Spaces can be everywhere1.jnlp"); 188 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());179 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 189 180 String s = "Good simple javaws exapmle"; 190 181 Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); … … 202 193 commands.add(ServerAccess.HEADLES_OPTION); 203 194 commands.add("Spaces can be everywhere2.jnlp"); 204 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 205 String s="Spaces can be everywhere.jsr was launched correctly"; 195 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 206 196 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 207 197 String cc = "ClassNotFoundException"; … … 218 208 commands.add(ServerAccess.HEADLES_OPTION); 219 209 commands.add(server.getDir()+"/Spaces can be everywhere2.jnlp"); 220 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands); 221 String s="Spaces can be everywhere.jsr was launched correctly"; 210 ProcessResult pr = ServerAccess.executeProcess(commands); 222 211 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 223 212 String cc = "ClassNotFoundException"; … … 234 223 commands.add(ServerAccess.HEADLES_OPTION); 235 224 commands.add("SpacesCanBeEverywhere1.jnlp"); 236 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 237 String s="Spaces can be everywhere.jsr was launched correctly"; 225 ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); 238 226 Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); 239 227 String cc = "ClassNotFoundException"; -
trunk/icedtea-web/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 43 import org.junit.Assert; … … 51 52 @Test 52 53 public void jnlpFileIsUnchecked1() throws Exception { 53 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp");54 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp"); 54 55 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 55 56 } … … 57 58 @Test 58 59 public void jnlpFileIsUnchecked2() throws Exception { 59 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp");60 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp"); 60 61 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 61 62 } … … 63 64 @Test 64 65 public void jnlpFileIsUnchecked3() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp");66 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp"); 66 67 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 67 68 } -
trunk/icedtea-web/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java
r418 r429 39 39 import java.util.Collections; 40 40 import java.util.List; 41 import net.sourceforge.jnlp.ProcessResult; 41 42 import net.sourceforge.jnlp.ServerAccess; 42 43 import org.junit.Assert; … … 51 52 @Test 52 53 public void jnlpTemplateIsUnchecked1() throws Exception { 53 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp");54 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp"); 54 55 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 55 56 } … … 57 58 @Test 58 59 public void jnlpTemplateIsUnchecked2() throws Exception { 59 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp");60 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp"); 60 61 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 61 62 } … … 63 64 @Test 64 65 public void jnlpTemplateIsUnchecked3() throws Exception { 65 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp");66 ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp"); 66 67 Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); 67 68 } -
trunk/icedtea-web/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java
r418 r429 37 37 38 38 import java.util.ArrayList; 39 import net.sourceforge.jnlp.ProcessResult; 39 40 import net.sourceforge.jnlp.ServerAccess; 40 import net.sourceforge.jnlp.ServerAccess.ProcessResult;41 41 import org.junit.Assert; 42 42 import java.util.Arrays; … … 81 81 List<String> before = countJavaInstances(); 82 82 ServerAccess.logOutputReprint("java1 " + jnlp + " : " + before.size()); 83 ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, jnlp);83 ProcessResult pr = server.executeJavawsHeadless(null, jnlp); 84 84 assertDeadlockTestLaunched(pr); 85 85 List<String> after = countJavaInstances(); … … 168 168 ServerAccess.PROCESS_LOG = false; 169 169 try { 170 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"kill", "-9", string}));170 ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"kill", "-9", string})); 171 171 } finally { 172 172 ServerAccess.PROCESS_LOG = true; … … 183 183 ServerAccess.PROCESS_LOG = false; 184 184 try { 185 ServerAccess.ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"ps", "-eo", "pid,ppid,stat,fname"}));185 ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"ps", "-eo", "pid,ppid,stat,fname"})); 186 186 Matcher m = Pattern.compile("\\s*\\d+\\s+\\d+ .+ java\\s*").matcher(pr.stdout); 187 187 int i = 0; … … 206 206 String s = "Deadlock test started"; 207 207 Assert.assertTrue("Deadlock test should print out " + s + ", but did not", pr.stdout.contains(s)); 208 String ss = "xception";209 Assert.assertFalse("Deadlock test should not stderr " + ss + " but did", pr.stderr.contains(ss));210 208 //each 3500 seconds deadlock test stdout something 211 209 //timeout is 20s -
trunk/icedtea-web/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java
r418 r429 40 40 public static void main(String[] args){ 41 41 System.out.println("Good simple javaws exapmle"); 42 for (int i = 0; i < args.length; i++) { 43 String string = args[i]; 44 System.out.println(string); 45 46 } 42 47 } 43 48 } -
trunk/icedtea-web/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java
r418 r429 36 36 */ 37 37 38 38 import java.io.File; 39 import java.io.FileInputStream; 40 import java.io.IOException; 41 import java.net.MalformedURLException; 42 import java.net.URL; 43 import java.util.Arrays; 44 import java.util.List; 45 import net.sourceforge.jnlp.ProcessResult; 39 46 import net.sourceforge.jnlp.ServerAccess; 40 47 import org.junit.Assert; … … 45 52 46 53 private static ServerAccess server = new ServerAccess(); 54 private static final List<String> strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION}); 47 55 48 56 private void checkLaunched(ProcessResult pr) { 57 checkLaunched(pr, false); 58 } 59 60 private void checkLaunched(ProcessResult pr, boolean negate) { 61 String s = "Good simple javaws exapmle"; 62 if (negate) { 63 Assert.assertFalse("testSimpletest1lunchOk stdout should NOT contains " + s + " bud did", pr.stdout.contains(s)); 64 } else { 65 Assert.assertTrue("testSimpletest1lunchOk stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); 66 } 67 String ss = "xception"; 68 if (negate) { 69 Assert.assertTrue("testSimpletest1lunchOk stderr should contains " + ss + " but didn't", pr.stderr.contains(ss)); 70 } else { 71 //disabled, unnecessary exceptions may occure 72 //Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); 73 } 74 Assert.assertFalse(pr.wasTerminated); 75 Assert.assertEquals((Integer) 0, pr.returnValue); 76 } 49 77 50 78 @Test 51 79 public void testSimpletest1lunchOk() throws Exception { 52 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest1.jnlp"); 53 String s="Good simple javaws exapmle"; 54 Assert.assertTrue("testSimpletest1lunchOk stdout should contains "+s+" bud didn't",pr.stdout.contains(s)); 55 String ss="xception"; 56 Assert.assertFalse("testSimpletest1lunchOk stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); 57 Assert.assertFalse(pr.wasTerminated); 58 Assert.assertEquals((Integer)0, pr.returnValue); 80 ProcessResult pr = server.executeJavawsHeadless(null, "/simpletest1.jnlp"); 81 checkLaunched(pr); 59 82 } 60 83 61 } 84 @Test 85 public void testSimpletest1lunchNotOkJnlpStrict() throws Exception { 86 ProcessResult pr = server.executeJavawsHeadless(strict, "/simpletest1.jnlp"); 87 checkLaunched(pr, true); 88 } 89 90 @Test 91 public void testSimpletest1lunchOkStrictJnlp() throws Exception { 92 String originalResourceName = "simpletest1.jnlp"; 93 String newResourceName = "simpletest1_strict.jnlp"; 94 createStrictFile(originalResourceName, newResourceName, server.getUrl("")); 95 ProcessResult pr = server.executeJavawsHeadless(null, "/" + newResourceName); 96 checkLaunched(pr); 97 } 98 99 @Test 100 public void testSimpletest1lunchOkStrictJnlpStrict() throws Exception { 101 String originalResourceName = "simpletest1.jnlp"; 102 String newResourceName = "simpletest1_strict.jnlp"; 103 createStrictFile(originalResourceName, newResourceName, server.getUrl("")); 104 ProcessResult pr = server.executeJavawsHeadless(strict, "/" + newResourceName); 105 checkLaunched(pr); 106 } 107 108 private void createStrictFile(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException { 109 String originalContent = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), originalResourceName))); 110 String nwContent1 = originalContent.replaceAll("href=\""+originalResourceName+"\"", "href=\""+newResourceName+"\""); 111 String nwContent = nwContent1.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\""); 112 ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName)); 113 } 114 } -
trunk/icedtea-web/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java
r418 r429 1 2 import java.applet.Applet; 3 1 4 /* SimpleTest2.java 2 5 Copyright (C) 2011 Red Hat, Inc. … … 36 39 */ 37 40 38 public class SimpleTest2 {41 public class SimpleTest2 extends Applet{ 39 42 40 public static void main(String[] args){ 41 throw new RuntimeException("Correct exception"); 43 public static void main(String[] args) { 44 throw new RuntimeException("Correct exception"); 45 } 42 46 47 @Override 48 public void init() { 49 System.out.println("applet was initialised"); 43 50 } 51 52 @Override 53 public void start() { 54 System.out.println("applet was started"); 55 main(null); 56 } 57 58 @Override 59 public void stop() { 60 System.out.println("applet was stopped"); 61 } 62 63 @Override 64 public void destroy() { 65 System.out.println("applet will be destroyed"); 66 } 67 44 68 } -
trunk/icedtea-web/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java
r418 r429 36 36 */ 37 37 38 import net.sourceforge.jnlp.ProcessResult; 38 39 import net.sourceforge.jnlp.ServerAccess; 40 39 41 import org.junit.Assert; 40 41 42 import org.junit.Test; 42 43 … … 48 49 @Test 49 50 public void testSimpletest2lunchException() throws Exception { 50 ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest2.jnlp"); 51 Assert.assertTrue("stdout should be < 1 , but was "+pr.stdout.trim().length(),pr.stdout.trim().length() < 1); 51 ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest2.jnlp"); 52 52 String s="Correct exception"; 53 53 Assert.assertTrue("stderr should contains "+s+" but didn't",pr.stderr.contains(s)); … … 55 55 Assert.assertTrue("stderr should contains "+ss+" but did not",pr.stderr.contains(ss)); 56 56 Assert.assertFalse("testSimpletest2lunchException should not be terminated, but was",pr.wasTerminated); 57 //Assert.assertFalse(0==pr.returnValue);exception and still returned 0?58 57 } 59 58
Note:
See TracChangeset
for help on using the changeset viewer.