/hg/release/icedtea-web-1.5: MessagesPropertiesTest.java removed...
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Thu Jul 3 14:41:07 UTC 2014
changeset 6f92839c15df in /hg/release/icedtea-web-1.5
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.5?cmd=changeset;node=6f92839c15df
author: Jiri Vanek <jvanek at redhat.com>
date: Thu Jul 03 16:40:55 2014 +0200
MessagesPropertiesTest.java removed useless iterations of all resources against all.
diffstat:
ChangeLog | 6 ++++++
tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diffs (52 lines):
diff -r 3a86eb3b6e0f -r 6f92839c15df ChangeLog
--- a/ChangeLog Tue Jul 01 11:26:37 2014 +0200
+++ b/ChangeLog Thu Jul 03 16:40:55 2014 +0200
@@ -1,3 +1,9 @@
+2014-07-03 Jiri Vanek <jvanek at redhat.com>
+
+ * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
+ removed useless iterations of all resources against all. Kept only all against
+ default.
+
2014-07-01 Jiri Vanek <jvanek at redhat.com>
* NEWS: mentioned PL localization
diff -r 3a86eb3b6e0f -r 6f92839c15df tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java
--- a/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Tue Jul 01 11:26:37 2014 +0200
+++ b/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Thu Jul 03 16:40:55 2014 +0200
@@ -158,14 +158,12 @@
public void allResourcesAreReallyDifferent() {
List<LocalesIdentifier> bundles = new ArrayList<LocalesIdentifier>(secondary.length + 1);
String detailResults="";
- bundles.add(main);
int errors = 0;
bundles.addAll(Arrays.asList(secondary));
for (int i = 0; i < bundles.size(); i++) {
LocalesIdentifier resourceBundle1 = bundles.get(i);
Enumeration<String> keys1 = resourceBundle1.getBundle().getKeys();
- for (int j = 0; j < bundles.size(); j++) {
- LocalesIdentifier resourceBundle2 = bundles.get(j);
+ LocalesIdentifier resourceBundle2 = main;
if (resourceBundle1.getLanguage().equals(resourceBundle2.getLanguage())) {
//do not compare same language groups
allLog("Skipping same language " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")");
@@ -176,6 +174,10 @@
while (keys1.hasMoreElements()) {
String key = keys1.nextElement();
String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key);
+ if (val1.length() > 1000) {
+ errLog("Skipping check of: " + key + " too long. (" + val1.length() + ")");
+ continue;
+ }
String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key);
outLog("\""+val1+"\" x \""+val2);
if (val1.trim().equalsIgnoreCase(val2.trim())) {
@@ -201,8 +203,6 @@
detailResults+=resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()+": "+localErrors+";";
}
errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier());
-
- }
}
assertTrue("Several - " + errors + " - items are same in bundles. See error logs for details: "+detailResults, errors == 0);
}
More information about the distro-pkg-dev
mailing list