Skip to content

Commit ce66f92

Browse files
committed
[CODEC-125] Implement a Beider-Morse phonetic matching codec. Fix test method names.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1151455 13f79535-47bb-0310-9956-ffa450edef68
1 parent 479b5d3 commit ce66f92

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/test/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,49 +38,49 @@ protected StringEncoder createStringEncoder() {
3838
}
3939

4040
@Test(expected = IllegalStateException.class)
41-
public void invalidLangResourceShouldRaiseException() {
41+
public void testInvalidLangIllegalStateException() {
4242
Lang.loadFromResource("thisIsAMadeUpResourceName", Languages.instance(NameType.GENERIC));
4343
}
4444

4545
@Test(expected = IllegalArgumentException.class)
46-
public void invalidLangShouldRaiseException() {
46+
public void testInvalidLangIllegalArgumentException() {
4747
Rule.instance(NameType.GENERIC, RuleType.APPROX, "noSuchLanguage");
4848
}
4949

5050
@Test(expected = IllegalArgumentException.class)
51-
public void invalidLanguageResourceShouldRaiseException() {
51+
public void testInvalidLanguageIllegalArgumentException() {
5252
Languages.instance("thereIsNoSuchLanguage");
5353
}
5454

5555
@Test(expected = IndexOutOfBoundsException.class)
56-
public void negativeIndexForRuleMatchShouldRaiseException() {
56+
public void testNegativeIndexForRuleMatchIndexOutOfBoundsException() {
5757
Rule r = new Rule("a", "", "", "", Collections.<String> emptySet(), "bob");
5858
r.patternAndContextMatches("bob", -1);
5959
}
6060

6161
@Test
62-
public void setConcat() {
62+
public void testSetConcat() {
6363
BeiderMorseEncoder bmpm = new BeiderMorseEncoder();
6464
bmpm.setConcat(false);
6565
assertEquals("Should be able to set concat to false", false, bmpm.isConcat());
6666
}
6767

6868
@Test
69-
public void setNameTypeAsh() {
69+
public void testSetNameTypeAsh() {
7070
BeiderMorseEncoder bmpm = new BeiderMorseEncoder();
7171
bmpm.setNameType(NameType.ASHKENAZI);
7272
assertEquals("Name type should have been set to ash", NameType.ASHKENAZI, bmpm.getNameType());
7373
}
7474

7575
@Test
76-
public void setRuleTypeExact() {
76+
public void testSetRuleTypeExact() {
7777
BeiderMorseEncoder bmpm = new BeiderMorseEncoder();
7878
bmpm.setRuleType(RuleType.EXACT);
7979
assertEquals("Rule type should have been set to exact", RuleType.EXACT, bmpm.getRuleType());
8080
}
8181

8282
@Test(expected = IllegalArgumentException.class)
83-
public void setRuleTypeToRulesShouldRaiseException() {
83+
public void testSetRuleTypeToRulesIllegalArgumentException() {
8484
BeiderMorseEncoder bmpm = new BeiderMorseEncoder();
8585
bmpm.setRuleType(RuleType.RULES);
8686
}

src/test/org/apache/commons/codec/language/bm/PhoneticTest.java renamed to src/test/org/apache/commons/codec/language/bm/PhoneticEngineTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @since 2.0
3434
*/
3535
@RunWith(Parameterized.class)
36-
public class PhoneticTest {
36+
public class PhoneticEngineTest {
3737

3838
@Parameterized.Parameters
3939
public static List<Object[]> data() {
@@ -57,7 +57,7 @@ public static List<Object[]> data() {
5757
private final String phoneticExpected;
5858
private final RuleType ruleType;
5959

60-
public PhoneticTest(String name, String phoneticExpected, NameType nameType, RuleType ruleType, boolean concat) {
60+
public PhoneticEngineTest(String name, String phoneticExpected, NameType nameType, RuleType ruleType, boolean concat) {
6161
this.name = name;
6262
this.phoneticExpected = phoneticExpected;
6363
this.nameType = nameType;

0 commit comments

Comments
 (0)