use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSReliableMessagingWithAPITestCase method testWithFeatureProperty.
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void testWithFeatureProperty() throws Exception {
final Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
try {
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "SimpleService");
URL wsdlURL = getResourceURL("jaxws/samples/wsrm/WEB-INF/wsdl/SimpleService.wsdl");
Service service = Service.create(wsdlURL, serviceName);
SimpleService proxy = (SimpleService) service.getPort(SimpleService.class);
ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
configurer.setConfigProperties(proxy, "META-INF/jaxws-client-config.xml", "Custom Client Config");
((BindingProvider) proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, baseURL + "/jaxws-samples-wsrm-api/SimpleService");
// request response call
assertEquals("Hello World!", proxy.echo("Hello World!"));
// one way call
proxy.ping();
} finally {
bus.shutdown(true);
}
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class UDPEndpointAPITestCase method testClientSide.
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void testClientSide() throws Exception {
if (!isProperNetworkSetup()) {
// IPv6 does not support broadcast, so some IPv4 nonloopback interface with broacast is required
System.out.println("Skipping broadcast test: no non-loopback IPv4 interface available");
return;
}
Bus bus = BusFactory.newInstance().createBus();
BusFactory.setThreadDefaultBus(bus);
Object implementor = new HelloWorldImpl();
Endpoint ep = Endpoint.publish("soap.udp://:9436", implementor);
try {
final QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/udp", "HelloWorldService");
final QName udpPortName = new QName("http://org.jboss.ws/jaxws/cxf/udp", "UDPHelloWorldImplPort");
Service service = Service.create(serviceName);
service.addPort(udpPortName, "http://schemas.xmlsoap.org/soap/", "soap.udp://:9436");
HelloWorld proxy = (HelloWorld) service.getPort(udpPortName, HelloWorld.class);
assertEquals("Hi", proxy.echo("Hi"));
} finally {
ep.stop();
bus.shutdown(true);
}
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class AnnotatedSignEncryptTestCase method test.
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test() throws Exception {
try {
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
URL wsdlURL = new URL(baseURL + "/AnnotatedSecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
AnnotatedServiceIface proxy = (AnnotatedServiceIface) service.getPort(AnnotatedServiceIface.class);
setupWsse(proxy);
((BindingProvider) proxy).getRequestContext().put(Message.RECEIVE_TIMEOUT, 120000);
assertEquals("Secure Hello World!", proxy.sayHello());
} catch (Exception e) {
throw CryptoCheckHelper.checkAndWrapException(e);
}
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class MultipleClientsSignEncryptTestCase method testAlice.
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void testAlice() throws Exception {
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
URL wsdlURL = new URL(baseURL + "/SecurityService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
setupWsse(proxy, "alice");
try {
assertEquals("Multiple Clients Secure Hello World!", proxy.sayHello());
} catch (SOAPFaultException e) {
throw new Exception("Error " + e.getMessage() + " - please check that the Bouncy Castle provider is installed.", e);
}
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class FastInfosetTestCase method testInfosetUsingFeatureProperties2.
@Test
@RunAsClient
@WrapThreadContextClassLoader
@OperateOnDeployment(DEP2)
public void testInfosetUsingFeatureProperties2() throws Exception {
URL wsdlURL = new URL(baseURL + "HelloWorldService?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldService");
QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldImplPort");
internalTestInfosetUsingFeatureProperties(wsdlURL, serviceName, portQName);
}
Aggregations