Package org.jboss.dmr

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


                            break;
                        case DOUBLE:
                            toSet.set(modelValue.asDouble());
                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
View Full Code Here


        final String name = nameValue.isDefined() ? nameValue.asString() : null;
        final String domain = domainValue.isDefined() ? domainValue.asString() : null;
        final String comment = commentValue.isDefined() ? commentValue.asString() : null;
        final Boolean secure = secureValue.isDefined() ? secureValue.asBoolean() : null;
        final Boolean httpOnly = httpOnlyValue.isDefined() ? httpOnlyValue.asBoolean() : null;
        final Integer maxAge = maxAgeValue.isDefined() ? maxAgeValue.asInt() : null;
        return new SessionCookieConfig(name, domain, comment, httpOnly, secure, maxAge);
    }


    private static class SessionCookieAdd extends RestartParentResourceAddHandler {
View Full Code Here

        ModelNode asyncWriteThreadPool = FileStoreResourceDefinition.ASYNC_WRITE_THREAD_POOL
            .resolveModelAttribute(context, resource);

        fileStoreBuilder.preserveState(!alwaysCreateFiles.asBoolean());
        fileStoreBuilder.asyncWrite(asyncWrite.asBoolean());
        fileStoreBuilder.asyncWriteThreadPool(asyncWriteThreadPool.asInt());

        if (serviceBuilder != null) {
            FileIdentityStoreService storeService = new FileIdentityStoreService(fileStoreBuilder, workingDir, relativeTo);
            ServiceName storeServiceName = PartitionManagerService
                .createIdentityStoreServiceName(partitionManagerService.getName(), configurationName, ModelElement.FILE_STORE
View Full Code Here

            ModelNode op = createOpNode(path, READ_CHILDREN_RESOURCES_OPERATION);
            op.get(ModelDescriptionConstants.CHILD_TYPE).set(ModelDescriptionConstants.APPLIES_TO);
            System.out.println("Testing " + acdKey);
            ModelNode result = RbacUtil.executeOperation(client, op, Outcome.SUCCESS).get(ModelDescriptionConstants.RESULT);
            Assert.assertTrue(acdKey + "result is defined", result.isDefined());
            Assert.assertTrue(acdKey + "result has content", result.asInt() > 0);
            boolean foundResource = false;
            boolean foundAttr = false;
            boolean foundOps = false;
            for (Property prop : result.asPropertyList()) {
                ModelNode pathResult = prop.getValue();
View Full Code Here

                if (pathResult.get(ModelDescriptionConstants.ENTIRE_RESOURCE).asBoolean()) {
                    Assert.assertTrue(acdKey + " -- " + prop.getName() + " resource", expectedDef.expectResource);
                    foundResource = true;
                }
                ModelNode attrs = pathResult.get(ATTRIBUTES);
                if (attrs.isDefined() && attrs.asInt() > 0) {
                    Assert.assertTrue(acdKey + " -- " + prop.getName() + " attributes = " + attrs.asString(), expectedDef.expectAttributes);
                    foundAttr = true;
                }
                ModelNode ops = pathResult.get(OPERATIONS);
                if (ops.isDefined() && ops.asInt() > 0) {
View Full Code Here

                if (attrs.isDefined() && attrs.asInt() > 0) {
                    Assert.assertTrue(acdKey + " -- " + prop.getName() + " attributes = " + attrs.asString(), expectedDef.expectAttributes);
                    foundAttr = true;
                }
                ModelNode ops = pathResult.get(OPERATIONS);
                if (ops.isDefined() && ops.asInt() > 0) {
                    Assert.assertTrue(acdKey + " -- " + prop.getName() + " operations = " + ops.asString(), expectedDef.expectOps);
                    foundOps = true;
                }
            }
View Full Code Here

                                                StatisticNameLookup.statisticNameLookup(statisticName),
                                                Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                                    } else if(Integer.class.equals(statistics.getType(statisticName))) {
                                        statistics.setValue(
                                                statisticName,
                                                value.asInt(),
                                                entityManagerFactoryLookup,
                                                StatisticNameLookup.statisticNameLookup(statisticName),
                                                Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                                    } else if(Long.class.equals(statistics.getType(statisticName))) {
                                        statistics.setValue(
View Full Code Here

    public void testSimpleDouble() {
        ModelNode val = new ModelNode(1d);
        Assert.assertFalse(testee.rejectAttribute(PathAddress.EMPTY_ADDRESS, "foo", val, null));
        testee.convertAttribute(PathAddress.EMPTY_ADDRESS, "foo", val, null);
        Assert.assertEquals(ModelType.INT, val.getType());
        Assert.assertEquals(1, val.asInt());
    }

    @Test
    public void testNonIntegerDouble() {
        ModelNode val = new ModelNode(1.1d);
View Full Code Here

        ModelNode result = managementClient.getControllerClient().execute(operation);
        System.out.println("\n\ngetEntityInsertCount result asString = " + result.asString());

        assertTrue("success".equals(result.get("outcome").asString()));
        result = result.get("result");
        return result.asInt();
    }

}
View Full Code Here

        ModelNode legacySessionCapacity = legacySubsystem.get(SUBSYSTEM, ModClusterExtension.SUBSYSTEM_NAME, MOD_CLUSTER_CONFIG, CONFIGURATION,
                CommonAttributes.DYNAMIC_LOAD_PROVIDER, CONFIGURATION, CommonAttributes.LOAD_METRIC, "sessions", CommonAttributes.CAPACITY);
        Assert.assertEquals(ModelType.DOUBLE, mainSessionCapacity.getType());
        Assert.assertEquals(ModelType.INT, legacySessionCapacity.getType());
        Assert.assertFalse(mainSessionCapacity.asString().equals(legacySessionCapacity.asString()));
        Assert.assertEquals(mainSessionCapacity.asInt(), legacySessionCapacity.asInt());
    }

    @Test
    public void testTransformers720() throws Exception {
        testTransformers_1_3_0(ModelTestControllerVersion.V7_2_0_FINAL, "1.2.3.Final");
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.