Ignore:
Timestamp:
Sep 24, 2014, 9:34:21 PM (11 years ago)
Author:
dmik
Message:

icedtea-web: Merge version 1.5.1 from vendor to trunk.

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  
    3838import java.applet.Applet;
    3939public class AppletBaseURL extends Applet {
    40 
    41     private class Killer extends Thread {
    42 
    43         public int n = 1000;
    44 
    45         @Override
    46         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 
    5740    @Override
    5841    public void init() {
    5942        System.out.println("Document base is " + getDocumentBase() + " for this applet");
    6043        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);
    6348    }
    6449}
  • trunk/icedtea-web/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java

    r418 r429  
    3636 */
    3737
    38 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     38import net.sourceforge.jnlp.ProcessResult;
     39import net.sourceforge.jnlp.ServerAccess.AutoClose;
    3940import net.sourceforge.jnlp.annotations.Bug;
    4041import net.sourceforge.jnlp.annotations.NeedsDisplay;
     
    4950
    5051    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));
    5758    }
    5859
     
    6061    @Test
    6162    public void AppletWebstartBaseURLTest() throws Exception {
    62         ProcessResult pr = server.executeJavaws(null, "/AppletBaseURLTest.jnlp");
     63        ProcessResult pr = server.executeJavaws("/AppletBaseURLTest.jnlp");
    6364        evaluateApplet(pr, "");
    6465        Assert.assertFalse(pr.wasTerminated);
     
    7172    @TestInBrowsers(testIn={Browsers.one})
    7273    public void AppletInFirefoxTest() throws Exception {
    73         ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html");
     74        ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html", AutoClose.CLOSE_ON_BOTH);
    7475        pr.process.destroy();
    7576        evaluateApplet(pr, "AppletBaseURLTest.html");
     
    8283    @TestInBrowsers(testIn={Browsers.one})
    8384    public void AppletWithJNLPHrefTest() throws Exception {
    84         ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html");
     85        ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html", AutoClose.CLOSE_ON_BOTH);
    8586        pr.process.destroy();
    8687        evaluateApplet(pr, "AppletJNLPHrefBaseURLTest.html");
Note: See TracChangeset for help on using the changeset viewer.