You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/09/22 17:27:40 UTC

svn commit: r1388818 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java

Author: sebb
Date: Sat Sep 22 15:27:40 2012
New Revision: 1388818

URL: http://svn.apache.org/viewvc?rev=1388818&view=rev
Log:
LANG-799 - DateUtils#parseDate uses default locale; add Locale support
Remove unnecessary test

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java?rev=1388818&r1=1388817&r2=1388818&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java Sat Sep 22 15:27:40 2012
@@ -31,15 +31,12 @@ import java.lang.reflect.Modifier;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.NoSuchElementException;
-import java.util.Set;
 import java.util.TimeZone;
 
 import junit.framework.AssertionFailedError;
@@ -1619,37 +1616,6 @@ public class DateUtilsTest {
     }
     
     /**
-     * Tests that an IllegalArgumentException is thrown if the
-     * locale supplied is not supported by the DateFormat class
-     * hierarchy. Note: this test is likely to pass without testing
-     * the behaviour, as typically all locales are supported.
-     * 
-     * @throws Exception
-     */
-    @Test(expected=IllegalArgumentException.class)
-    public void testParseBadLocale() throws Exception {
-        Set<Locale> availableLocales = new HashSet<Locale>(
-                Arrays.asList(Locale.getAvailableLocales()));
-        
-        Set<Locale> dateLocales = new HashSet<Locale>(
-                Arrays.asList(DateFormat.getAvailableLocales()));
-
-        Set<Locale> intersection = new HashSet<Locale>(availableLocales);
-        intersection.retainAll(dateLocales);
-        availableLocales.removeAll(intersection);
-        
-        // availableLocales now contains only those Locales that are
-        // not supported by the DateFormat class hierarchy. Could be
-        // empty, in which case we skip the test.
-        assumeTrue(availableLocales.size() > 0);
-        
-        Locale invalidLocale = availableLocales.iterator().next();
-        
-        String[] parsers = {"yyyy"};        
-        DateUtils.parseDate("foo", invalidLocale, parsers);         
-    }
-    
-    /**
      * Retrieves a non-system locale date pattern string and attempts
      * to use it.
      *