mirror of https://github.com/apache/jmeter.git
Bug 42379 - GUI JUnit tests fails when test are executed in non-English Locale
git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@537665 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
797cf35b85
commit
aa00c515f0
|
|
@ -29,6 +29,7 @@ import java.util.HashMap;
|
|||
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 @@ public class JMeterTest extends JMeterTestCase {
|
|||
|
||||
private static Properties nameMap;
|
||||
|
||||
private static final Locale TEST_LOCALE = Locale.ENGLISH;
|
||||
|
||||
public JMeterTest(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
|
@ -144,6 +147,9 @@ public class JMeterTest extends JMeterTestCase {
|
|||
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 @@ public class JMeterTest extends JMeterTestCase {
|
|||
* 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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue