harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r371905 - in /incubator/harmony/enhanced/classlib/trunk/modules/text/src: main/java/java/text/BreakIterator.java test/java/org/apache/harmony/tests/java/text/AllTests.java test/java/org/apache/harmony/tests/java/text/BreakIteratorTest.java
Date Tue, 24 Jan 2006 12:33:33 GMT
Author: tellison
Date: Tue Jan 24 04:33:25 2006
New Revision: 371905

URL: http://svn.apache.org/viewcvs?rev=371905&view=rev
Log:
Fix for HARMONY-30 (java.text.BreakIterator.next () returns incorrect value)

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

Modified: incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/BreakIterator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/BreakIterator.java?rev=371905&r1=371904&r2=371905&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/BreakIterator.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/BreakIterator.java
Tue Jan 24 04:33:25 2006
@@ -202,7 +202,7 @@
 	 */
 	public static BreakIterator getWordInstance(Locale where) {
 		return new RuleBasedBreakIterator(com.ibm.icu.text.BreakIterator
-				.getSentenceInstance(where));
+				.getWordInstance(where));
 	}
 
 	/**

Modified: 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=371905&r1=371904&r2=371905&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/AllTests.java
Tue Jan 24 04:33:25 2006
@@ -30,6 +30,7 @@
 				"Test for org.apache.harmony.tests.java.text");
 		//$JUnit-BEGIN$
 		suite.addTestSuite(RuleBasedCollatorTest.class);
+		suite.addTestSuite(BreakIteratorTest.class);
 		//$JUnit-END$
 		return suite;
 	}

Added: incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/BreakIteratorTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/BreakIteratorTest.java?rev=371905&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/BreakIteratorTest.java
(added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/tests/java/text/BreakIteratorTest.java
Tue Jan 24 04:33:25 2006
@@ -0,0 +1,34 @@
+/*
+ * 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.BreakIterator;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+public class BreakIteratorTest extends TestCase {
+
+	public void test_next() {
+		// Regression test for HARMONY-30
+		BreakIterator bi = BreakIterator.getWordInstance(Locale.US);
+		bi.setText("This is the test, WordInstance");
+		int n = bi.first();
+		n = bi.next();
+		assertEquals("Assert 0: next() returns incorrect value ", 4, n);
+	}
+}



Mime
View raw message