You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2011/02/22 21:26:07 UTC
svn commit: r1073487 -
/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java
Author: ggregory
Date: Tue Feb 22 20:26:07 2011
New Revision: 1073487
URL: http://svn.apache.org/viewvc?rev=1073487&view=rev
Log:
Clean up tests after debugging session.
Modified:
commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java
Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java?rev=1073487&r1=1073486&r2=1073487&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java (original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/ColognePhoneticTest.java Tue Feb 22 20:26:07 2011
@@ -93,42 +93,11 @@ public class ColognePhoneticTest extends
}
public void testExamples() {
- String[][] data = {{"Müller-Lüdenscheidt", "65752682"}, {"Breschnew", "17863"}, {"Wikipedia", "3412"}};
- this.checkEncodings(data);
- }
-
- public void testHyphen() {
- this.checkEncoding("174845214", "bergisch-gladbach");
- // From the Javadoc example:
- this.checkEncoding("65752682", "Müller-Lüdenscheidt");
- }
-
- public void testIsCologneEquals() {
- Assert.assertFalse("Cologne-phonetic encodings should not be equal", this.colognePhonetic.isCologneEqual("Meyer", "Müller"));
- Assert.assertTrue("Cologne-phonetic encodings should be equal", this.colognePhonetic.isCologneEqual("Meyer", "Mayr"));
- }
-
- public void testIsCologneEqualsPhpData() {
- String[][] data = {
- {"house", "house"},
- {"House", "house"},
- {"Haus", "house"},
- {"ganz", "Gans"},
- {"ganz", "Gänse"},
- {"Miyagi", "Miyako"}};
- for (int i = 0; i < data.length; i++) {
- this.colognePhonetic.isCologneEqual(data[i][1], data[i][0]);
- }
- }
-
- /**
- * Test data from http://repo.magdev.de/src/Text_ColognePhonetic-0.2.2/test/Text_ColognePhoneticTest.php
- */
- public void testPhpData() {
String[][] data = {
+ {"Breschnew", "17863"},
+ {"Wikipedia", "3412"},
{"peter", "127"},
{"pharma", "376"},
- {"bergisch-gladbach", "174845214"},
{"mönchengladbach", "64645214"},
{"deutsch", "28"},
{"deutz", "28"},
@@ -143,9 +112,31 @@ public class ColognePhoneticTest extends
{"Arbeitsamt", "071862"},
{"Eberhard", "0172"},
{"Eberhardt", "0172"},
- {"heithabu", "021"},
- {"Müller-Lüdenscheidt", "65752682"},};
+ {"heithabu", "021"}};
+ this.checkEncodings(data);
+ }
+
+ public void testHyphen() {
+ String[][] data = {{"bergisch-gladbach", "174845214"}, {"Müller-Lüdenscheidt", "65752682"},
+ // From the Javadoc example:
+ {"Müller-Lüdenscheidt", "65752682"}};
this.checkEncodings(data);
+
+ }
+
+ public void testIsCologneEquals() {
+ String[][] data = {
+ {"Meyer", "Müller"},
+ {"Meyer", "Mayr"},
+ {"house", "house"},
+ {"House", "house"},
+ {"Haus", "house"},
+ {"ganz", "Gans"},
+ {"ganz", "Gänse"},
+ {"Miyagi", "Miyako"}};
+ for (int i = 0; i < data.length; i++) {
+ this.colognePhonetic.isCologneEqual(data[i][1], data[i][0]);
+ }
}
public void testVariations() {