use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class WSAttributesChangesTestCase method performWsdlUriSchemeAttributeTest.
private void performWsdlUriSchemeAttributeTest(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();
String initialWsdlUriScheme = null;
try {
//save initial wsdl-uri-schema value to restore later
initialWsdlUriScheme = getAttribute("wsdl-uri-scheme", client, false);
//set wsdl-uri-scheme value to https
ModelNode op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-uri-scheme");
op.get(VALUE).set("https");
applyUpdate(client, op, false);
deployer.deploy(DEP_1);
//check if it works for the deployed endpoint url
checkWSDLUriScheme(client, DEP_1 + ".war", "https");
deployer.undeploy(DEP_1);
//set wsdl-uri-scheme value to http
ModelNode op2 = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op2.get(NAME).set("wsdl-uri-scheme");
op2.get(VALUE).set("http");
applyUpdate(client, op2, false);
deployer.deploy(DEP_1);
//check if the uri scheme of soap address is modified to http
checkWSDLUriScheme(client, DEP_1 + ".war", "http");
if (checkUpdateWithDeployedEndpoint) {
//set wsdl-uri-schema value to http
ModelNode opB = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
opB.get(NAME).set("wsdl-uri-scheme");
opB.get(VALUE).set("https");
applyUpdate(client, opB, true);
//check this doesn't apply to endpointed which are deployed before this change
checkWSDLUriScheme(client, DEP_1 + ".war", "http");
deployer.undeploy(DEP_1);
deployer.deploy(DEP_1);
//check this will take effect to redeployed endpoint
checkWSDLUriScheme(client, DEP_1 + ".war", "http");
}
} finally {
try {
deployer.undeploy(DEP_1);
} catch (Throwable t) {
//ignore
}
try {
//restore the value of wsdl-uri-scheme attribute
ModelNode op = null;
if ("undefined".equals(initialWsdlUriScheme)) {
op = createOpNode("subsystem=webservices/", UNDEFINE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-uri-scheme");
} else {
op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-uri-scheme");
op.get(VALUE).set(initialWsdlUriScheme);
}
applyUpdate(client, op, checkUpdateWithDeployedEndpoint);
} finally {
managementClient.close();
}
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class OutboundLdapConnectionTestCase method initializeRoleConfiguration.
@Before
public void initializeRoleConfiguration() throws Exception {
if (containerController.isStarted(CONTAINER) && !serverConfigured) {
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
ManagementClient mgmtClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
prepareServer(mgmtClient);
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class VaultSystemPropertyOnServerStartTestCase method beforeTest.
@Before
public void beforeTest() throws Exception {
LOGGER.trace("*** starting server");
container.start(CONTAINER);
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
managementClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
serverSetup.setup(managementClient, CONTAINER);
LOGGER.trace("Add system property: " + TESTING_SYSTEM_PROPERTY);
ModelNode op = Util.createAddOperation(SYSTEM_PROPERTIES_PATH);
op.get(VALUE).set(BasicVaultServerSetupTask.VAULTED_PROPERTY);
Utils.applyUpdate(op, managementClient.getControllerClient());
LOGGER.trace("*** stoping server");
container.stop(CONTAINER);
Thread.sleep(1000);
int i = 0;
while (managementClient.isServerInRunningState() && ++i < 200) {
Thread.sleep(50);
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class HTTPSWebConnectorTestCase 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");
serverSetup(managementClient);
deployer.deploy(APP_CONTEXT);
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class ReloadRequiringChangesTestCase method testWSDLHostChangeRequiresReloadAndDoesNotAffectRuntime.
@Test
@OperateOnDeployment(DEPLOYMENT)
public void testWSDLHostChangeRequiresReloadAndDoesNotAffectRuntime() 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 "foo-host" and reload
final String hostname = "foo-host";
setWsdlHost(client, hostname);
ServerReload.executeReloadAndWaitForCompletion(client);
//change wsdl-host to "bar-host" and verify deployment still uses "foo-host"
setWsdlHost(client, "bar-host");
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEPLOYMENT + "/POJOService?wsdl");
checkWsdl(wsdlURL, hostname);
} finally {
try {
if (initialWsdlHost != null) {
setWsdlHost(client, initialWsdlHost);
}
} finally {
managementClient.close();
}
}
}
Aggregations