1 7 package com.inversoft.util.search.test; 8 9 10 import junit.framework.TestCase; 11 12 import com.inversoft.util.search.DefaultSearchMethod; 13 import com.inversoft.util.search.SearchMethod; 14 15 16 public class SearchMethodTest extends TestCase { 17 18 21 public SearchMethodTest(String name) { 22 super(name); 23 } 24 25 28 public void testDefault() { 29 String name = "foo.bar.goo"; 30 SearchMethod def = new DefaultSearchMethod(); 31 32 assertEquals("foo.bar.goo", name); 33 name = def.nextSearchName(name); 34 assertEquals("foo.goo", name); 35 name = def.nextSearchName(name); 36 assertEquals("goo", name); 37 } 38 39 42 public void testNoDot() { 43 String name = "foo"; 44 SearchMethod def = new DefaultSearchMethod(); 45 46 assertNull(def.nextSearchName(name)); 47 } 48 } 49 | Popular Tags |