@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);
reloadServer(client, 100000);
//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();
}
}
}