Search in sources :

Example 1 with HelloWorldServiceAppCorrelationID

use of org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationID in project cxf by apache.

the class JMSSharedQueueTest method testTwoWayQueueAppCorrelationID.

@Test
public void testTwoWayQueueAppCorrelationID() throws Throwable {
    QName serviceName = new QName(SERVICE_NS, "HelloWorldServiceAppCorrelationID");
    QName portNameEng = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDEng");
    QName portNameSales = new QName(SERVICE_NS, "HelloWorldPortAppCorrelationIDSales");
    URL wsdl = getWSDLURL(WSDL);
    HelloWorldServiceAppCorrelationID service = new HelloWorldServiceAppCorrelationID(wsdl, serviceName);
    HelloWorldPortType portEng = markForClose(service.getPort(portNameEng, HelloWorldPortType.class, cff));
    ClientRunnable engClient = new ClientRunnable(portEng, new CorrelationIDFactory() {

        private int counter;

        public String createCorrealtionID() {
            return "com.mycompany.eng:" + counter++;
        }
    });
    HelloWorldPortType portSales = markForClose(service.getPort(portNameSales, HelloWorldPortType.class, cff));
    ClientRunnable salesClient = new ClientRunnable(portSales, new CorrelationIDFactory() {

        private int counter;

        public String createCorrealtionID() {
            return "com.mycompany.sales:" + counter++;
        }
    });
    executeAsync(new ClientRunnable[] { engClient, salesClient });
}
Also used : QName(javax.xml.namespace.QName) HelloWorldPortType(org.apache.cxf.hello_world_jms.HelloWorldPortType) URL(java.net.URL) HelloWorldServiceAppCorrelationID(org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationID) Test(org.junit.Test) AbstractVmJMSTest(org.apache.cxf.systest.jms.AbstractVmJMSTest)

Aggregations

URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 HelloWorldPortType (org.apache.cxf.hello_world_jms.HelloWorldPortType)1 HelloWorldServiceAppCorrelationID (org.apache.cxf.hello_world_jms.HelloWorldServiceAppCorrelationID)1 AbstractVmJMSTest (org.apache.cxf.systest.jms.AbstractVmJMSTest)1 Test (org.junit.Test)1