diff options
author | Jiri Vanek <[email protected]> | 2013-04-26 17:01:59 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-04-26 17:01:59 +0200 |
commit | bfd62081c1ab28b5382c1791862ca99ff9667f6e (patch) | |
tree | 4d936c2eb337afec76c5e8b5334f8f0d1464a0a8 /tests | |
parent | 14c0b3b81e20f4a70558eb0f300d31dc91d22a1f (diff) |
Added polish transaltion and tests to it
Also minor changes to En and De files
Diffstat (limited to 'tests')
3 files changed, 70 insertions, 4 deletions
diff --git a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java index fc80713..b12dcfb 100644 --- a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java +++ b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java @@ -56,6 +56,7 @@ public class MessagesPropertiesTest { public static final LocalesIdentifier DEFAULT = new LocalesIdentifier("",""); public static final LocalesIdentifier CZ_CS = new LocalesIdentifier("CZ","cs"); public static final LocalesIdentifier DE = new LocalesIdentifier("de"); + public static final LocalesIdentifier PL = new LocalesIdentifier("pl"); //public static final LocalesIdentifier DE_DE = new LocalesIdentifier("DE","de"); public static final String mainFileName = "Messages"; @@ -145,7 +146,7 @@ public class MessagesPropertiesTest { //get default by non existing language and country main = LocalesIdentifier.DEFAULT; assertNotNull(main); - secondary= new LocalesIdentifier[] {LocalesIdentifier.CZ_CS,LocalesIdentifier.DE}; + secondary= new LocalesIdentifier[] {LocalesIdentifier.CZ_CS,LocalesIdentifier.DE,LocalesIdentifier.PL}; assertNotNull(secondary); for (int i = 0; i < secondary.length; i++) { assertNotNull(secondary[i]); @@ -308,7 +309,7 @@ public class MessagesPropertiesTest { } private void errLog(String string) { //used quite often :) - //System.out.println(string); + System.out.println(string); ServerAccess.logErrorReprint(string); } diff --git a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java index b3c3499..6f252f2 100644 --- a/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java +++ b/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java @@ -61,7 +61,6 @@ public class LocalesTestTest { "BOArg", "BOParam", "BOProperty", - "BOUpdate", "BOLicense", "BOVerbose", "BOAbout", @@ -120,6 +119,11 @@ public class LocalesTestTest { } + public ResourceBundle getPropertiesPl() throws IOException { + return getProperties("_pl"); + + } + public ResourceBundle getPropertiesEn() throws IOException { return getProperties(""); @@ -139,6 +143,7 @@ public class LocalesTestTest { assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); + assertNotPl(pr.stdout); } @Test @@ -148,6 +153,7 @@ public class LocalesTestTest { assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } @@ -158,8 +164,30 @@ public class LocalesTestTest { assertNotEnglish(pr.stdout); assertNotDe(pr.stdout); assertCz(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } + + @Test + public void testLocalesPlPL() throws Exception { + String[] l = getChangeLocalesForSubproces("pl_PL"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotCz(pr.stdout); + assertNotDe(pr.stdout); + iteratePropertiesForAproxPl(pr.stdout); + } + + @Test + public void testLocalesPlPLUtf() throws Exception { + String[] l = getChangeLocalesForSubproces("pl_PL.UTF-8"); + ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); + assertNotEnglish(pr.stdout); + assertNotDe(pr.stdout); + assertNotCz(pr.stdout); + assertPl(pr.stdout); + iteratePropertiesForAproxPl(pr.stdout); + } @Test public void testLocalesDeDe() throws Exception { @@ -167,6 +195,7 @@ public class LocalesTestTest { ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @@ -177,6 +206,7 @@ public class LocalesTestTest { assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @@ -187,6 +217,7 @@ public class LocalesTestTest { ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @@ -197,6 +228,7 @@ public class LocalesTestTest { assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @@ -208,6 +240,7 @@ public class LocalesTestTest { ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); + assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @@ -221,6 +254,7 @@ public class LocalesTestTest { assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); + assertNotPl(pr.stdout); } private void assertEnglish(String s) throws IOException { @@ -237,6 +271,11 @@ public class LocalesTestTest { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, true, "czech"); } + + private void assertPl(String s) throws IOException { + ResourceBundle props = getPropertiesPl(); + iteratePropertiesFor(props, s, true, "polish"); + } private void assertDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); @@ -248,6 +287,11 @@ public class LocalesTestTest { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, false, "czech"); } + + private void assertNotPl(String s) throws IOException { + ResourceBundle props = getPropertiesPl(); + iteratePropertiesFor(props, s, false, "polish"); + } private void assertNotDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); @@ -317,6 +361,10 @@ public class LocalesTestTest { private void iteratePropertiesForAproxDe(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); } + + private void iteratePropertiesForAproxPl(String stdout) throws IOException { + iteratePropertiesForAprox(stdout, getPropertiesPl(), Regexer.pl); + } @@ -351,9 +399,26 @@ public class LocalesTestTest { "]", "(", ")"}; + + private static final String[] plEvil = { + "ó", + "ą", + "ę", + "ó", + "ł", + "ć", + "ś", + "ź", + "ż", + "ń", + "[", + "]", + "(", + ")"}; private static final Regexer cz = new Regexer(czEvil,"cz"); private static final Regexer de = new Regexer(deEvil,"de"); + private static final Regexer pl = new Regexer(plEvil,"pl"); private final String[] map; private final String id; diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java index 55ec17a..8763771 100644 --- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java +++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java @@ -119,7 +119,7 @@ public class ServerAccess { * this flag is indicating whether output of executeProcess should be logged. By default true. */ public static boolean PROCESS_LOG = true; - public static boolean LOGS_REPRINT = false; + public static boolean LOGS_REPRINT = true; private Browser currentBrowser; public static final String UNSET_BROWSER="unset_browser"; |