use of org.apache.hello_world_doc_lit.Greeter in project cxf by apache.
the class JMSClientServerTest method docBasicJmsDestinationTest.
@Test
public void docBasicJmsDestinationTest() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService6");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort6");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = service.getPort(portName, Greeter.class);
for (int idx = 0; idx < 5; idx++) {
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Milestone-" + idx);
assertEquals("Hello Milestone-" + idx, greeting);
String reply = greeter.sayHi();
assertEquals("Bonjour", reply);
try {
greeter.pingMe();
fail("Should have thrown FaultException");
} catch (PingMeFault ex) {
assertNotNull(ex.getFaultInfo());
}
}
((java.io.Closeable) greeter).close();
}
use of org.apache.hello_world_doc_lit.Greeter in project cxf by apache.
the class JMSClientServerTest method testReplyToConfig.
@Test
public void testReplyToConfig() throws Exception {
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(broker.getBrokerURL());
TestReceiver receiver = new TestReceiver(cf, "SoapService7.replyto.queue", false);
receiver.setStaticReplyQueue("SoapService7.reply.queue");
receiver.runAsync();
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService7");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort7");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService7 service = new SOAPService7(wsdl, serviceName);
Greeter greeter = service.getPort(portName, Greeter.class);
String name = "FooBar";
String reply = greeter.greetMe(name);
Assert.assertEquals("Hello " + name, reply);
((Closeable) greeter).close();
}
use of org.apache.hello_world_doc_lit.Greeter in project cxf by apache.
the class JaxWsAPITest method testGreeterUsingJaxWSAPI.
@Test
public void testGreeterUsingJaxWSAPI() throws Exception {
QName serviceName = new QName("http://apache.org/hello_world_doc_lit", "SOAPService2");
QName portName = new QName("http://apache.org/hello_world_doc_lit", "SoapPort2");
URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
SOAPService2 service = new SOAPService2(wsdl, serviceName);
Greeter greeter = markForClose(service.getPort(portName, Greeter.class, cff));
Client client = ClientProxy.getClient(greeter);
client.getEndpoint().getOutInterceptors().add(new TibcoSoapActionInterceptor());
greeter.greetMeOneWay("test String");
String greeting = greeter.greetMe("Chris");
Assert.assertEquals("Hello Chris", greeting);
}
use of org.apache.hello_world_doc_lit.Greeter in project cxf by apache.
the class JMSTransactionTest method testTransactionOneWay.
@Test
public void testTransactionOneWay() throws Exception {
Connection conn = cf.createConnection();
conn.start();
Queue queue = JMSUtil.createQueue(conn, "ActiveMQ.DLQ");
assertNumMessagesInQueue("DLQ should be empty", conn, queue, 0, 1000);
Greeter greeter = markForClose(createGreeterProxy());
// Should be processed normally
greeter.greetMeOneWay(GreeterImplWithTransaction.GOOD_GUY);
assertNumMessagesInQueue("DLQ should be empty", conn, queue, 0, 1000);
// Should cause rollback, redelivery and in the end the message should go to the dead letter queue
greeter.greetMeOneWay(GreeterImplWithTransaction.BAD_GUY);
assertNumMessagesInQueue("Request should be put into DLQ", conn, queue, 1, 2000);
conn.close();
}
use of org.apache.hello_world_doc_lit.Greeter in project cxf by apache.
the class JMSTransactionTest method testNoTransactionRequestReply.
/**
* Request reply should not cause roll backs
*
* @throws Exception
*/
@Test
public void testNoTransactionRequestReply() throws Exception {
Greeter greeter = markForClose(createGreeterProxy());
greeter.greetMe("Good guy");
try {
greeter.greetMe("Bad guy");
Assert.fail("Expecting exception here");
} catch (Exception e) {
// Fine
}
}
Aggregations