use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class WSAttributesChangesTestCase method performWsdlPortAttributeTest.
private void performWsdlPortAttributeTest(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 portA = "55667";
ModelNode op = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-port");
op.get(VALUE).set(portA);
//update successful, no need to reload
applyUpdate(client, op, false);
//now we deploy an endpoint...
deployer.deploy(DEP_2);
//verify the updated wsdl port is used...
URL wsdlURL = new URL(managementClient.getWebUri().toURL(), '/' + DEP_2 + "/POJOService?wsdl");
checkWsdl(wsdlURL, portA);
if (checkUpdateWithDeployedEndpoint) {
final String portB = "55668";
ModelNode opB = createOpNode("subsystem=webservices/", WRITE_ATTRIBUTE_OPERATION);
opB.get(NAME).set("wsdl-port");
opB.get(VALUE).set(portB);
//update again, but we'll need to reload, as there's an active deployment
applyUpdate(client, opB, true);
//check the wsdl port is still the one we updated to before
checkWsdl(wsdlURL, portA);
//and check that still applies even if we undeploy and redeploy the endpoint
deployer.undeploy(DEP_2);
deployer.deploy(DEP_2);
checkWsdl(wsdlURL, portA);
}
} finally {
try {
deployer.undeploy(DEP_2);
} catch (Throwable t) {
//ignore
}
try {
ModelNode op = createOpNode("subsystem=webservices/", UNDEFINE_ATTRIBUTE_OPERATION);
op.get(NAME).set("wsdl-port");
applyUpdate(client, op, checkUpdateWithDeployedEndpoint);
} finally {
managementClient.close();
}
}
}
use of org.jboss.as.arquillian.container.ManagementClient 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));
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class OutboundLdapConnectionTestCase method restoreRoleConfiguration.
@After
public void restoreRoleConfiguration() throws Exception {
if (serverConfigured && containerController.isStarted(CONTAINER)) {
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
ManagementClient mgmtClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
cleanUpServer(mgmtClient);
}
}
use of org.jboss.as.arquillian.container.ManagementClient in project wildfly by wildfly.
the class SSLEJBRemoteClientTestCase method tearDown.
@AfterClass
public static void tearDown() throws Exception {
final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
final ManagementClient mClient = new ManagementClient(client, TestSuiteEnvironment.getServerAddress(), TestSuiteEnvironment.getServerPort(), "http-remoting");
SSLRealmSetupTool.tearDown(mClient, container);
}
Aggregations