Search in sources :

Example 26 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.

the class TwoModulesJarTestCase method testConnection2.

/**
     * Tests connection in pool
     *
     * @throws Exception in case of error
     */
@Test
@RunAsClient
public void testConnection2() throws Exception {
    final ModelNode address1 = ModuleAcDeploymentTestCaseSetup.address1.clone();
    address1.add("connection-definitions", cf1);
    address1.protect();
    final ModelNode operation1 = new ModelNode();
    operation1.get(OP).set("test-connection-in-pool");
    operation1.get(OP_ADDR).set(address1);
    executeOperation(operation1);
}
Also used : ModelNode(org.jboss.dmr.ModelNode) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 27 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.

the class TwoRaFlatTestCase method testConnection2.

/**
     * Tests connection in pool
     *
     * @throws Exception in case of error
     */
@Test
@RunAsClient
public void testConnection2() throws Exception {
    final ModelNode address1 = ModuleAcDeploymentTestCaseSetup.address1.clone();
    address1.add("connection-definitions", cf1);
    address1.protect();
    final ModelNode operation1 = new ModelNode();
    operation1.get(OP).set("test-connection-in-pool");
    operation1.get(OP_ADDR).set(address1);
    executeOperation(operation1);
}
Also used : ModelNode(org.jboss.dmr.ModelNode) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 28 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.

the class TwoRaJarTestCase method testConnection2.

/**
     * Tests connection in pool
     *
     * @throws Exception in case of error
     */
@Test
@RunAsClient
public void testConnection2() throws Exception {
    final ModelNode address1 = ModuleAcDeploymentTestCaseSetup1.address1.clone();
    address1.add("connection-definitions", cf1);
    address1.protect();
    final ModelNode operation1 = new ModelNode();
    operation1.get(OP).set("test-connection-in-pool");
    operation1.get(OP_ADDR).set(address1);
    executeOperation(operation1);
}
Also used : ModelNode(org.jboss.dmr.ModelNode) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test)

Example 29 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.

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 + 8444, "/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.as.test.integration.ws.wsse.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) WrapThreadContextClassLoader(org.jboss.as.test.integration.ws.WrapThreadContextClassLoader)

Example 30 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project wildfly by wildfly.

the class WSTrustTestCase method testUsingEPR.

/**
     * WS-Trust test with the STS information coming from EPR specified in service endpoint contract policy
     *
     * @throws Exception
     */
@Test
@RunAsClient
@OperateOnDeployment(SERVER_DEP)
@WrapThreadContextClassLoader
public void testUsingEPR() throws Exception {
    Bus bus = BusFactory.newInstance().createBus();
    try {
        BusFactory.setThreadDefaultBus(bus);
        final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
        final URL wsdlURL = new URL(serviceURL + "SecurityService?wsdl");
        Service service = Service.create(wsdlURL, serviceName);
        ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
        WSTrustTestUtils.setupWsse(proxy, bus);
        try {
            assertEquals("WS-Trust Hello World!", proxy.sayHello());
        } catch (Exception e) {
            throw e;
        }
    } finally {
        bus.shutdown(true);
    }
}
Also used : Bus(org.apache.cxf.Bus) ActAsServiceIface(org.jboss.as.test.integration.ws.wsse.trust.actas.ActAsServiceIface) ServiceIface(org.jboss.as.test.integration.ws.wsse.trust.service.ServiceIface) OnBehalfOfServiceIface(org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceIface) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) IOException(java.io.IOException) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) WrapThreadContextClassLoader(org.jboss.as.test.integration.ws.WrapThreadContextClassLoader)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)62 Test (org.junit.Test)61 URL (java.net.URL)49 WebElement (org.openqa.selenium.WebElement)34 QName (javax.xml.namespace.QName)9 Service (javax.xml.ws.Service)9 Bus (org.apache.cxf.Bus)9 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)9 WrapThreadContextClassLoader (org.jboss.as.test.integration.ws.WrapThreadContextClassLoader)9 IOException (java.io.IOException)6 ActAsServiceIface (org.jboss.as.test.integration.ws.wsse.trust.actas.ActAsServiceIface)6 OnBehalfOfServiceIface (org.jboss.as.test.integration.ws.wsse.trust.onbehalfof.OnBehalfOfServiceIface)6 HttpResponse (org.apache.http.HttpResponse)5 HttpGet (org.apache.http.client.methods.HttpGet)5 ServiceIface (org.jboss.as.test.integration.ws.wsse.trust.service.ServiceIface)5 ModelNode (org.jboss.dmr.ModelNode)5 InSequence (org.jboss.arquillian.junit.InSequence)4 Response (javax.ws.rs.core.Response)3 HashMap (java.util.HashMap)2 Hashtable (java.util.Hashtable)2