use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class CustomErrorsUnitTestCase method test404Error.
/**
* Test that the custom 404 error page is seen
*
* @throws Exception
*/
@Test
@OperateOnDeployment("error-producer.war")
public void test404Error(@ArquillianResource(ErrorGeneratorServlet.class) URL baseURL) throws Exception {
int errorCode = HttpURLConnection.HTTP_NOT_FOUND;
URL url = new URL(baseURL + "/ErrorGeneratorServlet?errorCode=" + errorCode);
testURL(url, errorCode, "404.jsp", null);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SharedSessionTestCase method testSharedSessionsOneEar.
/**
* Covers test case when there is EAR with enabled session sharing
*/
@Test
@OperateOnDeployment(EAR_DEPLOYMENT_SHARED_SESSIONS)
public void testSharedSessionsOneEar() throws IOException {
// Note that this test should not need to use a relaxed domain handling, however the http client does not treat ipv6 domains (e.g. ::1) properly
HttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient();
HttpGet get1 = new HttpGet("http://" + TestSuiteEnvironment.getServerAddress() + ":8080/war1/SharedSessionServlet");
HttpGet get2 = new HttpGet("http://" + TestSuiteEnvironment.getServerAddress() + ":8080/war2/SharedSessionServlet");
String result = runGet(get1, client);
assertEquals("0", result);
result = runGet(get1, client);
assertEquals("1", result);
result = runGet(get2, client);
assertEquals("2", result);
result = runGet(get2, client);
assertEquals("3", result);
result = runGet(get1, client);
assertEquals("4", result);
HttpClientUtils.closeQuietly(client);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SharedSessionTestCase method testNotSharedSessions.
/**
* Covers test case when there is EAR with disabled session sharing
*/
@Test
@OperateOnDeployment(EAR_DEPLOYMENT_NOT_SHARED_SESSIONS)
public void testNotSharedSessions() throws IOException {
// Note that this test should not need to use a relaxed domain handling, however the http client does not treat ipv6 domains (e.g. ::1) properly
HttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient();
HttpGet getX = new HttpGet("http://" + TestSuiteEnvironment.getServerAddress() + ":8080/warX/SharedSessionServlet");
HttpGet getY = new HttpGet("http://" + TestSuiteEnvironment.getServerAddress() + ":8080/warY/SharedSessionServlet");
String result = runGet(getX, client);
assertEquals("0", result);
result = runGet(getX, client);
assertEquals("1", result);
result = runGet(getY, client);
assertEquals("0", result);
result = runGet(getY, client);
assertEquals("1", result);
result = runGet(getX, client);
assertEquals("2", result);
HttpClientUtils.closeQuietly(client);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment 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);
}
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment 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);
}
}
Aggregations