use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class LoggingDeploymentResourceTestCase method testWarDeploymentConfigurationResource.
@OperateOnDeployment(WAR_DEPLOYMENT_NAME)
@Test
public void testWarDeploymentConfigurationResource() throws Exception {
final ModelNode loggingConfiguration = readDeploymentResource(WAR_DEPLOYMENT_NAME, WAR_DEPLOYMENT_NAME + "/META-INF/logging.properties");
// The address should have logging.properties
final Deque<Property> resultAddress = new ArrayDeque<>(Operations.getOperationAddress(loggingConfiguration).asPropertyList());
Assert.assertTrue("The configuration path did not include logging.properties", resultAddress.getLast().getValue().asString().contains("logging.properties"));
final ModelNode handler = loggingConfiguration.get("handler", "FILE");
Assert.assertTrue("The FILE handler was not found effective configuration", handler.isDefined());
Assert.assertTrue(handler.hasDefined("properties"));
String fileName = null;
// Find the fileName property
for (Property property : handler.get("properties").asPropertyList()) {
if ("fileName".equals(property.getName())) {
fileName = property.getValue().asString();
break;
}
}
Assert.assertNotNull("fileName property not found", fileName);
Assert.assertTrue(fileName.endsWith("test-logging-war.log"));
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class LoggingDeploymentResourceTestCase method testDeploymentConfigurationResource.
@OperateOnDeployment(EAR_PARENT_DEPLOYMENT_NAME)
@Test
public void testDeploymentConfigurationResource() throws Exception {
ModelNode loggingConfiguration = readDeploymentResource(EAR_PARENT_DEPLOYMENT_NAME, EAR_PARENT_DEPLOYMENT_NAME + "/META-INF/logging.properties");
// The address should have logging.properties
Deque<Property> resultAddress = new ArrayDeque<>(Operations.getOperationAddress(loggingConfiguration).asPropertyList());
Assert.assertTrue("The configuration path did not include logging.properties", resultAddress.getLast().getValue().asString().contains("logging.properties"));
ModelNode handler = loggingConfiguration.get("handler", "FILE");
Assert.assertTrue("The FILE handler was not found effective configuration", handler.isDefined());
Assert.assertTrue(handler.hasDefined("properties"));
String fileName = null;
// Find the fileName property
for (Property property : handler.get("properties").asPropertyList()) {
if ("fileName".equals(property.getName())) {
fileName = property.getValue().asString();
break;
}
}
Assert.assertNotNull("fileName property not found", fileName);
Assert.assertTrue(fileName.endsWith("test-logging-parent-ear.log"));
// Check the WAR which should have it's own configuration
loggingConfiguration = readSubDeploymentResource(EAR_PARENT_DEPLOYMENT_NAME, EAR_CHILD_WAR_DEPLOYMENT_NAME, EAR_CHILD_WAR_DEPLOYMENT_NAME + "/META-INF/logging.properties");
// The address should have logging.properties
resultAddress = new ArrayDeque<>(Operations.getOperationAddress(loggingConfiguration).asPropertyList());
Assert.assertTrue("The configuration path did not include logging.properties", resultAddress.getLast().getValue().asString().contains("logging.properties"));
handler = loggingConfiguration.get("handler", "FILE");
Assert.assertTrue("The FILE handler was not found effective configuration", handler.isDefined());
Assert.assertTrue(handler.hasDefined("properties"));
fileName = null;
// Find the fileName property
for (Property property : handler.get("properties").asPropertyList()) {
if ("fileName".equals(property.getName())) {
fileName = property.getValue().asString();
break;
}
}
Assert.assertNotNull("fileName property not found", fileName);
Assert.assertTrue(fileName.endsWith("test-logging-child-war.log"));
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class RestoreOriginalRequestTestCase method testRedirectOriginalRequest.
@Test
@OperateOnDeployment("service-provider-1")
public void testRedirectOriginalRequest(@ArquillianResource URL serviceProvider1) throws Exception {
WebRequest request = new GetMethodWebRequest(formatUrl(serviceProvider1) + "/savedRequest/savedRequest.html");
WebConversation conversation = new WebConversation();
WebResponse response = conversation.getResponse(request);
WebForm webForm = response.getForms()[0];
webForm.setParameter("j_username", "tomcat");
webForm.setParameter("j_password", "tomcat");
webForm.getSubmitButtons()[0].click();
response = conversation.getCurrentPage();
assertTrue(response.getText().contains("Back to the original requested resource."));
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class RestoreOriginalRequestTestCase method testPostOriginalRequestWithParams.
@Test
@OperateOnDeployment("service-provider-2")
public void testPostOriginalRequestWithParams(@ArquillianResource URL serviceProvider2) throws Exception {
WebRequest request = new GetMethodWebRequest(formatUrl(serviceProvider2) + "/savedRequest/savedRequest.jsp");
request.setParameter("SAVED_PARAM", "Param was saved.");
WebConversation conversation = new WebConversation();
WebResponse response = conversation.getResponse(request);
WebForm webForm = response.getForms()[0];
webForm.setParameter("j_username", "tomcat");
webForm.setParameter("j_password", "tomcat");
webForm.getSubmitButtons()[0].click();
response = conversation.getCurrentPage();
assertTrue(response.getText().contains("Param was saved."));
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class ReloadWSDLPublisherTestCase method testHelloStringAfterReload.
@Test
@OperateOnDeployment(DEPLOYMENT)
public void testHelloStringAfterReload() throws Exception {
Assert.assertTrue(containerController.isStarted(DEFAULT_JBOSSAS));
ManagementClient managementClient = new ManagementClient(TestSuiteEnvironment.getModelControllerClient(), TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
QName serviceName = new QName("http://jbossws.org/basic", "POJOService");
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEPLOYMENT + "/POJOService?wsdl");
checkWsdl(wsdlURL);
Service service = Service.create(wsdlURL, serviceName);
EndpointIface proxy = service.getPort(EndpointIface.class);
Assert.assertEquals("Hello World!", proxy.helloString("World"));
executeReloadAndWaitForCompletion(managementClient.getControllerClient(), 100000);
checkWsdl(wsdlURL);
serviceName = new QName("http://jbossws.org/basic", "POJOService");
service = Service.create(wsdlURL, serviceName);
proxy = service.getPort(EndpointIface.class);
Assert.assertEquals("Hello World!", proxy.helloString("World"));
Assert.assertTrue(containerController.isStarted(DEFAULT_JBOSSAS));
}
Aggregations