You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/02/18 13:49:44 UTC

svn commit: r1731060 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java

Author: lofwyr
Date: Thu Feb 18 12:49:43 2016
New Revision: 1731060

URL: http://svn.apache.org/viewvc?rev=1731060&view=rev
Log:
simplify

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java?rev=1731060&r1=1731059&r2=1731060&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/test/java/org/apache/myfaces/tobago/renderkit/html/JsonUtilsUnitTest.java Thu Feb 18 12:49:43 2016
@@ -29,9 +29,6 @@ import org.apache.myfaces.tobago.util.Cr
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
 import java.util.Locale;
 
 // using ' instead of " to make it better readable.
@@ -112,11 +109,12 @@ public class JsonUtilsUnitTest extends A
   @Test
   public void monthNames() {
     final DateTimeI18n dateTimeI18n = DateTimeI18n.valueOf(Locale.GERMANY);
+    final String marchShort = dateTimeI18n.getMonthNamesShort()[2]; // different with JDK 1.8.0_51 and 1.8.0_60
     final String expected
         = ("{'monthNames':['Januar','Februar','März','April','Mai','Juni',"
         + "'Juli','August','September','Oktober','November','Dezember'],"
         + "'monthNamesShort':['Jan','Feb','"
-        + getMarchShort() + "','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],"
+        + marchShort + "','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],"
         + "'dayNames':['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],"
         + "'dayNamesShort':['So','Mo','Di','Mi','Do','Fr','Sa'],"
         + "'dayNamesMin':['So','Mo','Di','Mi','Do','Fr','Sa'],"
@@ -124,14 +122,4 @@ public class JsonUtilsUnitTest extends A
 
     Assert.assertEquals(expected, JsonUtils.encode(dateTimeI18n));
   }
-
-  /**
-   * The result depends on the JAVA Version: 7 differs to 8.
-   */
-  private String getMarchShort() {
-    final Calendar cal = GregorianCalendar.getInstance();
-    cal.set(2000, GregorianCalendar.MARCH, 15);
-    return new SimpleDateFormat("MMM").format(cal.getTime());
-  }
-
 }