Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 64577 invoked from network); 13 Jan 2006 22:17:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jan 2006 22:17:03 -0000 Received: (qmail 77574 invoked by uid 500); 13 Jan 2006 22:17:02 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 77542 invoked by uid 500); 13 Jan 2006 22:17:02 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 77531 invoked by uid 99); 13 Jan 2006 22:17:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jan 2006 14:17:02 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 13 Jan 2006 14:17:01 -0800 Received: (qmail 64384 invoked by uid 65534); 13 Jan 2006 22:16:40 -0000 Message-ID: <20060113221640.64381.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: harmony-commits@incubator.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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; + } + +}