Author: sebb
Date: Sun May 13 15:16:36 2007
New Revision: 537665

URL: http://svn.apache.org/viewvc?view=rev&rev=537665
Log:
Bug 42379 - GUI JUnit tests fails when test are executed in non-English Locale

Modified:
    
jakarta/jmeter/branches/rel-2-2/test/src/org/apache/jmeter/junit/JMeterTest.java

Modified: 
jakarta/jmeter/branches/rel-2-2/test/src/org/apache/jmeter/junit/JMeterTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/test/src/org/apache/jmeter/junit/JMeterTest.java?view=diff&rev=537665&r1=537664&r2=537665
==============================================================================
--- 
jakarta/jmeter/branches/rel-2-2/test/src/org/apache/jmeter/junit/JMeterTest.java
 (original)
+++ 
jakarta/jmeter/branches/rel-2-2/test/src/org/apache/jmeter/junit/JMeterTest.java
 Sun May 13 15:16:36 2007
@@ -29,6 +29,7 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -77,6 +78,8 @@
 
     private static Properties nameMap;
     
+    private static final Locale TEST_LOCALE = Locale.ENGLISH; 
+    
        public JMeterTest(String name) {
                super(name);
        }
@@ -144,6 +147,9 @@
                        System.out.println("Cannot create MainFrame: " + e);
                }
 
+        // The Locale used to instantiate the GUI objects
+        JMeterUtils.setLocale(TEST_LOCALE);
+        
                TestSuite suite = new TestSuite("JMeterTest");
         suite.addTest(new JMeterTest("readAliases"));
                suite.addTest(new JMeterTest("createTitleSet"));
@@ -403,6 +409,9 @@
         * Test GUI elements - run for all components
         */
        public void GUIComponents1() throws Exception {
+        // We must set the Locale to the same value that was used when the
+        // GUI objects was instantiated in this class
+        JMeterUtils.setLocale(TEST_LOCALE);
                String name = guiItem.getClass().getName();
 
                assertEquals("Name should be same as static label for " + name, 
guiItem.getStaticLabel(), guiItem.getName());



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to