Package org.jboss.dmr

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


        final ModelNode readRuntimeQueueResourceOp = getRuntimeQueueOperation("read-resource", queueName);
        readRuntimeQueueResourceOp.get(INCLUDE_RUNTIME).set(true);

        // resource does not exist
        ModelNode result = execute(readQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
        result = execute(readRuntimeQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));

        session.createQueue(address, queueName, false);
View Full Code Here


        // resource does not exist
        ModelNode result = execute(readQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
        result = execute(readRuntimeQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));

        session.createQueue(address, queueName, false);

        // resource does not exist for core queue...
        result = execute(readQueueResourceOp, false);
View Full Code Here

        session.createQueue(address, queueName, false);

        // resource does not exist for core queue...
        result = execute(readQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
        // ... but it does for runtime-queue
        result = execute(readRuntimeQueueResourceOp, true);
        assertTrue(result.isDefined());
        assertEquals(address, result.get("queue-address").asString());
View Full Code Here

        session.deleteQueue(queueName);

        // resource no longer exists
        result = execute(readQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
        result = execute(readRuntimeQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
    }

    @Test
View Full Code Here

        // resource no longer exists
        result = execute(readQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
        result = execute(readRuntimeQueueResourceOp, false);
        assertTrue(result.toJSONString(false), result.asString().contains("WFLYCTL0216"));
    }

    @Test
    public void testListAndCountMessages() throws Exception {
View Full Code Here

        for (final ModelNode operation : operations) {
          ModelNode result = ctx.getModelControllerClient().execute(operation);
          if (!Operations.isSuccessfulOutcome(result)) {
            logger.log(Type.ERROR, String.format("Could not switch ports:\nInput:\n%s\nOutput:\n%s",
                    operation.toJSONString(false), result.toJSONString(false)));
            throw new UnableToCompleteException();
          }
        }

        logger.branch(Type.INFO, "Port change successful. Waiting for AS to reload...");
View Full Code Here

        final ModelNode operation = getAddOperation(appRootDir.getAbsolutePath());
        final ModelNode result = ctx.getModelControllerClient().execute(operation);
        if (!Operations.isSuccessfulOutcome(result)) {
          logger.log(Type.ERROR, String.format("Could not add deployment:\nInput:\n%s\nOutput:\n%s",
                  operation.toJSONString(false), result.toJSONString(false)));
          throw new UnableToCompleteException();
        }

        logger.log(Type.INFO, "Deployment resource added");
        logger.unbranch();
View Full Code Here

      ModelNode result = ctx.getModelControllerClient().execute(operation);
      if (!Operations.isSuccessfulOutcome(result)) {
        logger.log(
                Type.ERROR,
                String.format("Could not shutdown AS:\nInput:\n%s\nOutput:\n%s", operation.toJSONString(false),
                        result.toJSONString(false)));
        throw new UnableToCompleteException();
      }

      logger.log(Type.INFO, String.format("%s removed", getAppName()));
      logger.unbranch();
View Full Code Here

      if (!Operations.isSuccessfulOutcome(result)) {
        logger.log(
                Type.ERROR,
                String.format("Could not %s %s:\nInput:\n%s\nOutput:\n%s", opName, getAppName(),
                        operation.toJSONString(false), result.toJSONString(false)));
        throw new UnableToCompleteException();
      }

      logger.log(Type.INFO, String.format("%s %sed", getAppName(), opName));
      logger.unbranch();
View Full Code Here

            } else if (GET_ROLES_AS_JSON.equals(operationName)) {
                addressValidator.validate(operation);
                String json = serverControl.getRolesAsJSON(operation.require(ADDRESS_MATCH).asString());
                ModelNode camelCase = ModelNode.fromJSONString(json);
                ModelNode converted = CamelCaseUtil.convertSecurityRole(camelCase);
                json = converted.toJSONString(true);
                context.getResult().set(json);
            } else if (GET_ADDRESS_SETTINGS_AS_JSON.equals(operationName)) {
                addressValidator.validate(operation);
                String json = serverControl.getAddressSettingsAsJSON(operation.require(ADDRESS_MATCH).asString());
                context.getResult().set(json);
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.