Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.toJSONString()


        // build an ADD command to add a transport property using expression value
        ModelNode operation = getTransportPropertyAddOperation("maximal", "bundler_type", "${the_bundler_type:new}");

        // perform operation on the 1.1.1 model
        ModelNode mainResult = services.executeOperation(operation);
        assertEquals(mainResult.toJSONString(true), SUCCESS, mainResult.get(OUTCOME).asString());
    }

    @Test
    public void testRejectionsAS712() throws Exception {
        ModelTestControllerVersion version = ModelTestControllerVersion.V7_1_2_FINAL;
View Full Code Here


    private void executeMDBOperation(String mdbName, String opName) throws IOException {
        ModelNode operation = createMDBOperation(mdbName);
        operation.get(OP).set(opName);
        ModelNode result = managementClient.getControllerClient().execute(operation);

        assertTrue(result.toJSONString(true), result.hasDefined(OUTCOME));
        assertEquals(result.toJSONString(true), SUCCESS, result.get(OUTCOME).asString());
    }

    private void assertMDBDeliveryIsActive(String mdbName, boolean expected) throws IOException {
        ModelNode operation = createMDBOperation(mdbName);
View Full Code Here

        ModelNode operation = createMDBOperation(mdbName);
        operation.get(OP).set(opName);
        ModelNode result = managementClient.getControllerClient().execute(operation);

        assertTrue(result.toJSONString(true), result.hasDefined(OUTCOME));
        assertEquals(result.toJSONString(true), SUCCESS, result.get(OUTCOME).asString());
    }

    private void assertMDBDeliveryIsActive(String mdbName, boolean expected) throws IOException {
        ModelNode operation = createMDBOperation(mdbName);
        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
View Full Code Here

        ModelNode operation = createMDBOperation(mdbName);
        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
        operation.get(NAME).set("delivery-active");
        ModelNode result = managementClient.getControllerClient().execute(operation);

        assertTrue(result.toJSONString(true), result.hasDefined(OUTCOME));
        assertEquals(result.toJSONString(true), expected, result.get(RESULT).asBoolean());
    }

    private ModelNode createMDBOperation(String mdbName) {
        ModelNode operation = new ModelNode();
View Full Code Here

        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
        operation.get(NAME).set("delivery-active");
        ModelNode result = managementClient.getControllerClient().execute(operation);

        assertTrue(result.toJSONString(true), result.hasDefined(OUTCOME));
        assertEquals(result.toJSONString(true), expected, result.get(RESULT).asBoolean());
    }

    private ModelNode createMDBOperation(String mdbName) {
        ModelNode operation = new ModelNode();
        operation.get(OP_ADDR).add("deployment", "mdb.jar");
View Full Code Here

        operation.get(OP_ADDR).add("connection-factory", "RemoteConnectionFactory");
        operation.get(OP).set(READ_RESOURCE_OPERATION);
        operation.get(INCLUDE_RUNTIME).set(true);
        ModelNode result = execute(client, operation);
        // initial-message-packet-size is a runtime attribute. if the server is passive, it returns undefined
        assertEquals(result.toJSONString(true), active, result.get(RESULT, "initial-message-packet-size").isDefined());

        // runtime operation
        operation.get(OP).set("add-jndi");
        operation.get("jndi-binding").set("java:jboss/exported/jms/" + randomUUID().toString());
        if (active) {
View Full Code Here

        ModelNode operation = new ModelNode();
        operation.get(OP_ADDR).set(address);
        operation.get(OP).set(READ_RESOURCE_OPERATION);
        operation.get(INCLUDE_RUNTIME).set(true);
        ModelNode result = execute(client, operation);
        assertEquals(result.toJSONString(true), active, result.get(RESULT, runtimeAttributeName).isDefined());

        // runtime operation
        operation.get(OP).set("list-messages");
        if (active) {
            execute(client, operation);
View Full Code Here

        operation.get(OP_ADDR).add("hornetq-server", "default");
        operation.get(OP_ADDR).add("jms-topic", jmsTopicName);
        operation.get(OP).set(READ_RESOURCE_OPERATION);
        operation.get(INCLUDE_RUNTIME).set(true);
        ModelNode result = execute(client, operation);
        assertEquals(result.toJSONString(true), active, result.get(RESULT, "topic-address").isDefined());

        // runtime operation
        operation.get(OP).set("list-all-subscriptions");
        if (active) {
            execute(client, operation);
View Full Code Here

        return result;
    }

    private static void executeWithFailure(ModelControllerClient client, ModelNode operation) throws IOException {
        ModelNode result = client.execute(operation);
        assertEquals(result.toJSONString(true), FAILED, result.get(OUTCOME).asString());
        assertTrue(result.toJSONString(true), result.get(FAILURE_DESCRIPTION).asString().contains("WFLYMSG0066"));
        assertFalse(result.has(RESULT));
    }

}
View Full Code Here

    }

    private static void executeWithFailure(ModelControllerClient client, ModelNode operation) throws IOException {
        ModelNode result = client.execute(operation);
        assertEquals(result.toJSONString(true), FAILED, result.get(OUTCOME).asString());
        assertTrue(result.toJSONString(true), result.get(FAILURE_DESCRIPTION).asString().contains("WFLYMSG0066"));
        assertFalse(result.has(RESULT));
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.