use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class ReloadRequiringChangesTestCase method testWSDLHostUndefineRequiresReloadAndDoesNotAffectRuntime.
@Test
@OperateOnDeployment(DEPLOYMENT)
public void testWSDLHostUndefineRequiresReloadAndDoesNotAffectRuntime() throws Exception {
Assert.assertTrue(containerController.isStarted(DEFAULT_JBOSSAS));
ManagementClient managementClient = new ManagementClient(TestSuiteEnvironment.getModelControllerClient(), TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
ModelControllerClient client = managementClient.getControllerClient();
String initialWsdlHost = null;
try {
initialWsdlHost = getWsdlHost(client);
//change wsdl-host to "my-host" and reload
final String hostname = "my-host";
setWsdlHost(client, hostname);
ServerReload.executeReloadAndWaitForCompletion(client);
//undefine wsdl-host and verify deployment still uses "foo-host"
setWsdlHost(client, null);
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEPLOYMENT + "/POJOService?wsdl");
checkWsdl(wsdlURL, hostname);
} finally {
try {
if (initialWsdlHost != null) {
setWsdlHost(client, initialWsdlHost);
}
} finally {
managementClient.close();
}
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class WSAttributesChangesTestCase method performWsdlPathRewriteRuleAttributeTest.
private void performWsdlPathRewriteRuleAttributeTest(boolean checkUpdateWithDeployedEndpoint) throws Exception {
Assert.assertTrue(containerController.isStarted(DEFAULT_JBOSSAS));
ManagementClient managementClient = new ManagementClient(TestSuiteEnvironment.getModelControllerClient(), TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
ModelControllerClient client = managementClient.getControllerClient();
try {
final String expectedContext = "xx/jaxws-manual-pojo-1";
final String sedCmdA = "s/jaxws-manual-pojo-1/xx\\/jaxws-manual-pojo-1/g";
ModelNode op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-path-rewrite-rule");
op.get(VALUE).set(sedCmdA);
//update successful, no need to reload
applyUpdate(client, op, false);
//now we deploy an endpoint...
deployer.deploy(DEP_1);
//verify the updated wsdl host is used...
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEP_1 + "/POJOService?wsdl");
checkWsdl(wsdlURL, expectedContext);
if (checkUpdateWithDeployedEndpoint) {
//final String hostnameB = "foo-host-b";
final String sedCmdB = "s/jaxws-manual-pojo-1/FOO\\/jaxws-manual-pojo-1/g";
ModelNode opB = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
opB.get(NAME).set("wsdl-path-rewrite-rule");
opB.get(VALUE).set(sedCmdB);
//update again, but we'll need to reload, as there's an active deployment
applyUpdate(client, opB, true);
//check the wsdl host is still the one we updated to before
checkWsdl(wsdlURL, expectedContext);
//and check that still applies even if we undeploy and redeploy the endpoint
deployer.undeploy(DEP_1);
deployer.deploy(DEP_1);
checkWsdl(wsdlURL, expectedContext);
}
} finally {
try {
deployer.undeploy(DEP_1);
} catch (Throwable t) {
//ignore
}
try {
ModelNode op = createOpNode("subsystem=webservices/", UNDEFINE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-path-rewrite-rule");
applyUpdate(client, op, checkUpdateWithDeployedEndpoint);
} finally {
managementClient.close();
}
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class CertificateRolesLoginModuleTestCase method stopContainer.
@Test
@InSequence(3)
public void stopContainer() throws Exception {
deployer.undeploy(APP_NAME);
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
LOGGER.trace("*** reseting test configuration");
AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.tearDown(managementClient, CONTAINER);
SecurityDomainsSetup.INSTANCE.tearDown(managementClient, CONTAINER);
LOGGER.trace("*** stopping container");
containerController.stop(CONTAINER);
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class CertificateRolesLoginModuleTestCase method startAndSetupContainer.
@Test
@InSequence(-1)
public void startAndSetupContainer() throws Exception {
LOGGER.trace("*** starting server");
containerController.start(CONTAINER);
ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
LOGGER.trace("*** will configure server now");
AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.setup(managementClient, CONTAINER);
SecurityDomainsSetup.INSTANCE.setup(managementClient, CONTAINER);
LOGGER.trace("*** reloading server");
executeReloadAndWaitForCompletion(client, 100000);
deployer.deploy(APP_NAME);
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class DatabaseCertLoginModuleTestCase method stopContainer.
@Test
@InSequence(3)
public void stopContainer() throws Exception {
deployer.undeploy(APP_NAME);
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
final ManagementClient managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
LOGGER.trace("*** reseting test configuration");
AbstractCertificateLoginModuleTestCase.HTTPSConnectorSetup.INSTANCE.tearDown(managementClient, CONTAINER);
SecurityDomainsSetup.INSTANCE.tearDown(managementClient, CONTAINER);
DBSetup.INSTANCE.tearDown(managementClient, CONTAINER);
DataSourcesSetup.INSTANCE.tearDown(managementClient, CONTAINER);
LOGGER.trace("*** stopping container");
containerController.stop(CONTAINER);
}
Aggregations