Skip to content

Commit 13672e9

Browse files
committed
Added test methods to cover MS SQL Server examples inpired by the mention of SQL Server on commons-dev.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130265 13f79535-47bb-0310-9956-ffa450edef68
1 parent 5563aa7 commit 13672e9

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

src/test/org/apache/commons/codec/language/SoundexTest.java

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
/**
6767
* Tests {@link Soundex}
6868
*
69-
* @version $Revision: 1.8 $ $Date: 2003/11/12 19:32:52 $
69+
* @version $Revision: 1.9 $ $Date: 2003/12/04 23:32:39 $
7070
* @author Rodney Waldhoff
7171
* @author Gary Gregory
7272
*/
@@ -326,4 +326,37 @@ public void testMaxLengthLessThan3Fix() throws Exception {
326326
assertEquals("S460", soundex.encode("SCHELLER"));
327327
}
328328

329+
/**
330+
* Examples for MS SQLServer from
331+
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_setu-sus_3o6w.asp
332+
*/
333+
public void testMsSqlServer1() {
334+
assertEquals("S530", this.getEncoder().encode("Smith"));
335+
assertEquals("S530", this.getEncoder().encode("Smythe"));
336+
}
337+
338+
/**
339+
* Examples for MS SQLServer from
340+
* http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q100/3/65.asp&NoWebContent=1
341+
*/
342+
public void testMsSqlServer2() {
343+
this.encodeAll(new String[]{"Erickson", "Erickson", "Erikson", "Ericson", "Ericksen", "Ericsen"}, "E625");
344+
}
345+
346+
/**
347+
* Examples for MS SQLServer from
348+
* http://databases.about.com/library/weekly/aa042901a.htm
349+
*/
350+
public void testMsSqlServer3() {
351+
assertEquals("A500", this.getEncoder().encode("Ann"));
352+
assertEquals("A536", this.getEncoder().encode("Andrew"));
353+
assertEquals("J530", this.getEncoder().encode("Janet"));
354+
assertEquals("M626", this.getEncoder().encode("Margaret"));
355+
assertEquals("S315", this.getEncoder().encode("Steven"));
356+
assertEquals("M240", this.getEncoder().encode("Michael"));
357+
assertEquals("R163", this.getEncoder().encode("Robert"));
358+
assertEquals("L600", this.getEncoder().encode("Laura"));
359+
assertEquals("A500", this.getEncoder().encode("Anne"));
360+
}
361+
329362
}

0 commit comments

Comments
 (0)