Package org.jboss.dmr

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


        consumerSession.close();
        consumerSession = null;

        ModelNode result = execute(getTopicOperation("list-durable-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(1, result.asList().size());

        ModelNode op = getTopicOperation("drop-durable-subscription");
        op.get("client-id").set("consumer");
        op.get("subscription-name").set("testDropDurableSubscription");
        result = execute(op, true);
View Full Code Here


        consumerSession.close();
        consumerSession = null;

        ModelNode result = execute(getTopicOperation("list-all-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(2, result.asList().size());

        result = execute(getTopicOperation("drop-all-subscriptions"), true);
        Assert.assertFalse(result.isDefined());

        result = execute(getTopicOperation("list-all-subscriptions"), true);
View Full Code Here

        result = execute(getTopicOperation("drop-all-subscriptions"), true);
        Assert.assertFalse(result.isDefined());

        result = execute(getTopicOperation("list-all-subscriptions"), true);
        Assert.assertTrue(result.isDefined());
        Assert.assertEquals(0, result.asList().size());
    }

    @Test
    public void testAddJndi() throws Exception {
        ModelNode op = getTopicOperation("add-jndi");
View Full Code Here

        op = getTopicOperation("read-attribute");
        op.get("name").set("entries");
        result = execute(op, true);
        Assert.assertTrue(result.isDefined());
        for (ModelNode binding : result.asList()) {
            if (binding.asString().equals("topic/added" + count))
                return;
        }
        Assert.fail("topic/added" + count + " was not found");
    }
View Full Code Here

        final ModelNode inSeries = rolloutPlan1.get(IN_SERIES);
        if(!inSeries.isDefined()) {
            throw new OperationFailedException(MESSAGES.requiredChildIsMissing(ROLLOUT_PLAN, IN_SERIES, plan.toString()));
        }

        final List<ModelNode> groups = inSeries.asList();
        if(groups.isEmpty()) {
            throw new OperationFailedException(MESSAGES.inSeriesIsMissingGroups(plan.toString()));
        }

        for(ModelNode group : groups) {
View Full Code Here

                    throw new OperationFailedException(MESSAGES.serverGroupExpectsSingleChild(plan.toString()));
                }
                validateInSeriesServerGroup(serverGroup.asProperty().getValue());
            } else if(group.hasDefined(CONCURRENT_GROUPS)) {
                final ModelNode concurrent = group.get(CONCURRENT_GROUPS);
                for(ModelNode child: concurrent.asList()) {
                    validateInSeriesServerGroup(child.asProperty().getValue());
                }
            } else {
                throw new OperationFailedException(MESSAGES.unexpectedInSeriesGroup(plan.toString()));
            }
View Full Code Here

        // Check the root logger
        final ModelNode rootLogger = subsystem.get(CommonAttributes.ROOT_LOGGER, CommonAttributes.ROOT_LOGGER_NAME);
        if (rootLogger.isDefined() && rootLogger.hasDefined(CommonAttributes.HANDLERS.getName())) {
            final ModelNode handlers = rootLogger.get(CommonAttributes.HANDLERS.getName());
            for (ModelNode handler : handlers.asList()) {
                if (handlerName.equals(handler.asString())) {
                    attached.add(CommonAttributes.ROOT_LOGGER_NAME);
                }
            }
        }
View Full Code Here

        assertEquals(ModelType.LIST, resourceDescription.get(ATTRIBUTES, TimerAttributeDefinition.INSTANCE.getName(), TYPE).asType());
        assertEquals(ModelType.OBJECT, resourceDescription.get(ATTRIBUTES, TimerAttributeDefinition.INSTANCE.getName(), VALUE_TYPE).getType());

        final ModelNode timerAttr = resource.get(TimerAttributeDefinition.INSTANCE.getName());
        assertTrue(timerAttr.isDefined());
        final List<ModelNode> timers = timerAttr.asList();
        if (!expectTimer) {
            assertEquals(0, timers.size());
        }
        else {
            assertEquals(1, timers.size());
View Full Code Here

        // Check the loggers
        final ModelNode loggers = subsystem.get(CommonAttributes.LOGGER);
        for (Property logger : loggers.asPropertyList()) {
            if (logger.getValue().hasDefined(CommonAttributes.HANDLERS.getName())) {
                final ModelNode handlers = logger.getValue().get(CommonAttributes.HANDLERS.getName());
                for (ModelNode handler : handlers.asList()) {
                    if (handlerName.equals(handler.asString())) {
                        attached.add(logger.getName());
                    }
                }
            }
View Full Code Here

        // Check Async handlers
        final ModelNode asyncHandlers = subsystem.get(CommonAttributes.ASYNC_HANDLER);
        for (Property asyncHandler : asyncHandlers.asPropertyList()) {
            if (asyncHandler.getValue().hasDefined(CommonAttributes.SUBHANDLERS.getName())) {
                final ModelNode subhandlers = asyncHandler.getValue().get(CommonAttributes.SUBHANDLERS.getName());
                for (ModelNode handler : subhandlers.asList()) {
                    if (handlerName.equals(handler.asString())) {
                        attached.add(asyncHandler.getName());
                    }
                }
            }
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.