use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method test1105.
@Test
public void test1105() throws Exception {
TestCaseType testcase = JMSTestUtil.getTestCase("test1105");
final JMSSimplePortType simplePort = getPort("JMSSimpleService1105", "SimplePort", JMSSimpleService1105.class, JMSSimplePortType.class);
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setSOAPJMSSOAPAction("mismatch");
try {
twoWayTestWithRequestHeader(testcase, simplePort, requestHeader);
} catch (Exception e) {
assertTrue(e.getMessage().contains("Mismatched SoapAction"));
}
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method test1109.
@Test
public void test1109() throws Exception {
TestCaseType testcase = JMSTestUtil.getTestCase("test1109");
final JMSSimplePortType simplePort = getPort("JMSSimpleService1109", "SimplePort", JMSSimpleService1109.class, JMSSimplePortType.class);
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
try {
twoWayTestWithRequestHeader(testcase, simplePort, requestHeader);
} catch (Exception e) {
assertTrue(e.getMessage().contains("Unknow JMS Variant"));
}
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SOAPJMSTestSuiteTest method twoWayTest.
private void twoWayTest(TestCaseType testcase, final JMSSimplePortType port) throws Exception {
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
twoWayTestWithRequestHeader(testcase, port, requestHeader);
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SoapJmsSpecTest method testWsdlExtensionSpecJMS.
@Test
public void testWsdlExtensionSpecJMS() throws Exception {
QName serviceName = new QName(SERVICE_NS, "JMSGreeterService");
QName portName = new QName(SERVICE_NS, "GreeterPort");
URL wsdl = getWSDLURL(WSDL);
JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
JMSGreeterPortType greeter = markForClose(service.getPort(portName, JMSGreeterPortType.class, cff));
Map<String, Object> requestContext = ((BindingProvider) greeter).getRequestContext();
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
String reply = greeter.sayHi();
Assert.assertEquals("Bonjour", reply);
requestContext = ((BindingProvider) greeter).getRequestContext();
requestHeader = (JMSMessageHeadersType) requestContext.get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
Assert.assertEquals("1.0", requestHeader.getSOAPJMSBindingVersion());
Assert.assertEquals("\"test\"", requestHeader.getSOAPJMSSOAPAction());
Assert.assertEquals(3000, requestHeader.getTimeToLive());
Assert.assertEquals(DeliveryMode.PERSISTENT, requestHeader.getJMSDeliveryMode());
Assert.assertEquals(7, requestHeader.getJMSPriority());
Map<String, Object> responseContext = ((BindingProvider) greeter).getResponseContext();
JMSMessageHeadersType responseHeader = (JMSMessageHeadersType) responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
Assert.assertEquals("1.0", responseHeader.getSOAPJMSBindingVersion());
Assert.assertEquals("\"test\"", responseHeader.getSOAPJMSSOAPAction());
Assert.assertEquals(DeliveryMode.PERSISTENT, responseHeader.getJMSDeliveryMode());
Assert.assertEquals(7, responseHeader.getJMSPriority());
}
use of org.apache.cxf.transport.jms.JMSMessageHeadersType in project cxf by apache.
the class SoapJmsSpecTest method testBindingVersionError.
@Test
public void testBindingVersionError() throws Exception {
QName serviceName = new QName(SERVICE_NS, "JMSGreeterService");
QName portName = new QName(SERVICE_NS, "GreeterPort");
URL wsdl = getWSDLURL(WSDL);
JMSGreeterService service = new JMSGreeterService(wsdl, serviceName);
JMSGreeterPortType greeter = markForClose(service.getPort(portName, JMSGreeterPortType.class, cff));
BindingProvider bp = (BindingProvider) greeter;
Map<String, Object> requestContext = bp.getRequestContext();
JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
requestHeader.setSOAPJMSBindingVersion("0.3");
requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
try {
greeter.greetMe("Milestone-");
Assert.fail("Should have thrown a fault");
} catch (SOAPFaultException ex) {
Assert.assertTrue(ex.getMessage().contains("0.3"));
Map<String, Object> responseContext = bp.getResponseContext();
JMSMessageHeadersType responseHdr = (JMSMessageHeadersType) responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
if (responseHdr == null) {
Assert.fail("response Header should not be null");
}
Assert.assertTrue(responseHdr.isSOAPJMSIsFault());
}
}
Aggregations