use of org.jboss.as.controller.client.OperationBuilder in project wildfly by wildfly.
the class SlaveHostControllerAuthenticationTestCase method setSlaveSecret.
private static void setSlaveSecret(String value) throws IOException {
ModelNode op = new ModelNode();
op.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
op.get(OP_ADDR).add(HOST, "slave").add(CORE_SERVICE, MANAGEMENT).add(SECURITY_REALM, "ManagementRealm").add(SERVER_IDENTITY, SECRET);
op.get(NAME).set(VALUE);
op.get(VALUE).set(value);
domainSlaveClient.execute(new OperationBuilder(op).build());
}
use of org.jboss.as.controller.client.OperationBuilder in project wildfly by wildfly.
the class ModelPersistenceTestCase method executeAndRollbackOperation.
protected void executeAndRollbackOperation(DomainClient client, final ModelNode op) throws IOException, OperationFormatException {
ModelNode addDeploymentOp = ModelUtil.createOpNode("deployment=malformedDeployment.war", "add");
addDeploymentOp.get("content").get(0).get("input-stream-index").set(0);
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
builder.setOperationName("deploy");
builder.addNode("deployment", "malformedDeployment.war");
ModelNode[] steps = new ModelNode[3];
steps[0] = op;
steps[1] = addDeploymentOp;
steps[2] = builder.buildRequest();
ModelNode compositeOp = ModelUtil.createCompositeNode(steps);
OperationBuilder ob = new OperationBuilder(compositeOp, true);
ob.addInputStream(new FileInputStream(getBrokenWar()));
ModelNode ret = client.execute(ob.build());
Assert.assertFalse(SUCCESS.equals(ret.get(OUTCOME).asString()));
}
use of org.jboss.as.controller.client.OperationBuilder in project wildfly by wildfly.
the class DeploymentManagementTestCase method testManagedReplaceUnmanaged.
@Test
public void testManagedReplaceUnmanaged() throws Exception {
// Establish the deployment
testUnmanagedArchiveDeployment();
ModelNode content = new ModelNode();
content.get(INPUT_STREAM_INDEX).set(0);
ModelNode op = createDeploymentReplaceOperation(content, MAIN_SERVER_GROUP_ADDRESS, OTHER_SERVER_GROUP_ADDRESS);
OperationBuilder builder = new OperationBuilder(op, true);
builder.addInputStream(webArchive.as(ZipExporter.class).exportAsInputStream());
executeOnMaster(builder.build());
// Thread.sleep(1000);
performHttpCall(DomainTestSupport.masterAddress, 8080);
performHttpCall(DomainTestSupport.slaveAddress, 8630);
}
use of org.jboss.as.controller.client.OperationBuilder in project wildfly by wildfly.
the class DeploymentManagementTestCase method testDeployToSingleServerGroup.
@Test
public void testDeployToSingleServerGroup() throws Exception {
ModelNode content = new ModelNode();
content.get(INPUT_STREAM_INDEX).set(0);
ModelNode composite = createDeploymentOperation(content, OTHER_SERVER_GROUP_DEPLOYMENT_ADDRESS);
OperationBuilder builder = new OperationBuilder(composite, true);
builder.addInputStream(webArchive.as(ZipExporter.class).exportAsInputStream());
executeOnMaster(builder.build());
performHttpCall(DomainTestSupport.slaveAddress, 8630);
try {
performHttpCall(DomainTestSupport.masterAddress, 8080);
fail("Webapp deployed to unselected server group");
} catch (IOException ioe) {
// good
}
}
use of org.jboss.as.controller.client.OperationBuilder in project wildfly by wildfly.
the class DeploymentManagementTestCase method testReplace.
@Test
public void testReplace() throws Exception {
// Establish the deployment
testDeploymentViaStream();
ModelNode content = new ModelNode();
content.get(INPUT_STREAM_INDEX).set(0);
ModelNode op = createDeploymentReplaceOperation(content, MAIN_SERVER_GROUP_ADDRESS, OTHER_SERVER_GROUP_ADDRESS);
OperationBuilder builder = new OperationBuilder(op, true);
builder.addInputStream(webArchive.as(ZipExporter.class).exportAsInputStream());
executeOnMaster(builder.build());
// Thread.sleep(1000);
performHttpCall(DomainTestSupport.masterAddress, 8080);
performHttpCall(DomainTestSupport.slaveAddress, 8630);
}
Aggregations