Search in sources :

Example 16 with WrapThreadContextClassLoader

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

the class FastInfosetTestCase method testInfosetUsingFeatureProperties.

@Test
@RunAsClient
@WrapThreadContextClassLoader
@OperateOnDeployment(DEP1)
public void testInfosetUsingFeatureProperties() throws Exception {
    URL wsdlURL = new URL(baseURL + "HelloWorldService/HelloWorldImpl?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);
}
Also used : QName(javax.xml.namespace.QName) 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)

Example 17 with WrapThreadContextClassLoader

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

the class SchemaValidationTestCase method testClientSideSchemaValidationUsingConfiguration.

@Test
@RunAsClient
@WrapThreadContextClassLoader
public void testClientSideSchemaValidationUsingConfiguration() throws Exception {
    try {
        QName serviceName = new QName("http://jboss.org/schemavalidation", "HelloService");
        URL wsdlURL = JBossWSTestHelper.getResourceURL("jaxws/samples/schemavalidation/validatingClient.wsdl");
        Service service = Service.create(wsdlURL, serviceName);
        Hello proxy = (Hello) service.getPort(new QName("http://jboss.org/schemavalidation", "HelloPort"), Hello.class);
        ((BindingProvider) proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, baseURL + "/hello");
        // enable client side schema validation
        ClientConfigUtil.setConfigProperties(proxy, "META-INF/jaxws-client-config.xml", "Test Validating Client Config");
        HelloResponse hr = proxy.helloRequest("JBoss");
        assertNotNull(hr);
        assertEquals(2, hr.getReturn());
        try {
            proxy.helloRequest("number");
            fail("validation error is expected");
        } catch (Exception e) {
            assertTrue("not respect to enumration error is expected", e.getMessage().contains("is not facet-valid with respect to enumeration"));
        }
    } finally {
    }
}
Also used : QName(javax.xml.namespace.QName) HelloResponse(org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Example 18 with WrapThreadContextClassLoader

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

the class SignTestCase method testEJB.

@Test
@RunAsClient
@WrapThreadContextClassLoader
@OperateOnDeployment(EJB3_DEPLOYMENT)
public void testEJB() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
    URL wsdlURL = new URL(baseURL + "/jaxws-samples-wsse-policy-sign-ejb/SecurityService/EJBServiceImpl?wsdl");
    Service service = Service.create(wsdlURL, serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy);
    assertEquals("EJB Secure Hello World!", proxy.sayHello());
}
Also used : 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)

Example 19 with WrapThreadContextClassLoader

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

the class SignTestCase method test.

@Test
@RunAsClient
@WrapThreadContextClassLoader
@OperateOnDeployment(POJO_DEPLOYMENT)
public void test() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
    URL wsdlURL = new URL(baseURL + "?wsdl");
    Service service = Service.create(wsdlURL, serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy);
    assertEquals("Secure Hello World!", proxy.sayHello());
}
Also used : 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)

Example 20 with WrapThreadContextClassLoader

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

the class MultipleClientsSignEncryptTestCase method testJohn.

@Test
@RunAsClient
@WrapThreadContextClassLoader
public void testJohn() 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, "john");
    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);
    }
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) URL(java.net.URL) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) 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