FileDocCategorySizeDatePackage
SearchTest.javaAPI DocExample2289Wed Jul 16 16:20:38 BST 2003com.develop.ss.httpunit

SearchTest

public class SearchTest extends TestCase

Fields Summary
private com.meterware.httpunit.WebConversation
conversation
private com.develop.ss.test.ConfigBean
config
Constructors Summary
public SearchTest(String name)


     
    super(name);
  
Methods Summary
public voiddoTestFindOccurences(java.lang.String searchString, int expected)

    WebResponse searchPage = conversation.getResponse(config.getSearchJspUrl());
    WebForm webForm = searchPage.getForms()[0];
    webForm.setParameter("query", searchString);
    WebResponse responsePage = webForm.submit();
    WebLink[] links = responsePage.getLinks();
    assertEquals(expected, links.length);
  
protected voidsetUp()

    config = new ConfigBean();
  
public voidtestFindMany()

    doTestFindOccurences("SPIDER", 3);
  
public voidtestFindNada()

    doTestFindOccurences("nada", 0);
  
public voidtestFindOne()

    doTestFindOccurences("one", 1);