org.codehaus.xfire.test
Class AbstractXFireTest

java.lang.Object
  extended by TestCase
      extended by org.codehaus.xfire.test.AbstractXFireTest
Direct Known Subclasses:
AbstractServletTest, PicoXFireTest

public abstract class AbstractXFireTest
extends TestCase

Contains helpful methods to test SOAP services.

Author:
Dan Diephouse

Nested Class Summary
protected static class AbstractXFireTest.CopySerializer
           
 
Field Summary
static java.lang.String RESPONSE
           
 
Constructor Summary
AbstractXFireTest()
           
 
Method Summary
 void addNamespace(java.lang.String ns, java.lang.String uri)
          Add a namespace that will be used for XPath expressions.
 java.util.List assertInvalid(java.lang.String xpath, java.lang.Object node)
          Assert that the following XPath query selects no nodes.
 void assertNoFault(Document node)
           
 java.util.List assertValid(java.lang.String xpath, java.lang.Object node)
          Assert that the following XPath query selects one or more nodes.
 void assertXPathEquals(java.lang.String xpath, java.lang.String value, Document node)
          Asser that the text of the xpath node retrieved is equal to the value specified.
protected  void createSession()
           
static java.lang.String getBasedir()
           
protected  java.io.Reader getResourceAsReader(java.lang.String resource)
           
protected  java.io.InputStream getResourceAsStream(java.lang.String resource)
           
 ServiceFactory getServiceFactory()
           
protected  ServiceRegistry getServiceRegistry()
           
protected  Session getSession()
           
 java.io.File getTestFile(java.lang.String relativePath)
           
protected  TransportManager getTransportManager()
           
protected  WSDLWriter getWSDL(java.lang.String service)
          Get the WSDL for a service.
protected  Document getWSDLDocument(java.lang.String service)
           
protected  XFire getXFire()
           
protected  XFireProxyFactory getXFireProxyFactory()
           
protected  InMessage invokeService(OutMessage msg, java.lang.String transportID)
           
protected  Document invokeService(java.lang.String service, java.lang.String document)
          Invoke a service with the specified document.
protected  void printNode(Document node)
           
protected  Document readDocument(java.lang.String text)
           
protected  Document readDocument(java.lang.String text, XMLInputFactory ifactory)
           
 void setServiceFactory(ServiceFactory factory)
           
protected  void setUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESPONSE

public static final java.lang.String RESPONSE
See Also:
Constant Field Values
Constructor Detail

AbstractXFireTest

public AbstractXFireTest()
Method Detail

printNode

protected void printNode(Document node)
                  throws java.lang.Exception
Throws:
java.lang.Exception

invokeService

protected Document invokeService(java.lang.String service,
                                 java.lang.String document)
                          throws java.lang.Exception
Invoke a service with the specified document.

Parameters:
service - The name of the service.
document - The request as an xml document in the classpath.
Throws:
java.lang.Exception

invokeService

protected InMessage invokeService(OutMessage msg,
                                  java.lang.String transportID)
                           throws java.lang.Exception
Throws:
java.lang.Exception

readDocument

protected Document readDocument(java.lang.String text)
                         throws XMLStreamException
Throws:
XMLStreamException

readDocument

protected Document readDocument(java.lang.String text,
                                XMLInputFactory ifactory)
                         throws XMLStreamException
Throws:
XMLStreamException

getWSDLDocument

protected Document getWSDLDocument(java.lang.String service)
                            throws java.lang.Exception
Throws:
java.lang.Exception

setUp

protected void setUp()
              throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
junit.framework.TestCase#setUp()

createSession

protected void createSession()

assertValid

public java.util.List assertValid(java.lang.String xpath,
                                  java.lang.Object node)
                           throws java.lang.Exception
Assert that the following XPath query selects one or more nodes.

Parameters:
xpath -
Throws:
java.lang.Exception

assertInvalid

public java.util.List assertInvalid(java.lang.String xpath,
                                    java.lang.Object node)
                             throws java.lang.Exception
Assert that the following XPath query selects no nodes.

Parameters:
xpath -
Throws:
java.lang.Exception

assertXPathEquals

public void assertXPathEquals(java.lang.String xpath,
                              java.lang.String value,
                              Document node)
                       throws java.lang.Exception
Asser that the text of the xpath node retrieved is equal to the value specified.

Parameters:
xpath -
value -
node -
Throws:
java.lang.Exception

assertNoFault

public void assertNoFault(Document node)
                   throws java.lang.Exception
Throws:
java.lang.Exception

addNamespace

public void addNamespace(java.lang.String ns,
                         java.lang.String uri)
Add a namespace that will be used for XPath expressions.

Parameters:
ns - Namespace name.
uri - The namespace uri.

getWSDL

protected WSDLWriter getWSDL(java.lang.String service)
                      throws java.lang.Exception
Get the WSDL for a service.

Parameters:
service - The name of the service.
Throws:
java.lang.Exception

getSession

protected Session getSession()

getXFire

protected XFire getXFire()

getTransportManager

protected TransportManager getTransportManager()

getServiceRegistry

protected ServiceRegistry getServiceRegistry()

getServiceFactory

public ServiceFactory getServiceFactory()

setServiceFactory

public void setServiceFactory(ServiceFactory factory)

getXFireProxyFactory

protected XFireProxyFactory getXFireProxyFactory()

getResourceAsStream

protected java.io.InputStream getResourceAsStream(java.lang.String resource)

getResourceAsReader

protected java.io.Reader getResourceAsReader(java.lang.String resource)

getTestFile

public java.io.File getTestFile(java.lang.String relativePath)

getBasedir

public static java.lang.String getBasedir()


Copyright © 2004-2006 Envoi Solutions LLC. All Rights Reserved.