Package org.apache.cxf.test
Class AbstractCXFTest
- java.lang.Object
-
- org.apache.cxf.test.AbstractCXFTest
-
- Direct Known Subclasses:
AbstractCXFSpringTest
public abstract class AbstractCXFTest extends Object
A basic test case meant for helping users unit test their services.- See Also:
TestUtilities
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.cxf.Bus
bus
protected TestUtilities
testUtilities
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCXFTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNamespace(String ns, String uri)
Add a namespace that will be used for XPath expressions.NodeList
assertInvalid(String xpath, Node node)
Assert that the following XPath query selects no nodes.void
assertNoFault(Node node)
Assert that this node is not a SOAP fault part.NodeList
assertValid(String xpath, Node node)
Assert that the following XPath query selects one or more nodes.void
assertValidBoolean(String xpath, Node node)
Assert that the following XPath query selects a boolean value.void
assertXPathEquals(String xpath, String value, Node node)
Assert that the text of the xpath node retrieved is equal to the value specified.void
assertXPathEquals(String xpath, QName value, Node node)
Assert that the text of the xpath node retrieved is equal to the value specified.protected org.apache.cxf.Bus
createBus()
static String
getBasedir()
org.apache.cxf.Bus
getBus()
NamespaceContext
getNamespaceContext()
Map<String,String>
getNamespaces()
protected Reader
getResourceAsReader(String resource)
protected InputStream
getResourceAsStream(String resource)
File
getTestFile(String relativePath)
protected Document
getWSDLDocument(org.apache.cxf.endpoint.Server server)
protected Node
invoke(String address, String transport, String message)
protected byte[]
invokeBytes(String address, String transport, String message)
void
setUpBus()
void
shutdownBus()
-
-
-
Field Detail
-
testUtilities
protected TestUtilities testUtilities
-
bus
protected org.apache.cxf.Bus bus
-
-
Method Detail
-
getBus
public org.apache.cxf.Bus getBus()
-
shutdownBus
public void shutdownBus()
-
createBus
protected org.apache.cxf.Bus createBus() throws org.apache.cxf.BusException
- Throws:
org.apache.cxf.BusException
-
invokeBytes
protected byte[] invokeBytes(String address, String transport, String message) throws Exception
- Throws:
Exception
-
invoke
protected Node invoke(String address, String transport, String message) throws Exception
- Throws:
Exception
-
assertValid
public NodeList assertValid(String xpath, Node node) throws Exception
Assert that the following XPath query selects one or more nodes.- Parameters:
xpath
-- Throws:
Exception
-
assertValidBoolean
public void assertValidBoolean(String xpath, Node node) throws Exception
Assert that the following XPath query selects a boolean value.- Parameters:
xpath
-- Throws:
Exception
-
assertInvalid
public NodeList assertInvalid(String xpath, Node node) throws Exception
Assert that the following XPath query selects no nodes.- Parameters:
xpath
-- Throws:
Exception
-
assertXPathEquals
public void assertXPathEquals(String xpath, String value, Node node) throws Exception
Assert that the text of the xpath node retrieved is equal to the value specified.- Parameters:
xpath
-value
-node
-- Throws:
Exception
-
assertXPathEquals
public void assertXPathEquals(String xpath, QName value, Node node) throws Exception
Assert that the text of the xpath node retrieved is equal to the value specified.- Parameters:
xpath
-value
-node
-- Throws:
Exception
-
assertNoFault
public void assertNoFault(Node node) throws Exception
Assert that this node is not a SOAP fault part.- Parameters:
node
-- Throws:
Exception
-
addNamespace
public void addNamespace(String ns, String uri)
Add a namespace that will be used for XPath expressions.- Parameters:
ns
- Namespace name.uri
- The namespace uri.
-
getNamespaceContext
public NamespaceContext getNamespaceContext()
-
getResourceAsStream
protected InputStream getResourceAsStream(String resource)
-
getBasedir
public static String getBasedir()
-
getWSDLDocument
protected Document getWSDLDocument(org.apache.cxf.endpoint.Server server) throws javax.wsdl.WSDLException
- Throws:
javax.wsdl.WSDLException
-
-