Search in sources :

Example 1 with BearerIface

use of org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface in project jbossws-cxf by jbossws.

the class WSTrustTestCase method testBearer.

@Test
@RunAsClient
@OperateOnDeployment(BEARER_SERVER_DEP)
@WrapThreadContextClassLoader
public void testBearer() throws Exception {
    Bus bus = BusFactory.newInstance().createBus();
    try {
        BusFactory.setThreadDefaultBus(bus);
        final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/bearerwssecuritypolicy", "BearerService");
        Service service = Service.create(new URL(serviceURL + "BearerService?wsdl"), serviceName);
        BearerIface proxy = (BearerIface) service.getPort(BearerIface.class);
        WSTrustTestUtils.setupWsseAndSTSClientBearer((BindingProvider) proxy, bus);
        assertEquals("Bearer WS-Trust Hello World!", proxy.sayHello());
    } finally {
        bus.shutdown(true);
    }
}
Also used : Bus(org.apache.cxf.Bus) BearerIface(org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) 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

URL (java.net.URL)1 QName (javax.xml.namespace.QName)1 Service (javax.xml.ws.Service)1 Bus (org.apache.cxf.Bus)1 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)1 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)1 BearerIface (org.jboss.test.ws.jaxws.samples.wsse.policy.trust.bearer.BearerIface)1 JBossWSTest (org.jboss.wsf.test.JBossWSTest)1 WrapThreadContextClassLoader (org.jboss.wsf.test.WrapThreadContextClassLoader)1 Test (org.junit.Test)1