harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r368878 - in /incubator/harmony/enhanced/classlib/trunk/modules/text/src: main/java/java/text/ test/java/org/ test/java/org/apache/ test/java/org/apache/harmony/ test/java/org/apache/harmony/tests/ test/java/org/apache/harmony/tests/java/ t...
Date Fri, 13 Jan 2006 22:16:38 GMT
Author: tellison
Date: Fri Jan 13 14:16:23 2006
New Revision: 368878

URL: http://svn.apache.org/viewcvs?rev=368878&view=rev
Log:
Fix for Harmony-28 (java.text.RuleBasedCollator. getCollationKey (null) does not return null)
plus associated test infrastructure

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/AllTests.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java?rev=368878&r1=368877&r2=368878&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/RuleBasedCollator.java
Fri Jan 13 14:16:23 2006
@@ -152,7 +152,9 @@
 	public CollationKey getCollationKey(String source) {
 		com.ibm.icu.text.CollationKey icuKey = this.icuColl
 				.getCollationKey(source);
-
+		if (icuKey == null) {
+			return null;
+		}
 		return new CollationKey(source, icuKey);
 	}
 

Added: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java?rev=368878&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
Fri Jan 13 14:16:23 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.harmony.tests.java.text;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static void main(String[] args) {
+		junit.textui.TestRunner.run(AllTests.suite());
+	}
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for org.apache.harmony.tests.java.text");
+		//$JUnit-BEGIN$
+		suite.addTestSuite(RuleBasedCollatorTest.class);
+		//$JUnit-END$
+		return suite;
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java?rev=368878&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/RuleBasedCollatorTest.java
Fri Jan 13 14:16:23 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.harmony.tests.java.text;
+
+import java.text.CollationKey;
+import java.text.ParseException;
+import java.text.RuleBasedCollator;
+
+import junit.framework.TestCase;
+
+public class RuleBasedCollatorTest extends TestCase {
+
+	public void test_getCollationKeyLjava_lang_String() {
+		// Regression test for HARMONY-28
+		String source = null;
+		RuleBasedCollator rbc = null;
+		try {
+			String Simple = "< a< b< c< d";
+			rbc = new RuleBasedCollator(Simple);
+		} catch (ParseException e) {
+			fail("Assert 0: Unexpected format exception " + e);
+		}
+		CollationKey ck = rbc.getCollationKey(source);
+		assertNull("Assert 1: getCollationKey (null) does not return null", ck);
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/AllTests.java?rev=368878&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/AllTests.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/text/AllTests.java
Fri Jan 13 14:16:23 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.harmony.tests.text;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static void main(String[] args) {
+		junit.textui.TestRunner.run(AllTests.suite());
+	}
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for org.apache.harmony.tests.text");
+		//$JUnit-BEGIN$
+		suite.addTest(org.apache.harmony.tests.java.text.AllTests.suite());
+		//$JUnit-END$
+		return suite;
+	}
+
+}



Mime
View raw message