FileDocCategorySizeDatePackage
ClientTest.javaAPI DocExample2379Wed Jul 16 16:09:08 BST 2003com.develop.ss.axis

ClientTest

public class ClientTest extends TestCase

Fields Summary
private com.develop.ss.test.ConfigBean
config
Constructors Summary
public ClientTest(String name)

    super(name);
  
Methods Summary
private ResponseType[]doQuery(java.lang.String queryString)

    return doQuery(queryString, 0.0f);
  
private ResponseType[]doQuery(java.lang.String queryString, float threshold)

    SiteSearchServiceLocator locator = new SiteSearchServiceLocator();
    SiteSearch siteSearchSoap = locator.getSiteSearchSoap(new URL(config.getWebServiceEndpoint()));
    QueryType query = new QueryType();
    query.setSeachString(queryString);
    query.setThreshold(threshold);
    return siteSearchSoap.searchContents(query);
  
protected voidsetUp()

    super.setUp();
    config = new ConfigBean();
  
public voidtestEmptyResult()

    ResponseType[] resp = doQuery("nada");
    //bit surprised that this marshals to null instead of an empty array
    assertNull(resp);
  
public voidtestEndpointExists()

    URL url = new URL(config.getWebServiceEndpoint());
    Object o = url.getContent();
  
public voidtestMultipleResults()

    ResponseType[] resp = doQuery("spider");
    assertNotNull(resp);
    assertEquals("result is one because Axis marshalling broken, should be 3", 1, resp.length);
    //TODO: Axis marshalling appears broken, the pipe is returning three but Axis only gets the first
    //assertEquals(3, resp.length);
  
public voidtestOneResult()

    ResponseType[] resp = doQuery("one");
    assertNotNull(resp);
    assertEquals(1, resp.length);
  
public voidtestThreshold()

    ResponseType[] resp = doQuery("one", 1.0f);
    assertNull("no result should have match threshold of 1.0", resp);
  
public voidtestWSDLEndpointExists()

    URL url = new URL(config.getWebServiceWsdl());
    Object o = url.getContent();