Author: sebb
Date: Fri Jan 29 20:03:26 2010
New Revision: 904613
URL: http://svn.apache.org/viewvc?rev=904613&view=rev
Log:
Re-enable duplicate key checks for messages*.properties
Modified:
jakarta/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
Modified:
jakarta/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java?rev=904613&r1=904612&r2=904613&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
(original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
Fri Jan 29 20:03:26 2010
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
+import java.util.Iterator;
import java.util.List;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
@@ -168,11 +169,18 @@
if (prb == null){
return;
}
- Enumeration<String> enumr = prb.getKeys();
- while (enumr.hasMoreElements()) {
- String key = enumr.nextElement();
+ final ArrayList<String> list = Collections.list(prb.getKeys());
+ Collections.sort(list);
+ Iterator<String> enumr = list.iterator();
+ final boolean mainResourceFile = resname.startsWith("messages");
+ while (enumr.hasNext()) {
+ String key = enumr.next();
try {
- defaultPRB.getString(key); // Check key is in default
+ String val = defaultPRB.getString(key); // Also Check key
is in default
+ if (mainResourceFile && val.equals(prb.getString(key))){
+ System.out.println("Duplicate value? "+key+"="+val+"
in "+res);
+ subTestFailures++;
+ }
} catch (MissingResourceException e) {
subTestFailures++;
System.out.println(resourcePrefix + "_" + resname + " has
unexpected key: " + key);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]