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
Files:
2 deleted
52 edited
78 copied

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile

    r418 r429  
    11TESTNAME=AppletFolderInArchiveTag
    22ARCHIVE_TEST_FOLDER=archive_tag_folder_test
    3 JAVAC_CLASSPATH=$(JNLP_TESTS_ENGINE_DIR):$(NETX_DIR)/lib/classes.jar
    4 DEPLOY_SUBDIR=$(JNLP_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER)
     3JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar
     4DEPLOY_SUBDIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER)
    55INDEX_HTML_BODY="<html><body><h1>Required to recognize folder structure</h1></body></html>"
    66
  • trunk/icedtea-web/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java

    r418 r429  
    3636 */
    3737
    38 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     38import net.sourceforge.jnlp.ProcessResult;
    3939import net.sourceforge.jnlp.annotations.Bug;
    4040import net.sourceforge.jnlp.annotations.NeedsDisplay;
  • trunk/icedtea-web/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile

    r418 r429  
    11TESTNAME=UnsignedContentInMETAINF
    2 JAVAC_CLASSPATH=$(JNLP_TESTS_ENGINE_DIR):$(NETX_DIR)/lib/classes.jar
    3 DEPLOY_DIR=$(JNLP_TESTS_SERVER_DEPLOYDIR)
     2JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar
     3DEPLOY_DIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)
    44JAVAC=$(BOOT_DIR)/bin/javac
    55JAR=$(BOOT_DIR)/bin/jar
    6 ABS_SRC_PATH=$(JNLP_TESTS_SRCDIR)/custom/$(TESTNAME)/srcs
     6ABS_SRC_PATH=$(REPRODUCERS_TESTS_SRCDIR)/custom/$(TESTNAME)/srcs
    77
    88prepare-reproducer:
  • 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}
  • trunk/icedtea-web/tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java

    r418 r429  
    4545import java.util.Arrays;
    4646import java.util.List;
     47import java.util.PropertyResourceBundle;
    4748import java.util.regex.Matcher;
    4849import java.util.regex.Pattern;
    4950import net.sourceforge.jnlp.ServerAccess;
    50 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     51import net.sourceforge.jnlp.ProcessResult;
    5152import net.sourceforge.jnlp.annotations.KnownToFail;
     53import net.sourceforge.jnlp.config.Defaults;
     54import net.sourceforge.jnlp.tools.MessageProperties;
    5255import org.junit.AfterClass;
    5356import org.junit.Assert;
     
    6164    private static final List<String> trustedVerboses = Arrays.asList(new String[]{"-Xtrustall", ServerAccess.HEADLES_OPTION,"-verbose"});
    6265    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
    7067    private static final String lre = "LruCacheException";
    7168    private static final String ioobe = "IndexOutOfBoundsException";
     
    7471    private static final String corruptString = "156dsf1562kd5";
    7572
    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";
    8186
    8287    @Test
     
    9499    }
    95100
    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    }
    110114
    111115    @Test
     
    261265            public void run() {
    262266                try {
    263                     ServerAccess.ProcessResult pr = server.executeJavawsHeadless(verbosed, "/deadlocktest.jnlp");
     267                    ProcessResult pr = server.executeJavawsHeadless(verbosed, "/deadlocktest.jnlp");
    264268                } catch (Exception ex) {
    265269                    throw new RuntimeException(ex);
     
    270274        Thread.sleep(1000);
    271275        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
    278282    //next four tests are designed to ensure, that corrupted cache will not break already loaded cached files
    279283    public static final String CR1 = "CacheReproducer1";
     
    338342            if (netxLock.isFile()) {
    339343                boolean b = netxLock.delete();
    340                 junit.framework.Assert.assertTrue(b);
     344                Assert.assertTrue(b);
    341345            }
    342346
     
    378382        }
    379383        String sb = breakOne(s, 0);
    380         junit.framework.Assert.assertEquals(s, sb);
     384        Assert.assertEquals(s, sb);
    381385        for (int x = 1; x <= 3; x++) {
    382386            String[] sx = breakOne(s, x).split("\n");
     
    427431
    428432    private static String breakPaths(String s) {
    429        return s.replaceAll(home+".*", "/ho");
     433       return s.replaceAll(System.getProperty("user.home") + ".*", "/ho");
    430434    }
    431435
     
    448452    }
    449453
    450     private static ServerAccess.ProcessResult runSimpleTest1() throws Exception {
     454    private static ProcessResult runSimpleTest1() throws Exception {
    451455        return runSimpleTest1(verbosed, "simpletest1");
    452456    }
    453457
    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");
    456460        return pr2;
    457461    }
    458462
    459     private static ServerAccess.ProcessResult runSimpleTest1Signed() throws Exception {
     463    private static ProcessResult runSimpleTest1Signed() throws Exception {
    460464        return runSimpleTestSigned("SimpletestSigned1");
    461465    }
    462466
    463     private static ServerAccess.ProcessResult runSimpleTestSigned(String id) throws Exception {
     467    private static ProcessResult runSimpleTestSigned(String id) throws Exception {
    464468        return runSimpleTest1(trustedVerboses, id);
    465469    }
    466470
    467     private static void evaluateSimpleTest1OkCache(ServerAccess.ProcessResult pr2) throws Exception {
     471    private static void evaluateSimpleTest1OkCache(ProcessResult pr2) throws Exception {
    468472        String s = "Good simple javaws exapmle";
    469473        Assert.assertTrue("test stdout should contain " + s + " but didn't", pr2.stdout.contains(s));
     
    473477
    474478    private static ProcessResult tryToClearcache() throws Exception {
    475         ServerAccess.ProcessResult pr1 = ServerAccess.executeProcess(clear);
     479        ProcessResult pr1 = ServerAccess.executeProcess(clear);
    476480        return pr1;
    477481    }
  • trunk/icedtea-web/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java

    r418 r429  
    3939import java.util.List;
    4040
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    42 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
    43 import net.sourceforge.jnlp.annotations.Bug;
    4443import net.sourceforge.jnlp.annotations.KnownToFail;
    4544import net.sourceforge.jnlp.annotations.NeedsDisplay;
     
    5150import org.junit.Test;
    5251
    53 @Bug(id = "PR975")
    5452public class ClasspathManifestTest extends BrowserTest {
    5553
     
    7977        commands.add(ServerAccess.HEADLES_OPTION);
    8078        commands.add("ClasspathManifestApplicationTest.jnlp");
    81         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
     79        ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
    8280        checkAppFails(pr, "ApplicationJNLPLocalTest");
    8381    }
     
    8684    @Test
    8785    public void AppletJNLPRemoteTest() throws Exception {
    88         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp");
     86        ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp");
    8987        checkAppFails(pr, "AppletJNLPRemoteTest");
    9088    }
     
    9896        commands.add(ServerAccess.HEADLES_OPTION);
    9997        commands.add("ClasspathManifestAppletTest.jnlp");
    100         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
     98        ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
    10199        checkAppFails(pr, "AppletJNLPRLocalTest");
    102100    }
     
    106104    @Test
    107105    public void BrowserJNLPHrefRemoteTest() throws Exception {
    108         ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html");
     106        ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html");
    109107        checkAppFails(pr, "BrowserJNLPHrefRemoteTest");
    110108    }
     
    118116        commands.add(server.getBrowserLocation());
    119117        commands.add("ClasspathManifestJNLPHrefTest.html");
    120         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
     118        ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir());
    121119        checkAppFails(pr, "BrowserJNLPHrefLocalTest");
    122120    }
     
    126124    @Test
    127125    public void BrowserAppletRemoteTest() throws Exception {
    128         ServerAccess.ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html");
     126        ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html");
    129127        Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1));
    130128        // Should be the only one to search manifest for classpath.
    131129        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));
    133130    }
    134131}
  • trunk/icedtea-web/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java

    r418 r429  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    4243import net.sourceforge.jnlp.annotations.Bug;
     
    5657    @Test
    5758    public void checkingForRequiredResources() throws Exception {
    58         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp");
     59        ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp");
    5960        Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(jarOutput));
    6061
     
    6768    @Test
    6869    public void usingSignedExtension() throws Exception {
    69         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp");
     70        ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp");
    7071        Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput));
    7172    }
     
    7475    @Test
    7576    public void mainJarInExtension() throws Exception {
    76         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp");
     77        ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp");
    7778        Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput));
    7879    }
     
    8182    @Test
    8283    public void checkingSignedJnlpInExtension() throws Exception {
    83         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp");
     84        ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp");
    8485        Assert.assertTrue("Stdout should contain " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException));
    8586    }
  • trunk/icedtea-web/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java

    r418 r429  
    4040import java.util.Collections;
    4141import java.util.List;
     42import net.sourceforge.jnlp.ProcessResult;
    4243import net.sourceforge.jnlp.ServerAccess;
    43 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
    4444import net.sourceforge.jnlp.annotations.Bug;
    4545import net.sourceforge.jnlp.annotations.NeedsDisplay;
     
    7979    @Bug(id = {"RH816592","PR858"})
    8080    public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplication() throws Exception {
    81         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp");
     81        ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp");
    8282        evaluate(pr);
    8383        Assert.assertFalse("should not be terminated but was", pr.wasTerminated);
     
    8888        String ss = "Good simple javaws exapmle";
    8989        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));
    9290    }
    9391
     
    9593    @Bug(id = {"RH816592","PR858"})
    9694    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");
    9896        evaluate(pr);
    9997        Assert.assertFalse("should not be terminated but was", pr.wasTerminated);
     
    106104    @TestInBrowsers(testIn={Browsers.all})
    107105    public void launchInternalClassloaderWithDownloadedResourceAsHtmlApplet() throws Exception {
    108         ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html");
     106        ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html");
    109107        evaluate(pr);
    110108        Assert.assertTrue("should be terminated but was not", pr.wasTerminated);
     
    114112    @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"})
    115113    public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplicationHack() throws Exception {
    116         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp");
     114        ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp");
    117115        evaluate(pr);
    118116        Assert.assertFalse("should not be terminated but was", pr.wasTerminated);
     
    123121    @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"})
    124122    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");
    126124        evaluate(pr);
    127125        Assert.assertFalse("should not be terminated but was", pr.wasTerminated);
     
    134132    @TestInBrowsers(testIn={Browsers.all})
    135133    public void launchInternalClassloaderWithDownloadedResourceAsHtmlAppletHack() throws Exception {
    136         ServerAccess.ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html");
     134        ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html");
    137135        evaluate(pr);
    138136        Assert.assertTrue("should be terminated but was not", pr.wasTerminated);
  • trunk/icedtea-web/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java

    r418 r429  
    1 /* MissingJar.java
     1/* MissingJarTest.java
    22Copyright (C) 2011 Red Hat, Inc.
    33
     
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    42 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     43
    4344import org.junit.Assert;
    44 
    4545import org.junit.Test;
    4646
     
    6161    @Test
    6262    public void MissingJarTest1() throws Exception {
    63         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp");
     63        ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp");
    6464        evaluateResult(pr);
    6565    }
     
    6767    @Test
    6868    public void MissingJarTest2() throws Exception {
    69         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp");
     69        ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp");
    7070        evaluateResult(pr);
    7171    }
     
    7373    @Test
    7474    public void MissingJarTest3() throws Exception {
    75         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp");
     75        ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp");
    7676        evaluateResult(pr);
    7777    }
     
    7979    @Test
    8080    public void MissingJarTest4() throws Exception {
    81         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp");
     81        ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp");
    8282        evaluateResult(pr);
    8383    }
  • trunk/icedtea-web/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java

    r418 r429  
    1 /* ReadPropertiesSignedTest.java
     1/* ReadPropertiesBySignedHackTest.java
    22Copyright (C) 2011 Red Hat, Inc.
    33
     
    3636 */
    3737
    38 
    3938import java.util.Arrays;
    4039import java.util.Collections;
    4140import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4242import net.sourceforge.jnlp.ServerAccess;
     43
    4344import org.junit.Assert;
    4445import org.junit.Test;
     
    5354    public void ReadPropertiesBySignedHackWithjoutXtrustAll() throws Exception {
    5455        //no request for permissions
    55         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp");
     56        ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp");
    5657        String s="java.lang.SecurityException: class \"ReadProperties\"'s signer information does not match signer information of other classes in the same package";
    5758        Assert.assertTrue("Stderr should contains "+s+" but did not",pr.stderr.contains(s));
    5859        String ss="ClassNotFoundException";
    5960        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 :(
    6161        Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
    6262        Assert.assertEquals((Integer)0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java

    r418 r429  
    3636 */
    3737
    38 
    3938import java.util.Arrays;
    4039import java.util.Collections;
    4140import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4242import net.sourceforge.jnlp.ServerAccess;
     43
    4344import org.junit.Assert;
    4445import org.junit.Test;
     
    5455    public void ReadSignedPropertiesWithoutPermissionsWithXtrustAll() throws Exception {
    5556        //no request for permissions
    56         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp");
     57        ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp");
    5758        Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher));
    5859        String ss="ClassNotFoundException";
    5960        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 :(
    6161        Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
    6262        Assert.assertEquals((Integer)0, pr.returnValue);
     
    6666    public void ReadSignedPropertiesWithPermissionsWithXtrustAll() throws Exception {
    6767        //request for allpermissions
    68         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp");
     68        ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp");
    6969        Assert.assertFalse("Stderr should NOT match "+accessMatcher+" but did",pr.stderr.matches(accessMatcher));
    7070        String ss="ClassNotFoundException";
    7171        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 :(
    7372        Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
    7473        Assert.assertEquals((Integer)0, pr.returnValue);
     
    7776    @Test
    7877    public void EnsureXtrustallNotAffectingUnsignedBehaviour() throws Exception {
    79         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp");
     78        ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp");
    8079        Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher));
    8180        String ss="ClassNotFoundException";
    8281        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);
    8482        Assert.assertFalse("should not be terminated but was",pr.wasTerminated);
    8583        Assert.assertEquals((Integer)0, pr.returnValue);
    86         ServerAccess.ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
     84        ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
    8785        Assert.assertEquals(pr.stderr, pr2.stderr);
    8886        Assert.assertEquals(pr.stdout, pr2.stdout);
    89 
    9087    }
    9188  }
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html

    r418 r429  
    3838 
    3939<!-- Uses show-document to go to a page that clears the cookie -->
    40  
     40
    4141<html><head></head><body bgcolor="red">
    4242<p>
    4343  <applet code="CheckingCookies.class" archive="SavingCookies.jar" codebase="." width="100" height="100">
    44  
     44
    4545  <param name="show-document" value="ClearPersistentCookie.html">
    46  
     46
    4747  </applet>
    4848</p>
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html

    r418 r429  
    4141
    4242  <param name="persistent" value="no">
    43  
     43
    4444  <param name="cookie" value="TEST=deleted; Expires=Thu, 01 Jan 1970 00:00:01 GMT">
    4545
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html

    r418 r429  
    4141
    4242  <param name="persistent" value="yes">
    43  
     43
    4444  <param name="cookie" value="TEST=persistent">
    45  
     45
    4646  </applet>
    4747</p>
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html

    r418 r429  
    4242  <param name="show-document" value="CheckCookieAndGotoClear.html">
    4343  <param name="persistent" value="yes">
    44  
     44
    4545  <param name="cookie" value="TEST=persistent">
    4646
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html

    r418 r429  
    4141
    4242  <param name="persistent" value="no">
    43  
     43
    4444  <param name="cookie" value="TEST=session">
    4545
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java

    r418 r429  
    11/* SavingCookies.java
    22 Store cookies in the java cookie store, and go to a page that confirms they are there.
    3  
     3
    44Copyright (C) 2012 Red Hat, Inc.
    55
  • trunk/icedtea-web/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java

    r418 r429  
    5151
    5252public class SavingCookiesTests extends BrowserTest {
    53    
     53
    5454    static final String ENTERING_CHECK = "Entered CheckingCookies";
    5555    static final String CHECKING_COMPLETION = "Finished CheckingCookies";
     
    8686                };
    8787                if (url.endsWith(".html")) {
    88                     pr = server.executeBrowser(url, stdoutListener, stdoutListener);
     88                    pr = server.executeBrowser(url, stdoutListener, null);
    8989                } else if (url.endsWith(".jnlp")) {
    90                     pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, stdoutListener);
     90                    pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, null, null);
    9191                }
    9292            } catch (Exception ex) {
     
    106106        final String COOKIE_SANITY_CHECK = "Found cookie: TEST=";
    107107        ProcessResult pr = server.executeBrowser("/CheckCookie.html");
    108        
     108
    109109        Assert.assertFalse("stdout should NOT contain '" + COOKIE_SANITY_CHECK + "' but did.", pr.stdout.contains(COOKIE_SANITY_CHECK));
    110110        Assert.assertTrue("stdout should contain '" + CHECKING_COMPLETION + "' but did not.", pr.stdout.contains(CHECKING_COMPLETION));
    111111    }
    112    
     112
    113113    @Test
    114114    @TestInBrowsers(testIn = { Browsers.one })
     
    130130            Thread.sleep(100);
    131131        }
    132        
     132
    133133        ProcessResult check = server.executeBrowser("/CheckCookie.html");
    134134        save.join();
    135        
     135
    136136        Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", save.pr.stdout.contains(ENTERING_CHECK));
    137137        //XXX: It is necessary to check save.pr's stdout, because it does not show up in 'check.stdout' for some reason
     
    155155    public void AppletPersistentCookieShowDoc() throws Exception {
    156156        ProcessResult pr = server.executeBrowser("/SavePersistentCookieAndGotoCheck.html");
    157        
     157
    158158        Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", pr.stdout.contains(ENTERING_CHECK));
    159159        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  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
     43
    4244import org.junit.Assert;
    4345import org.junit.Test;
     
    5355    @Test
    5456    public void launchingFileMatchesSignedApplication1() throws Exception {
    55         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp");
     57        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp");
    5658        String s = "Running signed application in main";
    5759        Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s));
     
    6365    @Test
    6466    public void launchingFileDoesNotMatchSignedApplication1() throws Exception {
    65         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp");
     67        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp");
    6668        Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException));
    6769    }
     
    7274    @Test
    7375    public void launchingFileDoesNotMatchSignedApplication2() throws Exception {
    74         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp");
     76        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp");
    7577        Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException));
    7678    }
  • trunk/icedtea-web/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java

    r418 r429  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
     43
    4244import org.junit.Assert;
    4345import org.junit.Test;
     
    5052    @Test
    5153    public void launchingFileMatchesSigned() throws Exception {
    52         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp");
     54        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp");
    5355        String s = "Running signed application in main";
    5456        Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s));
     
    5759    @Test
    5860    public void launchingFileDoesNotMatchSigned() throws Exception {
    59         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp");
     61        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp");
    6062        String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " +
    6163                "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  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    4243import org.junit.Assert;
     
    5051    @Test
    5152    public void launchingFileMatchesSigned() throws Exception {
    52         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp");
     53        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp");
    5354        String s = "Running signed application in main";
    5455        Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s));
     
    5758    @Test
    5859    public void launchingFileDoesNotMatchSigned() throws Exception {
    59         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp");
     60        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp");
    6061        String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " +
    6162                "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  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
     43
    4244import org.junit.Assert;
    4345import org.junit.Test;
     
    5355    @Test
    5456    public void launchingFileMatchesSignedTemplate1() throws Exception {
    55         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp");
     57        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp");
    5658        String s = "Running signed application in main";
    5759        Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s));
     
    6365    @Test
    6466    public void launchingFileDoesNotMatchSignedTemplate2() throws Exception {
    65         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp");
     67        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp");
    6668        Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException));
    6769    }
     
    7274    @Test
    7375    public void launchingFileDoesNotMatchSignedTemplate3() throws Exception {
    74         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp");
     76        ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp");
    7577        Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException));
    7678    }
  • trunk/icedtea-web/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java

    r418 r429  
    3838import java.util.ArrayList;
    3939import java.util.List;
     40import net.sourceforge.jnlp.ProcessResult;
    4041import net.sourceforge.jnlp.ServerAccess;
    4142import net.sourceforge.jnlp.annotations.Bug;
     
    4445import net.sourceforge.jnlp.browsertesting.Browsers;
    4546import net.sourceforge.jnlp.annotations.TestInBrowsers;
     47
    4648import org.junit.Assert;
    47 
    4849import org.junit.Test;
    4950
    5051@Bug(id={"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016127.html","PR804","PR811"})
    5152public class SpacesCanBeEverywhereTestsSigned extends BrowserTest {
    52 
    5353
    5454    @Bug(id="PR811")
     
    8383         * only on ocal files, and probably only from test run - it can be ignored
    8484         */
    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));
    9088        Assert.assertFalse("should not be terminated, but was", pr.wasTerminated);
    9189        Assert.assertEquals((Integer) 0, pr.returnValue);
     
    9694    @NeedsDisplay
    9795    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));
    10399        Assert.assertFalse("should NOT be terminated, but was not", pr.wasTerminated);
    104100    }
     
    109105    @TestInBrowsers(testIn = {Browsers.one})
    110106    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));
    116110        Assert.assertTrue("should be terminated, but was not", pr.wasTerminated);
    117111    }
     
    121115    @Test
    122116    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");
    124118        String s = "Good simple javaws exapmle";
    125119        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
     
    133127    @Test
    134128    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");
    136130        String s="Signed spaces can be everywhere.jsr was launched correctly";
    137131        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
     
    145139    @Test
    146140    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");
    148142        String s="Signed spaces can be everywhere.jsr was launched correctly";
    149143        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
     
    157151    @Test
    158152    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");
    160154
    161155        String s="Signed spaces can be everywhere.jsr was launched correctly";
     
    170164    @Test
    171165    public void SpacesCanBeEverywhereRemoteTests3Signed() throws Exception {
    172         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp");
     166        ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp");
    173167        String s="Signed spaces can be everywhere.jsr was launched correctly";
    174168        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
     
    187181        commands.add(ServerAccess.HEADLES_OPTION);
    188182        commands.add("Spaces can be everywhere1.jnlp");
    189         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
     183        ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
    190184        String s = "Good simple javaws exapmle";
    191185        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
     
    203197        commands.add(ServerAccess.HEADLES_OPTION);
    204198        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());
    206200        String s="Signed spaces can be everywhere.jsr was launched correctly";
    207201        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
     
    219213        commands.add(ServerAccess.HEADLES_OPTION);
    220214        commands.add(server.getDir()+"/Spaces can be everywhere2 signed.jnlp");
    221         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands);
     215        ProcessResult pr = ServerAccess.executeProcess(commands);
    222216        String s="Signed spaces can be everywhere.jsr was launched correctly";
    223217        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
     
    235229        commands.add(ServerAccess.HEADLES_OPTION);
    236230        commands.add("SpacesCanBeEverywhere1signed.jnlp");
    237         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
     231        ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
    238232        String s="Signed spaces can be everywhere.jsr was launched correctly";
    239233        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  
    3838import java.util.Arrays;
    3939import java.util.List;
     40import net.sourceforge.jnlp.ProcessResult;
    4041import net.sourceforge.jnlp.ServerAccess;
    41 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     42
    4243import org.junit.Assert;
    43 
    4444import org.junit.Test;
    4545
     
    7373    private static final List<String> xta = Arrays.asList(new String[]{"-Xtrustall"});
    7474
    75     private void testShouldFail(ServerAccess.ProcessResult pr, String s) {
     75    private void testShouldFail(ProcessResult pr, String s) {
    7676        String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*";
    7777        Assert.assertTrue("stderr should match `" + c + "`, but didn't ", pr.stderr.matches(c));
    7878    }
    7979
    80     private void testShouldNOTFail(ServerAccess.ProcessResult pr, String s) {
     80    private void testShouldNOTFail(ProcessResult pr, String s) {
    8181        String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*";
    8282        Assert.assertFalse("stderr should NOT match `" + c + "`, but did ", pr.stderr.matches(c));
     
    9090    }
    9191
    92     private void testShouldPass(ServerAccess.ProcessResult pr, String s) {
     92    private void testShouldPass(ProcessResult pr, String s) {
    9393        String c = "Class was obtained: " + s;
    9494        Assert.assertTrue("stdout should contains `" + c + "`, but didn't ", pr.stdout.contains(c));
    9595    }
    9696
    97     private void testShouldNOTPass(ServerAccess.ProcessResult pr, String s) {
     97    private void testShouldNOTPass(ProcessResult pr, String s) {
    9898        String c = "Class was obtained: " + s;
    9999        Assert.assertFalse("stdout should not contains `" + c + "`, but did ", pr.stdout.contains(c));
     
    102102    @Test
    103103    public void AccessClassInPackageJAVAXJNLP() throws Exception {
    104         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]);
     104        ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]);
    105105        commonPitfall(pr);
    106106        testShouldPass(pr, pass[0]);
     
    110110    @Test
    111111    public void AccessClassInPackageSELF() throws Exception {
    112         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]);
     112        ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]);
    113113        commonPitfall(pr);
    114114        testShouldPass(pr, pass[1]);
     
    118118    @Test
    119119    public void AccessClassInPackageNETSF() throws Exception {
    120         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]);
     120        ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]);
    121121        commonPitfall(pr);
    122122        testShouldFail(pr, badExceptions[2]);
     
    126126    @Test
    127127    public void AccessClassInPackageSUNSEC() throws Exception {
    128         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]);
     128        ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]);
    129129        commonPitfall(pr);
    130130        commonPitfall(pr);
     
    136136    @Test
    137137    public void AccessClassInPackageSignedJAVAXJNLP() throws Exception {
    138         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]);
     138        ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]);
    139139        commonPitfall(pr);
    140140        testShouldPass(pr, pass[0]);
     
    144144    @Test
    145145    public void AccessClassInPackageSignedSELF() throws Exception {
    146         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]);
     146        ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]);
    147147        commonPitfall(pr);
    148148        testShouldPass(pr, pass[1]);
     
    152152    @Test
    153153    public void AccessClassInPackageSignedNETSF() throws Exception {
    154         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]);
     154        ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]);
    155155        commonPitfall(pr);
    156156        testShouldPass(pr, pass[2]);
     
    160160    @Test
    161161    public void AccessClassInPackageSignedSUNSEC() throws Exception {
    162         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]);
     162        ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]);
    163163        commonPitfall(pr);
    164164        testShouldPass(pr, pass[3]);
  • trunk/icedtea-web/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java

    r418 r429  
     1
     2import java.applet.Applet;
     3
    14/* AddShutdownHook.java
    2 Copyright (C) 2011 Red Hat, Inc.
     5 Copyright (C) 2011 Red Hat, Inc.
    36
    4 This file is part of IcedTea.
     7 This file is part of IcedTea.
    58
    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 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.
    912
    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.
     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.
    1417
    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.
     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.
    1922
    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.
     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.
    2427
    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.
     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.
    3639 */
     40public class AddShutdownHook extends Applet {
    3741
    38 public class AddShutdownHook {
    3942    public static void main(String[] args) {
    4043
    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");
    4756    }
    4857}
  • trunk/icedtea-web/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java

    r418 r429  
    11/* AddShutdownHookTest.java
    2 Copyright (C) 2011 Red Hat, Inc.
     2 Copyright (C) 2011 Red Hat, Inc.
    33
    4 This file is part of IcedTea.
     4 This file is part of IcedTea.
    55
    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.
     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.
    99
    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.
     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.
    1414
    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.
     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.
    1919
    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.
     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.
    2424
    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.
     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.
    3636 */
    3737
    38 import net.sourceforge.jnlp.ServerAccess;
     38import net.sourceforge.jnlp.ClosingListener;
     39import net.sourceforge.jnlp.ProcessResult;
     40import net.sourceforge.jnlp.annotations.TestInBrowsers;
     41import net.sourceforge.jnlp.browsertesting.BrowserTest;
     42import net.sourceforge.jnlp.browsertesting.Browsers;
     43import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
     44import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener;
    3945import org.junit.Assert;
    4046
    4147import org.junit.Test;
    4248
    43 public class AddShutdownHookTest {
     49public class AddShutdownHookTest extends BrowserTest {
    4450
    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);
    4658
    4759    @Test
    4860    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));
    5666        Assert.assertEquals((Integer) 0, pr.returnValue);
    5767    }
     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    }
    5881}
  • trunk/icedtea-web/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import org.junit.Assert;
     
    4950    @Test
    5051    public void AllStackTracesTest1() throws Exception {
    51         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp");
     52        ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp");
    5253        String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getStackTrace" + ".*";
    5354        Assert.assertTrue("stderr should match `"+c+"`, but didn't ",pr.stderr.matches(c));
    5455        String cc="ClassNotFoundException";
    5556        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);
    5757        Assert.assertFalse("AllStackTracesTest1 should not be terminated, but was",pr.wasTerminated);
    5858        Assert.assertEquals((Integer)0, pr.returnValue);
  • 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");
  • trunk/icedtea-web/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import net.sourceforge.jnlp.annotations.TestInBrowsers;
    4041import net.sourceforge.jnlp.browsertesting.BrowserTest;
    4142import net.sourceforge.jnlp.browsertesting.Browsers;
     43
    4244import org.junit.Assert;
    43 
    4445import org.junit.Test;
    4546
     
    5354    @Test
    5455    public void AppletJNLPTest() throws Exception {
    55         ServerAccess.ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp");
     56        ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp");
    5657
    5758        Assert.assertFalse("AppletReadsInvalidJar stdout should NOT contain '" + CORRECT_EXECUTION + "', but did (applet should not have ran!).", pr.stdout.contains(CORRECT_EXECUTION));
     
    6364    @TestInBrowsers(testIn={Browsers.one})
    6465    public void AppletInFirefoxTest() throws Exception {
    65         ServerAccess.ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html");
     66        ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html");
    6667
    6768        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  
    3939 */
    4040public class AppletTakesLastParam extends Applet {
    41 
    42     private class Killer extends Thread {
    43 
    44         public int n = 2000;
    45 
    46         @Override
    47         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     @Override
    5941    public void init() {
    6042        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);
    6247    }
    6348}
  • trunk/icedtea-web/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java

    r418 r429  
    1 /* AppletTestTests.java
     1/* AppletTakesLastParamTests.java
    22Copyright (C) 2011 Red Hat, Inc.
    33
     
    3636 */
    3737
    38 import net.sourceforge.jnlp.ServerAccess;
    39 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
     38import net.sourceforge.jnlp.ProcessResult;
     39import net.sourceforge.jnlp.ServerAccess.AutoClose;
    4040import net.sourceforge.jnlp.browsertesting.BrowserTest;
    4141import net.sourceforge.jnlp.browsertesting.Browsers;
     
    4646
    4747public class AppletTakesLastParamTests extends BrowserTest {
     48    private void evaluate(ProcessResult pr) {
     49        String firstParam = "value1";
     50        String secondParam = "value2";
    4851
    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));
    6056    }
    6157
    6258    @Test
    6359    @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);
    6768    }
    6869}
  • trunk/icedtea-web/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java

    r418 r429  
    1 /* AppletTestTests.java
     1/*
    22Copyright (C) 2011 Red Hat, Inc.
    33
     
    3636 */
    3737
     38import net.sourceforge.jnlp.closinglisteners.CountingClosingListener;
    3839import net.sourceforge.jnlp.ProcessResult;
    3940import net.sourceforge.jnlp.ServerAccess;
     
    4849public class AppletTestTests extends BrowserTest {
    4950
     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
    5065    @Test
    5166    @TestInBrowsers(testIn = {Browsers.googleChrome})
     
    5671            //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString());
    5772            //just verify loging is recording browser
    58             ProcessResult pr1 = server.executeBrowser("/appletAutoTests.html");
     73            ProcessResult pr1 = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl());
    5974            if (pr1.process == null) {
    6075                Assert.assertTrue("If proces was null here, then google-chrome had to not exist, and so "
     
    6580                return;
    6681            }
    67             evaluateApplet(pr1,false);
     82            evaluateApplet(pr1, false);
    6883            Assert.assertTrue(pr1.wasTerminated);
    6984            //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString());
    7085            // 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);
    7388            Assert.assertTrue(pr.wasTerminated);
    7489        } finally {
     
    8196    public void AppletTest() throws Exception {
    8297        ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp");
    83         evaluateApplet(pr,true);
     98        evaluateApplet(pr, true);
    8499        Assert.assertFalse(pr.wasTerminated);
    85100        Assert.assertEquals((Integer) 0, pr.returnValue);
     
    87102
    88103    private void evaluateApplet(ProcessResult pr, boolean javawsApplet) {
    89         String s3 = "applet was initialised";
    90104        Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3));
    91         String s0 = "applet was started";
    92105        Assert.assertTrue("AppletTest stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s0));
    93         String s1 = "value1";
    94106        Assert.assertTrue("AppletTest stdout should contains " + s1 + " bud didn't", pr.stdout.contains(s1));
    95         String s2 = "value2";
    96107        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";
    100108        Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7));
    101109        if (!javawsApplet) {
    102110            /*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));
    107115             */
    108116        }
     
    117125        ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
    118126        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
    122130            //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
    123131        } finally {
     
    133141        ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
    134142        try {
    135             ProcessResult pr = server.executeBrowser("/appletAutoTests.html");
     143            ProcessResult pr = server.executeBrowser("/appletAutoTests.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl());
    136144            pr.process.destroy();
    137             evaluateApplet(pr,false);
     145            evaluateApplet(pr, false);
    138146            Assert.assertTrue(pr.wasTerminated);
    139147            //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
     
    142150        }
    143151    }
     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    }
    144177}
  • trunk/icedtea-web/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
     40
    3941import org.junit.Assert;
    40 
    4142import org.junit.Test;
    4243
     
    4748    @Test
    4849    public void CreateClassLoaderLunch1() throws Exception {
    49         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp");
     50        ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp");
    5051        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "createClassLoader" + ".*";
    5152        Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s));
    5253        String cc="ClassNotFoundException";
    5354        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);
    5555        Assert.assertFalse("CreateClassLoaderLunch1 should not be terminated, but was",pr.wasTerminated);
    5656        Assert.assertEquals((Integer) 0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java

    r418 r429  
    3636 */
    3737
    38 
    3938import java.util.Arrays;
    4039import java.util.List;
    4140
     41import net.sourceforge.jnlp.ProcessResult;
    4242import net.sourceforge.jnlp.ServerAccess;
    4343import org.junit.Assert;
     
    5050    public void runTest(String jnlpName, String exception) throws Exception {
    5151        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");
    5353        String s1 = "Good simple javaws exapmle";
    5454        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  
    6363        Map<String, String> p = System.getenv();
    6464        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);
    6666        Collections.sort(rr, new Comparator<Entry<String, String>>() {
    6767
     
    9494        String s = "LocalisedInformationElement launched";
    9595        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));
    9996        String locMatch = "(?s).*default locale: \\w{2}.*";
    10097        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  
    3636 */
    3737
     38import java.util.Arrays;
     39import net.sourceforge.jnlp.ProcessResult;
    3840import net.sourceforge.jnlp.ServerAccess;
    3941import net.sourceforge.jnlp.annotations.Bug;
     42import net.sourceforge.jnlp.runtime.Translator;
     43
    4044import org.junit.Assert;
    41 
    4245import org.junit.Test;
    4346
     
    5053    private static final String twoMainException = "net.sourceforge.jnlp.ParseException: Invalid XML document syntax";
    5154
    52     private void assertManifestedJar1(String id, ServerAccess.ProcessResult q) {
     55    private void assertManifestedJar1(String id, ProcessResult q) {
    5356        String s = "Hello from ManifestedJar1";
    5457        Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s));
    5558    }
    5659
    57     private void assertManifestedJar2(String id, ServerAccess.ProcessResult q) {
     60    private void assertManifestedJar2(String id, ProcessResult q) {
    5861        String s = "Hello from ManifestedJar2";
    5962        Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s));
    6063    }
    6164
    62     private void assertNotManifestedJar1(String id, ServerAccess.ProcessResult q) {
     65    private void assertNotManifestedJar1(String id, ProcessResult q) {
    6366        String s = "Hello from ManifestedJar1";
    6467        Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s));
    6568    }
    66     private void assertAppError(String id, ServerAccess.ProcessResult q) {
     69    private void assertAppError(String id, ProcessResult q) {
    6770        Assert.assertTrue(id + " stderr should contains `" + nonLunchableMessage + "`, but didnn't ", q.stderr.contains(nonLunchableMessage));
    6871    }
    6972
    70     private void assertNotManifestedJar2(String id, ServerAccess.ProcessResult q) {
     73    private void assertNotManifestedJar2(String id, ProcessResult q) {
    7174        String s = "Hello from ManifestedJar2";
    7275        Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s));
    7376    }
    7477
    75     private void assertNotDead(String id, ServerAccess.ProcessResult pr) {
     78    private void assertNotDead(String id, ProcessResult pr) {
    7679        String cc = "ClassNotFoundException";
    7780        Assert.assertFalse(id + " stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
     
    8689    public void manifestedJar1nothing2nothingNoAppDesc() throws Exception {
    8790        String id = "ManifestedJar-1nothing2nothingNoAppDesc";
    88         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     91        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    8992        assertManifestedJar1(id, pr);
    9093        assertNotDead(id, pr);
     
    98101    public void manifestedJar1noAppDesc() throws Exception {
    99102        String id = "ManifestedJar-1noAppDesc";
    100         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     103        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    101104        assertManifestedJar1(id, pr);
    102105        assertNotDead(id, pr);
     
    110113    public void manifestedJar1mainNoAppDesc() throws Exception {
    111114        String id = "ManifestedJar-1mainNoAppDesc";
    112         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     115        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    113116        assertManifestedJar1(id, pr);
    114117        assertNotDead(id, pr);
     
    122125    public void ManifestedJar1mainHaveAppDesc() throws Exception {
    123126        String id = "ManifestedJar-1mainHaveAppDesc";
    124         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     127        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    125128        assertManifestedJar2(id, pr);
    126129        assertNotDead(id, pr);
     
    134137    public void ManifestedJar1main2nothingNoAppDesc() throws Exception {
    135138        String id = "ManifestedJar-1main2nothingNoAppDesc";
    136         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     139        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    137140        assertManifestedJar2(id, pr);
    138141        assertNotDead(id, pr);
     
    146149    public void manifestedJar1main2nothingNoAppDesc() throws Exception {
    147150        String id = "ManifestedJar-1main2nothingNoAppDesc";
    148         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     151        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    149152        assertManifestedJar2(id, pr);
    150153        assertNotDead(id, pr);
     
    154157     *
    155158     * 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     *
    159161     */
    160162    @Test
    161163    public void manifestedJar1main2mainNoAppDesc() throws Exception {
    162164        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")));
    166185    }
    167186
     
    175194    public void manifestedJar1main2mainAppDesc() throws Exception {
    176195        String id = "ManifestedJar-1main2mainAppDesc";
    177         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     196        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    178197        assertNotManifestedJar1(id, pr);
    179198        assertNotManifestedJar2(id, pr);
     
    190209    public void manifestedJar1noAppDescAtAll() throws Exception {
    191210        String id = "ManifestedJar-1noAppDescAtAll";
    192         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     211        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    193212        assertNotManifestedJar1(id, pr);
    194213        assertNotManifestedJar2(id, pr);
     
    209228    public void manifestedJar1nothing2nothingAppDesc() throws Exception {
    210229        String id = "ManifestedJar-1nothing2nothingAppDesc";
    211         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
    212         assertNotManifestedJar2(id, pr);
     230        ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp");
     231        assertManifestedJar2(id, pr);
    213232        assertNotManifestedJar1(id, pr);
    214233        assertNotDead(id, pr);
  • trunk/icedtea-web/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import org.junit.Assert;
    40 
    4141import org.junit.Test;
    4242
     
    4747    @Test
    4848    public void ReadEnvironmentLunch1() throws Exception {
    49         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp");
     49        ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp");
    5050        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getenv.USER" + ".*";
    5151        Assert.assertTrue("stderr should match"+s+"but didn't",pr.stderr.matches(s));
    5252        String cc="ClassNotFoundException";
    5353        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);
    5554        Assert.assertFalse("ReadEnvironmentLunch1 should not be terminated, but was",pr.wasTerminated);
    5655        Assert.assertEquals((Integer) 0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java

    r418 r429  
    3636 */
    3737
    38 
     38import net.sourceforge.jnlp.ProcessResult;
    3939import net.sourceforge.jnlp.ServerAccess;
    4040import org.junit.Assert;
     
    4848    @Test
    4949    public void ReadPropertiesLunch1() throws Exception {
    50         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
     50        ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
    5151        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*";
    5252        Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
    5353        String cc="ClassNotFoundException";
    5454        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);
    5655        Assert.assertFalse("ReadPropertiesLunch1 should not be terminated, but was",pr.wasTerminated);
    5756        Assert.assertEquals((Integer)0, pr.returnValue);
     
    6059    @Test
    6160    public void ReadPropertiesLunch2() throws Exception {
    62         ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp");
     61        ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp");
    6362        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.home.{0,5}read" + ".*";
    6463        Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
    6564        String cc="ClassNotFoundException";
    6665        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);
    6866        Assert.assertFalse("ReadPropertiesLunch2 should not be terminated, but was",pr.wasTerminated);
    6967        Assert.assertEquals((Integer)0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import org.junit.Assert;
     
    4647    @Test
    4748    public void RedirectStreamsTest1() throws Exception {
    48         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp");
     49        ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp");
    4950        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setIO" + ".*";
    5051        Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s));
    5152        String cc="ClassNotFoundException";
    5253        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);
    5454        Assert.assertFalse("RedirectStreams should not be terminated, but was",pr.wasTerminated);
    5555        Assert.assertEquals((Integer) 0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import org.junit.Assert;
     
    4647    @Test
    4748    public void ReplaceSecurityManagerLunch1() throws Exception {
    48         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp");
     49        ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp");
    4950        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setSecurityManager" + ".*";
    5051        Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
    5152        String cc="ClassNotFoundException";
    5253        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);
    5454        Assert.assertFalse("ReplaceSecurityManagerLunch1 should not be terminated, but was",pr.wasTerminated);
    5555        Assert.assertEquals((Integer) 0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
    3940import org.junit.Assert;
     
    4647    @Test
    4748    public void SetContextClassLoader1() throws Exception {
    48         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp");
     49        ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp");
    4950        String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setContextClassLoader" + ".*";
    5051        Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s));
    5152        String cc="ClassNotFoundException";
    5253        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);
    5454        Assert.assertFalse("SetContextClassLoader1 should not be terminated, but was",pr.wasTerminated);
    5555        Assert.assertEquals((Integer) 0, pr.returnValue);
  • trunk/icedtea-web/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java

    r418 r429  
    3737
    3838import java.util.ArrayList;
     39import java.util.Arrays;
    3940import java.util.List;
     41import net.sourceforge.jnlp.ContentReaderListener;
     42import net.sourceforge.jnlp.ProcessResult;
    4043import net.sourceforge.jnlp.ServerAccess;
    4144import net.sourceforge.jnlp.annotations.Bug;
     
    4447import net.sourceforge.jnlp.browsertesting.Browsers;
    4548import net.sourceforge.jnlp.annotations.TestInBrowsers;
     49import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener;
    4650import org.junit.Assert;
    4751import org.junit.Test;
     
    5054public class SpacesCanBeEverywhereTests extends BrowserTest {
    5155
    52 
     56public static final String s = "Spaces can be everywhere.jsr was launched correctly";
    5357    @Bug(id="PR811")
    5458    @Test
     
    8286         * only on ocal files, and probably only from test run - it can be ignored
    8387         */
    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));
    8990        Assert.assertFalse("should not be terminated, but was", pr.wasTerminated);
    9091        Assert.assertEquals((Integer) 0, pr.returnValue);
     
    9596    @NeedsDisplay
    9697    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);
    103101    }
    104102
     
    108106    @TestInBrowsers(testIn = {Browsers.all})
    109107    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));
    115110        Assert.assertTrue("should be terminated, but was not", pr.wasTerminated);
    116111    }
     
    120115    @Test
    121116    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");
    123118        String s = "Good simple javaws exapmle";
    124119        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
     
    132127    @Test
    133128    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");
    136130        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    137131        String cc = "ClassNotFoundException";
     
    144138    @Test
    145139    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");
    148141        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    149142        String cc = "ClassNotFoundException";
     
    157150    @Test
    158151    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");
    161153        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    162154        String cc = "ClassNotFoundException";
     
    169161    @Test
    170162    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");
    173164        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    174165        String cc = "ClassNotFoundException";
     
    186177        commands.add(ServerAccess.HEADLES_OPTION);
    187178        commands.add("Spaces can be everywhere1.jnlp");
    188         ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
     179        ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir());
    189180        String s = "Good simple javaws exapmle";
    190181        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
     
    202193        commands.add(ServerAccess.HEADLES_OPTION);
    203194        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());
    206196        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    207197        String cc = "ClassNotFoundException";
     
    218208        commands.add(ServerAccess.HEADLES_OPTION);
    219209        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);
    222211        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    223212        String cc = "ClassNotFoundException";
     
    234223        commands.add(ServerAccess.HEADLES_OPTION);
    235224        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());
    238226        Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s));
    239227        String cc = "ClassNotFoundException";
  • trunk/icedtea-web/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java

    r418 r429  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    4243import org.junit.Assert;
     
    5152    @Test
    5253    public void jnlpFileIsUnchecked1() throws Exception {
    53         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp");
     54        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp");
    5455        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    5556    }
     
    5758    @Test
    5859    public void jnlpFileIsUnchecked2() throws Exception {
    59         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp");
     60        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp");
    6061        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    6162    }
     
    6364    @Test
    6465    public void jnlpFileIsUnchecked3() throws Exception {
    65         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp");
     66        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp");
    6667        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    6768    }
  • trunk/icedtea-web/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java

    r418 r429  
    3939import java.util.Collections;
    4040import java.util.List;
     41import net.sourceforge.jnlp.ProcessResult;
    4142import net.sourceforge.jnlp.ServerAccess;
    4243import org.junit.Assert;
     
    5152    @Test
    5253    public void jnlpTemplateIsUnchecked1() throws Exception {
    53         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp");
     54        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp");
    5455        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    5556    }
     
    5758    @Test
    5859    public void jnlpTemplateIsUnchecked2() throws Exception {
    59         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp");
     60        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp");
    6061        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    6162    }
     
    6364    @Test
    6465    public void jnlpTemplateIsUnchecked3() throws Exception {
    65         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp");
     66        ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp");
    6667        Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString));
    6768    }
  • trunk/icedtea-web/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java

    r418 r429  
    3737
    3838import java.util.ArrayList;
     39import net.sourceforge.jnlp.ProcessResult;
    3940import net.sourceforge.jnlp.ServerAccess;
    40 import net.sourceforge.jnlp.ServerAccess.ProcessResult;
    4141import org.junit.Assert;
    4242import java.util.Arrays;
     
    8181        List<String> before = countJavaInstances();
    8282        ServerAccess.logOutputReprint("java1 " + jnlp + " : " + before.size());
    83         ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, jnlp);
     83        ProcessResult pr = server.executeJavawsHeadless(null, jnlp);
    8484        assertDeadlockTestLaunched(pr);
    8585        List<String> after = countJavaInstances();
     
    168168            ServerAccess.PROCESS_LOG = false;
    169169            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}));
    171171            } finally {
    172172                ServerAccess.PROCESS_LOG = true;
     
    183183        ServerAccess.PROCESS_LOG = false;
    184184        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"}));
    186186            Matcher m = Pattern.compile("\\s*\\d+\\s+\\d+ .+ java\\s*").matcher(pr.stdout);
    187187            int i = 0;
     
    206206        String s = "Deadlock test started";
    207207        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));
    210208        //each 3500 seconds deadlock test stdout something
    211209        //timeout is 20s
  • trunk/icedtea-web/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java

    r418 r429  
    4040    public static void main(String[] args){
    4141        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        }
    4247    }
    4348}
  • trunk/icedtea-web/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java

    r418 r429  
    3636 */
    3737
    38 
     38import java.io.File;
     39import java.io.FileInputStream;
     40import java.io.IOException;
     41import java.net.MalformedURLException;
     42import java.net.URL;
     43import java.util.Arrays;
     44import java.util.List;
     45import net.sourceforge.jnlp.ProcessResult;
    3946import net.sourceforge.jnlp.ServerAccess;
    4047import org.junit.Assert;
     
    4552
    4653    private static ServerAccess server = new ServerAccess();
     54    private static final List<String> strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION});
    4755
    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    }
    4977
    5078    @Test
    5179    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);
    5982    }
    6083
    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
     2import java.applet.Applet;
     3
    14/* SimpleTest2.java
    25Copyright (C) 2011 Red Hat, Inc.
     
    3639 */
    3740
    38 public class SimpleTest2{
     41public class SimpleTest2 extends Applet{
    3942
    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    }
    4246
     47    @Override
     48    public void init() {
     49        System.out.println("applet was initialised");
    4350    }
     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
    4468}
  • trunk/icedtea-web/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java

    r418 r429  
    3636 */
    3737
     38import net.sourceforge.jnlp.ProcessResult;
    3839import net.sourceforge.jnlp.ServerAccess;
     40
    3941import org.junit.Assert;
    40 
    4142import org.junit.Test;
    4243
     
    4849    @Test
    4950    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");
    5252        String s="Correct exception";
    5353        Assert.assertTrue("stderr should contains "+s+" but didn't",pr.stderr.contains(s));
     
    5555        Assert.assertTrue("stderr should contains "+ss+" but did not",pr.stderr.contains(ss));
    5656        Assert.assertFalse("testSimpletest2lunchException should not be terminated, but was",pr.wasTerminated);
    57         //Assert.assertFalse(0==pr.returnValue);exception and still returned 0?
    5857    }
    5958
Note: See TracChangeset for help on using the changeset viewer.