org.apache.servicemix.tck
Class TestSupport

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.servicemix.tck.SpringTestSupport
              extended by org.apache.servicemix.tck.TestSupport
All Implemented Interfaces:
Test

public abstract class TestSupport
extends SpringTestSupport

Version:
$Revision: 564607 $

Field Summary
protected  ServiceMixClient client
           
protected  Receiver receiver
           
 
Fields inherited from class org.apache.servicemix.tck.SpringTestSupport
context, jbi, log, messageCount, transformer
 
Constructor Summary
TestSupport()
           
 
Method Summary
protected  void assertMessageBody(MessageList messageList, int index, String expectedXml)
           
protected  void assertMessageHeader(MessageList messageList, int index, String propertyName, Object expectedValue)
           
protected  void assertMessagesReceived()
           
protected  void assertMessagesReceived(int messageCount)
           
protected  MessageList assertMessagesReceived(String receiverName, int messageCount)
           
protected  void assertMessageXPath(MessageList messageList, int index, String xpath, String expectedValue)
           
protected  void assertSendAndReceiveMessages(QName service)
          Sends messages to the given service and asserts that the receiver gets them all
protected  String createMessageXmlText(int index)
           
protected  Object requestServiceWithFileRequest(QName serviceName, String fileOnClassPath)
          Performs a request using the given file from the classpath as the request body and return the answer
protected  void sendMessages(QName service, int messageCount)
           
protected  void sendMessages(QName service, int messageCount, boolean sync, String msg)
          Sends the given number of messages to the given service
protected  void sendMessages(QName service, int messageCount, String message)
           
protected  void sendServiceWithFileRequest(QName serviceName, String fileOnClassPath)
          Performs a request using the given file from the classpath as the request body and return the answer
protected  void setUp()
           
 
Methods inherited from class org.apache.servicemix.tck.SpringTestSupport
assertExchangeWorked, assertMessagesReceived, createBeanFactory, getBean, getSourceFromClassPath, tearDown, textValueOfXPath
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

client

protected ServiceMixClient client

receiver

protected Receiver receiver
Constructor Detail

TestSupport

public TestSupport()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class SpringTestSupport
Throws:
Exception

assertSendAndReceiveMessages

protected void assertSendAndReceiveMessages(QName service)
                                     throws Exception
Sends messages to the given service and asserts that the receiver gets them all

Parameters:
service -
Throws:
javax.jbi.messaging.MessagingException
Exception

sendMessages

protected void sendMessages(QName service,
                            int messageCount)
                     throws Exception
Throws:
Exception

sendMessages

protected void sendMessages(QName service,
                            int messageCount,
                            String message)
                     throws Exception
Throws:
Exception

sendMessages

protected void sendMessages(QName service,
                            int messageCount,
                            boolean sync,
                            String msg)
                     throws Exception
Sends the given number of messages to the given service

Parameters:
service -
Throws:
javax.jbi.messaging.MessagingException
Exception

createMessageXmlText

protected String createMessageXmlText(int index)

assertMessagesReceived

protected void assertMessagesReceived()
                               throws Exception
Throws:
Exception

assertMessagesReceived

protected void assertMessagesReceived(int messageCount)
                               throws Exception
Throws:
Exception

assertMessagesReceived

protected MessageList assertMessagesReceived(String receiverName,
                                             int messageCount)
                                      throws Exception
Throws:
Exception

requestServiceWithFileRequest

protected Object requestServiceWithFileRequest(QName serviceName,
                                               String fileOnClassPath)
                                        throws Exception
Performs a request using the given file from the classpath as the request body and return the answer

Parameters:
serviceName -
fileOnClassPath -
Returns:
Throws:
JBIException
Exception

sendServiceWithFileRequest

protected void sendServiceWithFileRequest(QName serviceName,
                                          String fileOnClassPath)
                                   throws Exception
Performs a request using the given file from the classpath as the request body and return the answer

Parameters:
serviceName -
fileOnClassPath -
Throws:
JBIException
Exception

assertMessageHeader

protected void assertMessageHeader(MessageList messageList,
                                   int index,
                                   String propertyName,
                                   Object expectedValue)

assertMessageBody

protected void assertMessageBody(MessageList messageList,
                                 int index,
                                 String expectedXml)
                          throws TransformerException
Throws:
TransformerException

assertMessageXPath

protected void assertMessageXPath(MessageList messageList,
                                  int index,
                                  String xpath,
                                  String expectedValue)
                           throws TransformerException,
                                  ParserConfigurationException,
                                  IOException,
                                  SAXException
Throws:
TransformerException
ParserConfigurationException
IOException
SAXException


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.