use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class StatefulFailoverTestCase method nestedBeanFailover.
/**
* Validates failover of a @Stateful bean containing a nested @Stateful bean
* containing an injected CDI bean that uses an interceptor and decorator.
*/
@ATTest({ "modules/testcases/jdkAll/Wildfly/clustering/src/main/java#10.0.0.Final*11.0.0.Final", "modules/testcases/jdkAll/Eap7/clustering/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/clustering/src/main/java", "modules/testcases/jdkAll/Eap71x/clustering/src/main/java" })
public void nestedBeanFailover(@ArquillianResource() @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1, @ArquillianResource() @OperateOnDeployment(DEPLOYMENT_2) URL baseURL2) throws Exception {
URI uri1 = StatefulServlet.createURI(baseURL1, MODULE_NAME, NestedIncrementorBean.class.getSimpleName());
URI uri2 = StatefulServlet.createURI(baseURL2, MODULE_NAME, NestedIncrementorBean.class.getSimpleName());
try (CloseableHttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient()) {
assertEquals(20010101, queryCount(client, uri1));
assertEquals(20020202, queryCount(client, uri1));
assertEquals(20030303, queryCount(client, uri2));
assertEquals(20040404, queryCount(client, uri2));
undeploy(DEPLOYMENT_2);
assertEquals(20050505, queryCount(client, uri1));
assertEquals(20060606, queryCount(client, uri1));
deploy(DEPLOYMENT_2);
assertEquals(20070707, queryCount(client, uri1));
assertEquals(20080808, queryCount(client, uri1));
assertEquals(20090909, queryCount(client, uri2));
assertEquals(20101010, queryCount(client, uri2));
undeploy(DEPLOYMENT_1);
assertEquals(20111111, queryCount(client, uri2));
assertEquals(20121212, queryCount(client, uri2));
deploy(DEPLOYMENT_1);
assertEquals(20131313, queryCount(client, uri1));
assertEquals(20141414, queryCount(client, uri1));
assertEquals(20151515, queryCount(client, uri2));
assertEquals(20161616, queryCount(client, uri2));
}
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class StatefulFailoverTestCase method failoverOnStop.
/**
* Validates failover on server restart of a simple @Stateful bean
*/
@ATTest({ "modules/testcases/jdkAll/Wildfly/clustering/src/main/java#10.0.0.Final*11.0.0.Final", "modules/testcases/jdkAll/Eap7/clustering/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/clustering/src/main/java", "modules/testcases/jdkAll/Eap71x/clustering/src/main/java" })
public void failoverOnStop(@ArquillianResource() @OperateOnDeployment(DEPLOYMENT_1) URL baseURL1, @ArquillianResource() @OperateOnDeployment(DEPLOYMENT_2) URL baseURL2) throws Exception {
URI uri1 = StatefulServlet.createURI(baseURL1, MODULE_NAME, SimpleIncrementorBean.class.getSimpleName());
URI uri2 = StatefulServlet.createURI(baseURL2, MODULE_NAME, SimpleIncrementorBean.class.getSimpleName());
try (CloseableHttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient()) {
assertEquals(1, queryCount(client, uri1));
assertEquals(2, queryCount(client, uri1));
assertEquals(3, queryCount(client, uri2));
assertEquals(4, queryCount(client, uri2));
stop(CONTAINER_2);
assertEquals(5, queryCount(client, uri1));
assertEquals(6, queryCount(client, uri1));
start(CONTAINER_2);
assertEquals(7, queryCount(client, uri1));
assertEquals(8, queryCount(client, uri1));
assertEquals(9, queryCount(client, uri2));
assertEquals(10, queryCount(client, uri2));
stop(CONTAINER_1);
assertEquals(11, queryCount(client, uri2));
assertEquals(12, queryCount(client, uri2));
start(CONTAINER_1);
assertEquals(13, queryCount(client, uri1));
assertEquals(14, queryCount(client, uri1));
assertEquals(15, queryCount(client, uri2));
assertEquals(16, queryCount(client, uri2));
}
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class CookieHeaderServletTestCase method headerProtocolTest.
@ATTest({ "modules/testcases/jdkAll/Wildfly/web/src/main/java#13.0.0", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/web/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/web/src/main/java#7.1.4", "modules/testcases/jdkAll/Eap71x/web/src/main/java#7.1.4" })
@Test
@OperateOnDeployment(DEPLOYMENT)
public void headerProtocolTest(@ArquillianResource URL url) throws Exception {
URL testURL = new URL(url.toString() + "cookieHeaderServlet");
final HttpGet request = new HttpGet(testURL.toString());
request.setProtocolVersion(HttpVersion.HTTP_1_0);
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
CloseableHttpResponse response = null;
response = httpClient.execute(request);
System.out.println("Protocol Version : " + response.getProtocolVersion());
Assert.assertTrue("Protocol Version should be HTTP/1.1.", response.getProtocolVersion().toString().contains("HTTP/1.1"));
IOUtils.closeQuietly(response);
httpClient.close();
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class SecurityDeserializationTestCase method testSecuirtyDatabind6.
@ATTest({ "modules/testcases/jdkAll/Wildfly/security/src/main/java#16.0.0.Beta1", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/security/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap71x/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java#7.2.1", "modules/testcases/jdkAll/Eap72x/security/src/main/java#7.2.1" })
@Test
public void testSecuirtyDatabind6() throws Exception {
final String JSON = aposToQuotes("{'v':['org.jboss.util.propertyeditor.DocumentEditor','/tmp/foobar.txt']}");
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
try {
PolyWrapper sc = mapper.readValue(JSON, PolyWrapper.class);
fail("Should not be able to deserialize because of security prevention.");
} catch (JsonMappingException e) {
assertTrue("Fail because of security issues...", e.getMessage().contains("prevented for security reasons"));
}
}
use of org.jboss.eap.additional.testsuite.annotations.ATTest in project eap-additional-testsuite by jboss-set.
the class SecurityDeserializationTestCase method testSecuirtyDatabind5.
@ATTest({ "modules/testcases/jdkAll/Wildfly/security/src/main/java#16.0.0.Beta1", "modules/testcases/jdkAll/WildflyRelease-17.0.0.Final/security/src/main/java", "modules/testcases/jdkAll/Eap71x-Proposed/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap71x/security/src/main/java#7.1.6", "modules/testcases/jdkAll/Eap72x-Proposed/security/src/main/java#7.2.1", "modules/testcases/jdkAll/Eap72x/security/src/main/java#7.2.1" })
@Test
public void testSecuirtyDatabind5() throws Exception {
final String JSON = aposToQuotes("{'v':['org.slf4j.ext.EventData','/tmp/foobar.txt']}");
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
try {
PolyWrapper sc = mapper.readValue(JSON, PolyWrapper.class);
fail("Should not be able to deserialize because of security prevention.");
} catch (JsonMappingException e) {
assertTrue("Fail because of security issues...", e.getMessage().contains("prevented for security reasons"));
}
}
Aggregations