/hg/icedtea-web: Fixed codebase reproducers
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Tue Jul 14 11:25:36 UTC 2015
changeset 1e46c2f4f13f in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=1e46c2f4f13f
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Jul 14 13:24:57 2015 +0200
Fixed codebase reproducers
diffstat:
ChangeLog | 12 ++++++
tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java | 12 +----
tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java | 20 +++++++++-
tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java | 20 +++++++++-
tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java | 18 +++++++++
5 files changed, 69 insertions(+), 13 deletions(-)
diffs (175 lines):
diff -r afb391ba4b20 -r 1e46c2f4f13f ChangeLog
--- a/ChangeLog Mon Jul 13 17:19:00 2015 +0200
+++ b/ChangeLog Tue Jul 14 13:24:57 2015 +0200
@@ -1,3 +1,15 @@
+2015-07-13 Jiri Vanek <jvanek at redhat.com>
+
+ Fixed codebase reproducers
+ * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java:
+ improved (getMessage) to take message directly via Translator
+ * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java:
+ now ensures deployment.manifest.attributes.check have always CODEBASE value
+ * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java:
+ same
+ * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java:
+ same
+
2015-07-13 Jiri Vanek <jvanek at redhat.com>
Added tests for unsigned applet/app using Permission attribute
diff -r afb391ba4b20 -r 1e46c2f4f13f tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java
--- a/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java Mon Jul 13 17:19:00 2015 +0200
+++ b/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java Tue Jul 14 13:24:57 2015 +0200
@@ -51,6 +51,7 @@
import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
import net.sourceforge.jnlp.config.DeploymentConfiguration;
import net.sourceforge.jnlp.runtime.ManifestAttributesChecker;
+import net.sourceforge.jnlp.runtime.Translator;
import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier;
import net.sourceforge.jnlp.util.FileUtils;
import org.junit.AfterClass;
@@ -86,15 +87,8 @@
}
public static String getMessage(int i) {
- try {
- String s = "";//_cs, _de, _pl
- PropertyResourceBundle props = new PropertyResourceBundle(CodeBaseManifestEntrySignedMatching.class.getResourceAsStream("/net/sourceforge/jnlp/resources/Messages" + s + ".properties"));
- //Bundle messages need to be formatted
- return MessageFormat.format(props.getString(keys[i]), new Object[0]);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
+ return Translator.R(keys[i]);
+ }
//may broke if run on non default locales
//as those messages are localised
public static final boolean CHECK_MESSAGES = true;
diff -r afb391ba4b20 -r 1e46c2f4f13f tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java
--- a/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java Mon Jul 13 17:19:00 2015 +0200
+++ b/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java Tue Jul 14 13:24:57 2015 +0200
@@ -35,7 +35,6 @@
exception statement from your version.
*/
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -48,8 +47,12 @@
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener;
import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
-import net.sourceforge.jnlp.util.FileUtils;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.ManifestAttributesChecker;
+import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
public class CodeBaseManifestEntrySignedNotMatching extends BrowserTest {
@@ -59,6 +62,19 @@
public static final String GENERAL_NAME = "CodeBaseManifestEntry";
public static final String SIGNATURE = "SignedNotMatching";
+ private static DeploymentPropertiesModifier codebaseModifier;
+
+ @BeforeClass
+ public static void setupDeploymentProperties() throws IOException {
+ codebaseModifier = new DeploymentPropertiesModifier();
+ codebaseModifier.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.CODEBASE.toString());
+ }
+
+ @AfterClass
+ public static void setbackDeploymentProperties() throws IOException {
+ codebaseModifier.restoreProperties();
+ }
+
public void checkMessage(ProcessResult pr, int i) {
CodeBaseManifestEntrySignedMatching.checkMessage(pr, i);
}
diff -r afb391ba4b20 -r 1e46c2f4f13f tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java
--- a/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java Mon Jul 13 17:19:00 2015 +0200
+++ b/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java Tue Jul 14 13:24:57 2015 +0200
@@ -35,7 +35,6 @@
exception statement from your version.
*/
-import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -47,8 +46,12 @@
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener;
import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
-import net.sourceforge.jnlp.util.FileUtils;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.ManifestAttributesChecker;
+import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
public class CodeBaseManifestEntryUnsignedMatching extends BrowserTest {
@@ -57,6 +60,19 @@
public static final String GENERAL_NAME = "CodeBaseManifestEntry";
public static final String SIGNATURE = "UnsignedMatching";
+ private static DeploymentPropertiesModifier codebaseModifier;
+
+ @BeforeClass
+ public static void setupDeploymentProperties() throws IOException {
+ codebaseModifier = new DeploymentPropertiesModifier();
+ codebaseModifier.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.CODEBASE.toString());
+ }
+
+ @AfterClass
+ public static void setbackDeploymentProperties() throws IOException {
+ codebaseModifier.restoreProperties();
+ }
+
public void checkMessage(ProcessResult pr, int i) {
CodeBaseManifestEntrySignedMatching.checkMessage(pr, i);
}
diff -r afb391ba4b20 -r 1e46c2f4f13f tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java
--- a/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java Mon Jul 13 17:19:00 2015 +0200
+++ b/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java Tue Jul 14 13:24:57 2015 +0200
@@ -48,8 +48,13 @@
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener;
import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
+import net.sourceforge.jnlp.config.DeploymentConfiguration;
+import net.sourceforge.jnlp.runtime.ManifestAttributesChecker;
+import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier;
import net.sourceforge.jnlp.util.FileUtils;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
public class CodeBaseManifestEntryUnsignedNotMatching extends BrowserTest {
@@ -59,6 +64,19 @@
public static final String GENERAL_NAME = "CodeBaseManifestEntry";
public static final String SIGNATURE = "UnsignedNotMatching";
+ private static DeploymentPropertiesModifier codebaseModifier;
+
+ @BeforeClass
+ public static void setupDeploymentProperties() throws IOException {
+ codebaseModifier = new DeploymentPropertiesModifier();
+ codebaseModifier.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.CODEBASE.toString());
+ }
+
+ @AfterClass
+ public static void setbackDeploymentProperties() throws IOException {
+ codebaseModifier.restoreProperties();
+ }
+
public void checkMessage(ProcessResult pr, int i) {
CodeBaseManifestEntrySignedMatching.checkMessage(pr, i);
}
More information about the distro-pkg-dev
mailing list