- Timestamp:
- Sep 24, 2014, 9:34:21 PM (11 years ago)
- Location:
- trunk/icedtea-web/tests/reproducers/simple/AppletBaseURLTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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");
Note:
See TracChangeset
for help on using the changeset viewer.