FileDocCategorySizeDatePackage
JwsTest.javaAPI DocApache Axis 1.44459Sat Apr 22 18:57:26 BST 2006test.httpunit

JwsTest

public class JwsTest extends HttpUnitTestBase
test for JWS pages being processed
author
Steve Loughran
created
Jul 10, 2002 12:09:20 AM

Fields Summary
Constructors Summary
public JwsTest(String name)

        super(name);
    
Methods Summary
public voidtestAxisFaultIsXML()
axis faults.

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders.jws");
        request.setParameter("method", "throwAxisFault");
        request.setParameter("param", "oops!");
        expectErrorCode(request, 500,
            "<faultcode>soapenv:Server.generalException</faultcode>");
    
public voidtestEchoHeaders()

        WebRequest request = new GetMethodWebRequest(url + "/EchoHeaders.jws");
        assertStringInBody(request, "Web Service");
    
public voidtestEchoHeadersEcho()
send an echo with a space down

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders.jws");
        request.setParameter("method","echo");
        request.setParameter("param", "foo bar");
        assertStringInBody(request, "foo bar");
    
public voidtestEchoHeadersList()
do we get a list of headers back?

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders.jws");
        request.setHeaderField("x-header","echo-header-test");
        request.setParameter("method", "list");
        assertStringInBody(request, "echo-header-test");
    
public voidtestEchoHeadersWhoami()
see that we get a hello back

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders.jws");
        request.setParameter("method", "whoami");
        assertStringInBody(request, "Hello");
    
public voidtestEchoHeadersWsdl()

        WebRequest request = new GetMethodWebRequest(url + "/EchoHeaders.jws?wsdl");
        assertStringInBody(request, "<wsdl:definitions");
    
public voidtestExceptionIsXML()
exceptions are user faults

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders.jws");
        request.setParameter("method", "throwAxisFault");
        request.setParameter("param", "oops!");
        expectErrorCode(request, 500,
                "<faultcode>soapenv:Server.userException</faultcode>");
    
public voidtestMissingJWSRaisesException()
we throw an error on missing JWS pages

throws
Exception

        WebRequest request = new GetMethodWebRequest(url
                + "/EchoHeaders-not-really-there.jws");
        expectErrorCode(request,404, "No service");
    
public voidtestStockQuote()

        WebRequest request = new GetMethodWebRequest(url+"/StockQuoteService.jws?wsdl");
        assertStringInBody(request,"<wsdl:definitions");