org.codehaus.xfire.plexus
Class PlexusXFireTest

java.lang.Object
  extended by PlexusTestCase
      extended by org.codehaus.xfire.plexus.PlexusXFireTest

public class PlexusXFireTest
extends PlexusTestCase

Contains helpful methods to test SOAP services.

Author:
Dan Diephouse

Constructor Summary
PlexusXFireTest()
           
 
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  java.io.Reader getResourceAsReader(java.lang.String resource)
           
protected  java.io.InputStream getResourceAsStream(java.lang.String resource)
           
 ServiceFactory getServiceFactory()
           
protected  ServiceRegistry getServiceRegistry()
           
protected  WSDLWriter getWSDL(java.lang.String service)
          Get the WSDL for a service.
protected  Document getWSDLDocument(java.lang.String service)
           
protected  XFire getXFire()
           
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
 

Constructor Detail

PlexusXFireTest

public PlexusXFireTest()
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

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()

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

getServiceFactory

public ServiceFactory getServiceFactory()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

setServiceFactory

public void setServiceFactory(ServiceFactory factory)

getResourceAsStream

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

getResourceAsReader

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

getXFire

protected XFire getXFire()
                  throws java.lang.Exception
Throws:
java.lang.Exception

getServiceRegistry

protected ServiceRegistry getServiceRegistry()
                                      throws java.lang.Exception
Throws:
java.lang.Exception


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