Search in sources :

Example 41 with WrapThreadContextClassLoader

use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.

the class WSTrustTestCase method testHolderOfKey.

@Test
@RunAsClient
@OperateOnDeployment(HOLDER_OF_KEY_SERVER_DEP)
@WrapThreadContextClassLoader
public void testHolderOfKey() throws Exception {
    Bus bus = BusFactory.newInstance().createBus();
    try {
        BusFactory.setThreadDefaultBus(bus);
        final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/holderofkeywssecuritypolicy", "HolderOfKeyService");
        final URL wsdlURL = new URL("https", serviceURL.getHost(), serviceURL.getPort() - 8080 + 8443, "/jaxws-samples-wsse-policy-trust-holderofkey/HolderOfKeyService?wsdl");
        Service service = Service.create(wsdlURL, serviceName);
        HolderOfKeyIface proxy = (HolderOfKeyIface) service.getPort(HolderOfKeyIface.class);
        WSTrustTestUtils.setupWsseAndSTSClientHolderOfKey((BindingProvider) proxy, bus);
        assertEquals("Holder-Of-Key WS-Trust Hello World!", proxy.sayHello());
    } finally {
        bus.shutdown(true);
    }
}
Also used : Bus(org.apache.cxf.Bus) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) HolderOfKeyIface(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.holderofkey.HolderOfKeyIface) URL(java.net.URL) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Aggregations

QName (javax.xml.namespace.QName)41 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)41 JBossWSTest (org.jboss.wsf.test.JBossWSTest)41 WrapThreadContextClassLoader (org.jboss.wsf.test.WrapThreadContextClassLoader)41 Test (org.junit.Test)41 URL (java.net.URL)40 Service (javax.xml.ws.Service)39 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)15 Bus (org.apache.cxf.Bus)13 BindingProvider (javax.xml.ws.BindingProvider)6 ActAsServiceIface (org.jboss.test.ws.jaxws.samples.wsse.policy.trust.actas.ActAsServiceIface)6 OnBehalfOfServiceIface (org.jboss.test.ws.jaxws.samples.wsse.policy.trust.onbehalfof.OnBehalfOfServiceIface)6 ServiceIface (org.jboss.test.ws.jaxws.samples.wsse.policy.trust.service.ServiceIface)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 PrintWriter (java.io.PrintWriter)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 LoggingInInterceptor (org.apache.cxf.interceptor.LoggingInInterceptor)2 UseThreadBusFeature (org.jboss.wsf.stack.cxf.client.UseThreadBusFeature)2 Endpoint (javax.xml.ws.Endpoint)1 HelloResponse (org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse)1