changeset 1099:263c12935d94

[TESTS] fixed javafx-util-converter tests so that they work in different than US locale.
author Martin Sladecek <martin.sladecek@oracle.com>
date Tue, 22 May 2012 12:50:37 +0200
parents 57217d4635f1
children a8d091314db7
files javafx-util-converter/test/javafx/util/converter/CurrencyStringConverterTest.java javafx-util-converter/test/javafx/util/converter/TimeStringConverterTest.java
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-util-converter/test/javafx/util/converter/CurrencyStringConverterTest.java	Wed May 16 18:10:31 2012 +0200
+++ b/javafx-util-converter/test/javafx/util/converter/CurrencyStringConverterTest.java	Tue May 22 12:50:37 2012 +0200
@@ -26,6 +26,7 @@
 
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
+import java.util.Currency;
 import java.util.Locale;
 import static org.junit.Assert.*;
 
@@ -107,14 +108,17 @@
      ********************************************************************/    
     
     @Test public void fromString_testValidStringInput() {
+        Locale.setDefault(Locale.US);
         assertEquals(10.32, converter.fromString("$10.32"));
     }
     
     @Test public void fromString_testValidStringInputWithWhiteSpace() {
+        Locale.setDefault(Locale.US);
         assertEquals(10.32, converter.fromString("      $10.32      "));
     }
     
     @Test public void toString_validInput() {
+        Locale.setDefault(Locale.US);
         assertEquals("$10.32", converter.toString(10.32));
     }
 }
--- a/javafx-util-converter/test/javafx/util/converter/TimeStringConverterTest.java	Wed May 16 18:10:31 2012 +0200
+++ b/javafx-util-converter/test/javafx/util/converter/TimeStringConverterTest.java	Tue May 22 12:50:37 2012 +0200
@@ -126,14 +126,17 @@
      ********************************************************************/    
     
     @Test public void fromString_testValidInput() {
+        Locale.setDefault(Locale.US);
         assertEquals(VALID_TIME, converter.fromString(VALID_TIME_STRING));
     }
     
     @Test public void fromString_testValidInputWithWhiteSpace() {
+        Locale.setDefault(Locale.US);
         assertEquals(VALID_TIME, converter.fromString("      " + VALID_TIME_STRING + "      "));
     }
     
     @Test public void toString_validInput() {
+        Locale.setDefault(Locale.US);
         assertEquals(VALID_TIME_STRING, converter.toString(VALID_TIME));
     }
 }