myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r592013 - in /myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert: NumberConverterTestCase.java TrinidadNumberConverterTest.java
Date Mon, 05 Nov 2007 14:31:18 GMT
Author: matzew
Date: Mon Nov  5 06:31:18 2007
New Revision: 592013

URL: http://svn.apache.org/viewvc?rev=592013&view=rev
Log:
added test-case for France Locale and currency.

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
    myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/TrinidadNumberConverterTest.java

Modified: myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java?rev=592013&r1=592012&r2=592013&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/NumberConverterTestCase.java
Mon Nov  5 06:31:18 2007
@@ -205,6 +205,29 @@
     }
   }
 
+  public void testFranceLocale()
+  {
+    NumberConverter converter = getNumberConverter();
+    Mock mock = mock(UIComponent.class);
+    UIComponent comp = (UIComponent) mock.proxy();
+    
+    converter.setLocale(Locale.FRANCE);
+    converter.setType("currency");
+    Double d = new Double(12345.68d);
+    
+    setFacesContext(facesContext);
+    try
+    {
+      String convertedString = converter.getAsString(facesContext, comp, d);
+      assertEquals("12 345,68 €", convertedString);
+    }
+    finally
+    {
+      setFacesContext(null);
+    }
+    mock.verify();
+  }
+  
   public void testCurrencyCodeIsHonoured()
   {
     NumberConverter converter = getNumberConverter();

Modified: myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/TrinidadNumberConverterTest.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/TrinidadNumberConverterTest.java?rev=592013&r1=592012&r2=592013&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/TrinidadNumberConverterTest.java
(original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-api/src/test/java/org/apache/myfaces/trinidad/convert/TrinidadNumberConverterTest.java
Mon Nov  5 06:31:18 2007
@@ -88,6 +88,17 @@
     super.testCurrencyCodeIsHonoured();
   }
 
+  @Override
+  public void testFranceLocale()
+  {
+    DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.FRANCE);
+    _mafct.setDecimalSeparator(symbols.getMonetaryDecimalSeparator());
+    _mafct.setNumberGroupingSeparator(symbols.getGroupingSeparator());
+  
+    super.testFranceLocale();
+  }
+  
+
   public void testValueSetInRequestContextIsHonoured()
   {
     //ugly ?



Mime
View raw message