harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r407050 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni: make/common/build.xml src/main/java/java/util/Locale.java src/test/java/tests/api/java/util/LocaleTest.java
Date Tue, 16 May 2006 20:33:00 GMT
Author: gharley
Date: Tue May 16 13:32:59 2006
New Revision: 407050

URL: http://svn.apache.org/viewcvs?rev=407050&view=rev
Log:
HARMONY 453 : Fix some locale-dependent test cases in tests.api.java.util.LocaleTest

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/LocaleTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml?rev=407050&r1=407049&r2=407050&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/make/common/build.xml Tue May 16
13:32:59 2006
@@ -128,7 +128,6 @@
                     <exclude name="tests/api/java/net/URLClassLoaderTest.java" />
                     <exclude name="tests/api/java/net/URLConnectionTest.java" />
                     <exclude name="tests/api/java/net/URLTest.java" />
-                    <exclude name="tests/api/java/util/LocaleTest.java" />
                 </fileset>
             </batchtest>
         </junit>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java?rev=407050&r1=407049&r2=407050&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
Tue May 16 13:32:59 2006
@@ -220,7 +220,7 @@
 		else if (languageCode.equals("yi")) //$NON-NLS-1$
 			languageCode = "ji"; //$NON-NLS-1$
 		countryCode = country.toUpperCase();
-		variantCode = variant.toUpperCase();
+		variantCode = variant;
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/LocaleTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/LocaleTest.java?rev=407050&r1=407049&r2=407050&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/LocaleTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/LocaleTest.java
Tue May 16 13:32:59 2006
@@ -22,6 +22,8 @@
 	Locale testLocale;
 
 	Locale l;
+	
+	Locale defaultLocale;
 
 	/**
 	 * @tests java.util.Locale#Locale(java.lang.String, java.lang.String)
@@ -128,10 +130,9 @@
 	public void test_getDisplayLanguage() {
 		// Test for method java.lang.String
 		// java.util.Locale.getDisplayLanguage()
-		Locale l = new Locale("fr", "CA", "WIN32");
 		assertTrue("Returned incorrect language: "
-				+ testLocale.getDisplayLanguage(l), testLocale
-				.getDisplayLanguage(l).equals("anglais"));
+				+ testLocale.getDisplayLanguage(), testLocale
+				.getDisplayLanguage().equals("English"));
 	}
 
 	/**
@@ -141,8 +142,8 @@
 		// Test for method java.lang.String
 		// java.util.Locale.getDisplayLanguage(java.util.Locale)
 		assertTrue("Returned incorrect language: "
-				+ testLocale.getDisplayLanguage(), testLocale
-				.getDisplayLanguage().equals("English"));
+				+ testLocale.getDisplayLanguage(l), testLocale
+				.getDisplayLanguage(l).equals("anglais"));
 	}
 
 	/**
@@ -309,7 +310,8 @@
 	 * is called before a test is executed.
 	 */
 	protected void setUp() {
-
+		defaultLocale = Locale.getDefault();
+		Locale.setDefault(Locale.US);
 		testLocale = new Locale("en", "CA", "WIN32");
 		l = new Locale("fr", "CA", "WIN32");
 	}
@@ -319,5 +321,6 @@
 	 * method is called after a test is executed.
 	 */
 	protected void tearDown() {
+		Locale.setDefault(defaultLocale);
 	}
 }



Mime
View raw message