diff options
5 files changed, 43 insertions, 9 deletions
@@ -1,3 +1,14 @@ +2012-06-15 Jiri Vanek <[email protected]> + + * tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html: + Added quotes around parameters of html applet tag. + * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: + Output verification is counting with repeated and probably unfinished outputs. + * tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java + Is now printing out sentence in intervals to avoid destroy-consume as much as possible + * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: + Added bug annotation with threads on distro-pkg-dev + 2012-06-15 Adam Domurad <[email protected]> Fixed two memory leaks diff --git a/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html b/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html index 3a2da42..a2613d9 100644 --- a/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html +++ b/tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html @@ -36,7 +36,7 @@ exception statement from your version. --> <html><head></head><body bgcolor="blue"> -<p><applet code="AppletTest.class" archive="XslowXAppletTest.jar" codebase="." width=800 height=600> +<p><applet code="AppletTest.class" archive="XslowXAppletTest.jar" codebase="." width="800" height="600"> <param name="key1" value="value1"> <param name="key2" value="#value2"> </applet></p> diff --git a/tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java b/tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java index c473ef4..4d348b0 100644 --- a/tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java +++ b/tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java @@ -42,11 +42,15 @@ public class DeadlockTest { public static void main(String[] args) throws Exception { long startTime = System.nanoTime() / 1000000l; System.out.println("Deadlock test started"); + int i=0; while (true) { long now = System.nanoTime() / 1000000l; - Thread.sleep(10); + Thread.sleep(3500); + i++; + System.out.println(i+" Deadlock sleeping"); if (now - startTime > DEADLOCK_TEST_TIME_OF_LIFE) { System.out.println("This process is hanging more then "+DEADLOCK_TEST_TIME_OF_LIFE/1000+"s. Should be killed"); + System.out.flush(); System.exit(5); } } diff --git a/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java b/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java index 79020e6..b2e0a48 100644 --- a/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java +++ b/tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java @@ -62,28 +62,36 @@ public class DeadLockTestTest { @Test public void testDeadLockTestTerminated() throws Exception { testDeadLockTestTerminatedBody(deadlocktest); + testDeadLockTestTerminatedBody(deadlocktest); + ServerAccess.logOutputReprint("Currently running javas12 " + countJavaInstances()); } @Test public void testDeadLockTestTerminated2() throws Exception { testDeadLockTestTerminatedBody(deadlocktest_1); + testDeadLockTestTerminatedBody(deadlocktest_1); + /** + * this happens, when p.p.destroy is called before p.interrupt. and destroyed variable is removedI have no idea why, but it is incorrect. + Assert.assertNotNull("return can not be null in no fork process. Was ",pr.returnValue);//in this case forking is forbiden, and sojava throws an exception after destroy + */ + ServerAccess.logOutputReprint("Currently running javas13 " + countJavaInstances()); } public void testDeadLockTestTerminatedBody(String jnlp) throws Exception { List<String> before = countJavaInstances(); - ServerAccess.logOutputReprint("java1 "+jnlp+" : " + before.size()); + ServerAccess.logOutputReprint("java1 " + jnlp + " : " + before.size()); ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, jnlp); assertDeadlockTestLaunched(pr); List<String> after = countJavaInstances(); - ServerAccess.logOutputReprint("java2 "+jnlp+" : " + after.size()); - String ss="This process is hanging more than 30s. Should be killed"; - Assert.assertFalse("stdout shoud not contains: "+ss+", but did",pr.stdout.contains(ss)); + ServerAccess.logOutputReprint("java2 " + jnlp + " : " + after.size()); + String ss = "This process is hanging more than 30s. Should be killed"; + Assert.assertFalse("stdout should not contains: " + ss + ", but did", pr.stdout.contains(ss)); // Assert.assertTrue(pr.stderr.contains("xception"));, exception is thrown by engine,not by application Assert.assertTrue("testDeadLockTestTerminated should be terminated, but wasn't", pr.wasTerminated); - Assert.assertEquals(null, pr.returnValue);//killed process have no value + Assert.assertNull("Killed process must have null return value. Have not - ", pr.returnValue); killDiff(before, after); List<String> afterKill = countJavaInstances(); - ServerAccess.logOutputReprint("java3 "+jnlp+" : " + afterKill.size()); + ServerAccess.logOutputReprint("java3 " + jnlp + " : " + afterKill.size()); Assert.assertEquals("assert that just old javas remians", 0, (before.size() - afterKill.size())); } @@ -191,7 +199,7 @@ public class DeadLockTestTest { } public static void main(String[] args) throws Exception { - ServerAccess.logOutputReprint(""+countJavaInstances()); + ServerAccess.logOutputReprint("" + countJavaInstances()); } private void assertDeadlockTestLaunched(ProcessResult pr) { @@ -199,6 +207,15 @@ public class DeadLockTestTest { Assert.assertTrue("Deadlock test should print out " + s + ", but did not", pr.stdout.contains(s)); String ss = "xception"; Assert.assertFalse("Deadlock test should not stderr " + ss + " but did", pr.stderr.contains(ss)); + //each 3500 seconds deadlock test stdout something + //timeout is 20s + //so it should write out FIVE sentences, but is mostly just three or four. Last is nearly always consumed by termination + for (int i = 1; i <= 3; i++) { + String sentence = i + " Deadlock sleeping"; + Assert.assertTrue( + "stdout should contains: " + sentence + ", didn't, so framework have consumed to much during termination", + pr.stdout.contains(sentence)); + } } private void waitForBackgroundDeadlock(final BackgroundDeadlock bd) throws InterruptedException { diff --git a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java index 85d323f..5f3d566 100644 --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java @@ -51,9 +51,11 @@ import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.runtime.JNLPClassLoader.CodeBaseClassLoader; +import net.sourceforge.jnlp.annotations.Bug; import org.junit.Test; +@Bug(id={"PR895","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) public class CodeBaseClassLoaderTest { @Test |