|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.test.TestUtilities
public class TestUtilities
This class provides unit test support for tests that look at generated WSDL contents, as well as some test methods for invoking services.
Nested Class Summary | |
---|---|
static class |
TestUtilities.TestMessageObserver
|
Field Summary | |
---|---|
protected Bus |
bus
|
protected Class<?> |
classpathAnchor
|
Constructor Summary | |
---|---|
TestUtilities(Class<?> classpathReference)
This class provides utilities to several conflicting inheritance stacks of test support. |
Method Summary | |
---|---|
void |
addDefaultNamespaces()
|
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 body. |
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. |
static String |
getBasedir()
|
Bus |
getBus()
Return the CXF bus used. |
Map<String,String> |
getNamespaces()
retrieve the entire namespace map. |
Reader |
getResourceAsReader(String resource)
|
InputStream |
getResourceAsStream(String resource)
|
XMLStreamReader |
getResourceAsXMLStreamReader(String resource)
|
Server |
getServerForAddress(String address)
|
Server |
getServerForService(QName serviceName)
|
File |
getTestFile(String relativePath)
|
javax.wsdl.Definition |
getWSDLDefinition(Server server)
Return a WSDL definition model for a server. |
Document |
getWSDLDocument(Server server)
Return a DOM tree for the WSDL for a server. |
Node |
invoke(String address,
String transport,
byte[] message)
|
Node |
invoke(String address,
String transport,
String message)
|
byte[] |
invokeBytes(String address,
String transport,
byte[] message)
|
byte[] |
invokeBytes(String address,
String transport,
String message)
|
static void |
recoverKeepAliveSystemProperty()
|
String |
resolveNamespacePrefix(String prefix,
Node node)
Handy function for checking correctness of qualifies names in schema attribute values. |
void |
setBus(Bus bus)
Set the CXF bus. |
static void |
setKeepAliveSystemProperty(boolean setAlive)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Bus bus
protected Class<?> classpathAnchor
Constructor Detail |
---|
public TestUtilities(Class<?> classpathReference)
classpathReference
- Method Detail |
---|
public static void setKeepAliveSystemProperty(boolean setAlive)
public static void recoverKeepAliveSystemProperty()
public void addDefaultNamespaces()
public String resolveNamespacePrefix(String prefix, Node node) throws Exception
prefix
- node
-
Exception
public NodeList assertValid(String xpath, Node node) throws Exception
xpath
-
Exception
public void assertValidBoolean(String xpath, Node node) throws Exception
xpath
-
Exception
public NodeList assertInvalid(String xpath, Node node) throws Exception
xpath
-
Exception
public void assertXPathEquals(String xpath, String value, Node node) throws Exception
xpath
- value
- node
-
Exception
public void assertNoFault(Node node) throws Exception
node
-
Exception
public byte[] invokeBytes(String address, String transport, String message) throws Exception
Exception
public byte[] invokeBytes(String address, String transport, byte[] message) throws Exception
Exception
public Node invoke(String address, String transport, String message) throws Exception
Exception
public Node invoke(String address, String transport, byte[] message) throws Exception
Exception
public InputStream getResourceAsStream(String resource)
public Reader getResourceAsReader(String resource)
public XMLStreamReader getResourceAsXMLStreamReader(String resource) throws XMLStreamException
XMLStreamException
public File getTestFile(String relativePath)
public static String getBasedir()
public Document getWSDLDocument(Server server) throws javax.wsdl.WSDLException
server
- the server.
javax.wsdl.WSDLException
public javax.wsdl.Definition getWSDLDefinition(Server server) throws javax.wsdl.WSDLException
server
- the server.
javax.wsdl.WSDLException
public Server getServerForService(QName serviceName) throws javax.wsdl.WSDLException
javax.wsdl.WSDLException
public Server getServerForAddress(String address) throws javax.wsdl.WSDLException
javax.wsdl.WSDLException
public void addNamespace(String ns, String uri)
ns
- Namespace name.uri
- The namespace uri.public Map<String,String> getNamespaces()
public Bus getBus()
public void setBus(Bus bus)
bus
-
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |