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/signed/AppletTestSigned
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html

    r418 r429  
    3838<html><head></head><body bgcolor="red">
    3939<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">
    4141    <param name="key1" value="value1">
    4242    <param name="key2" value="#value2">
  • trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java

    r418 r429  
    4949                Thread.sleep(n);
    5050                System.out.println("AppletTestSigned killing himself after " + n + " ms of life");
     51                System.out.println("*** APPLET FINISHED ***");
    5152                System.exit(0);
    5253            } catch (Exception ex) {
  • trunk/icedtea-web/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java

    r418 r429  
    4444import net.sourceforge.jnlp.browsertesting.Browsers;
    4545import net.sourceforge.jnlp.annotations.TestInBrowsers;
     46import net.sourceforge.jnlp.closinglisteners.Rule;
     47import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
     48import static net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener.*;
    4649import org.junit.Assert;
    4750
     
    5154
    5255    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);
    5367
    54     @Test
     68   // @Test
    5569    public void AppletTestSignedTest() throws Exception {
    5670        ProcessResult pr = server.executeJavawsHeadless(l, "/AppletTestSigned.jnlp");
     
    6175
    6276    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));
    7582        if (!javawsApplet) {
    7683            /*this is working correctly in most browser, but not in all. temporarily disabling
     
    8592    @Test
    8693    @TestInBrowsers(testIn = {Browsers.all})
    87     public void AppletTestSignedFirefoxTest() throws Exception {
     94    public void AppletTestSignedFirefoxTestXslowX() throws Exception {
    8895        ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
    8996        try {
    90             ProcessResult pr = server.executeBrowser("/AppletTestSigned.html");
     97            ProcessResult pr = server.executeBrowser("/AppletTestSigned2.html", okListener, null);
    9198            evaluateSignedApplet(pr, false);
    92             Assert.assertTrue(pr.wasTerminated);
     99            //Assert.assertTrue(pr.wasTerminated);
    93100            //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
    94101        } finally {
     
    96103        }
    97104    }
     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    }
    98114}
Note: See TracChangeset for help on using the changeset viewer.