From 1cc283b4a384c659a413006adb471441491ddf5d Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 19 Mar 2012 17:25:09 +0100 Subject: added splash screen tests for upcoming splashscreen --- .../AppletTest/resources/appletAutoTests.html | 44 ++++++++++++++++++ .../AppletTest/resources/appletViewTest.html | 52 ++++++++++++++++++++++ .../AppletTest/testcases/AppletTestTests.java | 27 ++++++++++- 3 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html create mode 100644 tests/jnlp_tests/simple/AppletTest/resources/appletViewTest.html (limited to 'tests/jnlp_tests/simple/AppletTest') diff --git a/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html b/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html new file mode 100644 index 0000000..3a2da42 --- /dev/null +++ b/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html @@ -0,0 +1,44 @@ + + +

+ + +

+ + diff --git a/tests/jnlp_tests/simple/AppletTest/resources/appletViewTest.html b/tests/jnlp_tests/simple/AppletTest/resources/appletViewTest.html new file mode 100644 index 0000000..0b489c8 --- /dev/null +++ b/tests/jnlp_tests/simple/AppletTest/resources/appletViewTest.html @@ -0,0 +1,52 @@ + + +ok applet + +

ok applet

+

+ +

+

ok applet

+

bad applet

+

+ +

+

bad applet

+ + diff --git a/tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java b/tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java index 9d83915..bba36ce 100644 --- a/tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java +++ b/tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java @@ -36,6 +36,7 @@ exception statement from your version. */ import net.sourceforge.jnlp.ServerAccess; +import net.sourceforge.jnlp.ServerAccess.ProcessResult; import org.junit.Assert; import org.junit.Test; @@ -51,6 +52,12 @@ public class AppletTestTests { ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp"); System.out.println(pr.stdout); System.err.println(pr.stderr); + evaluateApplet(pr); + Assert.assertFalse(pr.wasTerminated); + Assert.assertEquals((Integer) 0, pr.returnValue); + } + + private void evaluateApplet(ProcessResult pr) { String s3 = "applet was initialised"; Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); String s0 = "applet was started"; @@ -67,7 +74,23 @@ public class AppletTestTests { Assert.assertFalse("AppletTest stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); String s7 = "Aplet killing himself after 2000 ms of life"; Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7)); - Assert.assertFalse(pr.wasTerminated); - Assert.assertEquals((Integer) 0, pr.returnValue); + } + + @Test + public void AppletInFirefoxTest() throws Exception { + System.out.println("connecting AppletInFirefoxTest request"); + System.err.println("connecting AppletInFirefoxTest request"); + server.PROCESS_TIMEOUT = 30 * 1000; + try { + ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests.html"); + System.out.println(pr.stdout); + System.err.println(pr.stderr); + pr.process.destroy(); + evaluateApplet(pr); + Assert.assertTrue(pr.wasTerminated); + //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null + } finally { + server.PROCESS_TIMEOUT = 20 * 1000; //back to normal + } } } -- cgit v1.2.3