From 4e54b331710269c584f8c328fbb395789b4a5502 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 27 Nov 2013 14:20:25 +0100 Subject: Reverted "fix to ManifestedJar1Test cases", better manifestedjar tests, added srtict test * netx/net/sourceforge/jnlp/Parser.java: added indentation, fixes condition in strict base check * netx/net/sourceforge/jnlp/ResourcesDesc.java: revertedt recently added throw * tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: (manifestedJar1main2mainNoAppDesc) adapted and (manifestedJar1main2mainNoAppDescStrict) added --- .../ManifestedJar1/testcases/ManifestedJar1Test.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/reproducers/simple') diff --git a/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java b/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java index 8b36dd9..7558585 100644 --- a/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java +++ b/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java @@ -35,9 +35,11 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; +import net.sourceforge.jnlp.runtime.Translator; import org.junit.Assert; import org.junit.Test; @@ -154,15 +156,32 @@ public class ManifestedJar1Test { /** * * Two jars, both with manifest, sboth with main tag, no app desc + * first jar is taken * */ @Test public void manifestedJar1main2mainNoAppDesc() throws Exception { String id = "ManifestedJar-1main2mainNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); + assertManifestedJar1(id, pr); + assertNotManifestedJar2(id, pr); + assertNotDead(id, pr); + } + + /** + * + * Two jars, both with manifest, sboth with main tag, no app desc + * two main jars reported + * + */ + @Test + public void manifestedJar1main2mainNoAppDescStrict() throws Exception { + String id = "ManifestedJar-1main2mainNoAppDesc"; + ProcessResult pr = server.executeJavawsHeadless(Arrays.asList(new String[]{"-strict"}), "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertNotDead(id, pr); + Assert.assertTrue(pr.stderr.contains(Translator.R("PTwoMains")) || pr.stdout.contains(Translator.R("PTwoMains"))); } /** -- cgit v1.2.3