Package org.jboss.as.subsystem.test.ModelDescriptionValidator

Examples of org.jboss.as.subsystem.test.ModelDescriptionValidator.ValidationConfiguration


        return clone;
    }

    private void validateDescriptionProviders(AdditionalInitialization additionalInit, KernelServices kernelServices) {
        ValidationConfiguration arbitraryDescriptors = additionalInit.getModelValidationConfiguration();
        ModelNode address = new ModelNode();
        address.setEmptyList();
        address.add("subsystem", mainSubsystemName);

        ModelNode op = new ModelNode();
View Full Code Here


        ModelNode description = getDescription();

        removeSubsystems(description);

        ValidationConfiguration config = new ValidationConfiguration();

        //TODO should be possible to validate the operations executed...

        //TODO get rid of this to test the deployment section AS7-1832
        description.get(CHILDREN, DEPLOYMENT, MODEL_DESCRIPTION, "*", CHILDREN, "subdeployment", MODEL_DESCRIPTION, "*", CHILDREN).remove("subdeployment");

        System.out.println(description);

        final ModelNode ROOT_ADDR = new ModelNode().setEmptyList();
        //Exclude the operations where one of the reply properties is known to have {type=OBJECT,value-type=UNDEFINED}
        config.allowNullValueTypeForOperationParameter(ROOT_ADDR, VALIDATE_OPERATION, VALUE);
        config.allowNullValueTypeForOperationParameter(ROOT_ADDR, ValidateAddressOperationHandler.OPERATION_NAME, VALUE);

        //Exclude the operations where reply-properties is known to have {type=OBJECT,value-type=UNDEFINED}
        config.allowNullValueTypeForOperationReplyProperties(ROOT_ADDR, READ_OPERATION_DESCRIPTION_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(ROOT_ADDR, READ_RESOURCE_DESCRIPTION_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(ROOT_ADDR, READ_RESOURCE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(ROOT_ADDR, READ_ATTRIBUTE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(createPlatformMBeanAddress(PlatformMBeanConstants.COMPILATION), READ_RESOURCE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(createPlatformMBeanAddress(PlatformMBeanConstants.THREADING), READ_RESOURCE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(createPlatformMBeanAddress(PlatformMBeanConstants.OPERATING_SYSTEM), READ_RESOURCE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(createPlatformMBeanAddress(PlatformMBeanConstants.MEMORY_POOL), READ_RESOURCE_OPERATION);
        config.allowNullValueTypeForOperationReplyProperties(createPlatformMBeanAddress(PlatformMBeanConstants.RUNTIME), READ_RESOURCE_OPERATION);
        final ModelNode MEMORY_POOL_CHILDREN_ADDR = createPlatformMBeanAddress(PlatformMBeanConstants.MEMORY_POOL);
        MEMORY_POOL_CHILDREN_ADDR.add(NAME, "*");
        config.allowNullValueTypeForOperationReplyProperties(MEMORY_POOL_CHILDREN_ADDR, READ_RESOURCE_OPERATION);

        ModelDescriptionValidator validator = new ModelDescriptionValidator(new ModelNode().setEmptyList(), description, config);
        List<ValidationFailure> failures = validator.validateResource();

        if (failures.size() > 0) {
View Full Code Here

        return clone;
    }

    private void validateDescriptionProviders(AdditionalInitialization additionalInit, KernelServices kernelServices) {
        ValidationConfiguration arbitraryDescriptors = additionalInit.getModelValidationConfiguration();
        ModelNode address = new ModelNode();
        address.setEmptyList();
        address.add("subsystem", mainSubsystemName);

        ModelNode op = new ModelNode();
View Full Code Here


    @Override
    protected ValidationConfiguration getModelValidationConfiguration() {
        // use this configuration to report any exceptional cases for DescriptionProviders
        return new ValidationConfiguration();
    }
View Full Code Here

    }

    @Override
    protected ValidationConfiguration getModelValidationConfiguration() {
        // use this configuration to report any exceptional cases for DescriptionProviders
        return new ValidationConfiguration();
    }
View Full Code Here

        description.get(OPERATIONS, ROOT_OP, REPLY_PROPERTIES, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, ATTRIBUTES, CHILD_ATTR, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REQUEST_PROPERTIES, PARAM, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REPLY_PROPERTIES, "added").set("ok");

        ValidationConfiguration arbitraryDescriptors = new ValidationConfiguration();
        arbitraryDescriptors.registerAttributeArbitraryDescriptor(ROOT_ADDRESS, ROOT_ATTR, "added", null);
        arbitraryDescriptors.registerArbitraryDescriptorForOperation(ROOT_ADDRESS, ROOT_OP, "added", null);
        arbitraryDescriptors.registerAttributeArbitraryDescriptor(CHILD_ADDRESS, CHILD_ATTR, "added", null);
        arbitraryDescriptors.registerArbitraryDescriptorForOperation(CHILD_ADDRESS, CHILD_OP, "added", null);

        List<ValidationFailure> errors = validate(description, arbitraryDescriptors);
        Assert.assertEquals(0, errors.size());
    }
View Full Code Here

     * in the controller. The default is an empty registry.
     *
     * @return An ArbitraryDescriptors instance containing the arbitrary descriptors, or {@code null} to not validate the description providers.
     */
    protected ModelDescriptionValidator.ValidationConfiguration getModelValidationConfiguration() {
        return new ValidationConfiguration();
    }
View Full Code Here

        description.get(OPERATIONS, ROOT_OP, REQUEST_PROPERTIES, PARAM, "added").set("ok");
        description.get(OPERATIONS, ROOT_OP, REPLY_PROPERTIES, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REQUEST_PROPERTIES, PARAM, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REPLY_PROPERTIES, "added").set("ok");

        ValidationConfiguration arbitraryDescriptors = new ValidationConfiguration();
        arbitraryDescriptors.registerArbitraryDescriptorForOperationParameter(ROOT_ADDRESS, ROOT_OP, PARAM, "added", null);
        arbitraryDescriptors.registerArbitraryDescriptorForOperationParameter(CHILD_ADDRESS, CHILD_OP, PARAM, "added", null);

        List<ValidationFailure> errors = validate(description, arbitraryDescriptors);
        Assert.assertEquals(2, errors.size());
        assertOperationParameterFailure(errors.get(0), ROOT_ADDRESS, ROOT_OP, REPLY_PROPERTIES);
        assertOperationParameterFailure(errors.get(1), CHILD_ADDRESS, CHILD_OP, REPLY_PROPERTIES);
View Full Code Here

        description.get(OPERATIONS, ROOT_OP, REQUEST_PROPERTIES, PARAM, "added").set("ok");
        description.get(OPERATIONS, ROOT_OP, REPLY_PROPERTIES, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REQUEST_PROPERTIES, PARAM, "added").set("ok");
        description.get(CHILDREN, CHILD_TYPE, MODEL_DESCRIPTION, CHILD_NAME, OPERATIONS, CHILD_OP, REPLY_PROPERTIES, "added").set("ok");

        ValidationConfiguration arbitraryDescriptors = new ValidationConfiguration();
        arbitraryDescriptors.registerArbitraryDescriptorForOperationReplyProperties(ROOT_ADDRESS, ROOT_OP, "added", null);
        arbitraryDescriptors.registerArbitraryDescriptorForOperationReplyProperties(CHILD_ADDRESS, CHILD_OP, "added", null);

        List<ValidationFailure> errors = validate(description, arbitraryDescriptors);
        Assert.assertEquals(2, errors.size());
        assertOperationParameterFailure(errors.get(0), ROOT_ADDRESS, ROOT_OP, PARAM);
        assertOperationParameterFailure(errors.get(1), CHILD_ADDRESS, CHILD_OP, PARAM);
View Full Code Here

    @Test
    public void testConfiguredAllowNullValueTypeForList() {
        ModelNode description = createSubsystemSkeleton(ModelType.LIST, (ModelType)null);

        ValidationConfiguration arbitraryDescriptors = new ValidationConfiguration();
        arbitraryDescriptors.allowNullValueTypeForAttribute(ROOT_ADDRESS, ROOT_ATTR);
        arbitraryDescriptors.allowNullValueTypeForOperation(ROOT_ADDRESS, ROOT_OP);
        arbitraryDescriptors.allowNullValueTypeForAttribute(CHILD_ADDRESS, CHILD_ATTR);
        arbitraryDescriptors.allowNullValueTypeForOperation(CHILD_ADDRESS, CHILD_OP);

        List<ValidationFailure> errors = validate(description, arbitraryDescriptors);
        dumpErrors(errors);
        Assert.assertEquals(0, errors.size());
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.subsystem.test.ModelDescriptionValidator.ValidationConfiguration

Copyright © 2018 www.massapicom. 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.