[jboss-jira] [JBoss JIRA] (AS7-1787) Fix JGroups description providers for the improved validation in jboss-as-subsystem-test

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Thu Feb 2 15:40:48 EST 2012


    [ https://issues.jboss.org/browse/AS7-1787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663877#comment-12663877 ] 

Richard Achmatowicz edited comment on AS7-1787 at 2/2/12 3:39 PM:
------------------------------------------------------------------

Added in the following:

{noformat}
    @Override
    protected ValidationConfiguration getModelValidationConfiguration() {
        // use this configuration to report any exceptional cases for description providers
        return new ValidationConfiguration();
    }
{noformat}

which activates descriptor validation and at the same time reminds me that there are sometimes circumstances where we need to temporarily disable sanity of the descriptor setup.

This revealed about 4 errors with descriptors which I had missed. Also, I had to add the following method to turn off checks for resource removal when resources are not removed by the standard remove commands (in this case, we use remove-protocol as adding and removing of of protocols are managed by their parent):

{noformat}
    @Override
    protected Set<PathAddress> getIgnoredChildResourcesForRemovalTest() {

        // create a collection of resources in the test which are not removed by a "remove" command
        // i.e. all resources of form /subsystem=jgroups/stack=maximal/protocol=*

        String[] protocolList = { "MPING", "MERGE2", "FD_SOCK", "FD", "VERIFY_SUSPECT", "BARRIER",
            "pbcast.NAKACK", "UNICAST2", "pbcast.STABLE", "pbcast.GMS", "UFC", "MFC", "FRAG2",
            "pbcast.STATE_TRANSFER", "pbcast.FLUSH" } ;

        PathAddress subsystem = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, JGroupsExtension.SUBSYSTEM_NAME));
        PathAddress stack = subsystem.append(PathElement.pathElement(ModelKeys.STACK, "maximal")) ;

        List<PathAddress> addresses = new ArrayList<PathAddress>() ;
        for (String protocol : protocolList) {
            PathAddress ignoredChild = stack.append(PathElement.pathElement(ModelKeys.PROTOCOL, protocol)); ;
            addresses.add(ignoredChild);
        }
        return new HashSet<PathAddress>(addresses) ;
    }

{noformat}

Testsuite now passes.

                
      was (Author: rachmato):
    Added in the following:

{noformat}
    @Override
    protected ValidationConfiguration getModelValidationConfiguration() {
        // use this configuration to report any exceptional cases for description providers
        return new ValidationConfiguration();
    }
{noformat}

which activates descriptor validation and at the same time reminds me that there are sometimes circumstances where we need to temporarily disable sanity of the descriptor setup.

This revealed about 4 errors with descriptors which I had missed. Also, I had to add the following method to turn off checks for resource removal when resources are not removed by the standard remove commands (in this case, we use remove-protocol as adding and removing of of protocols are managed by their parent):

{noformat}
    @Override
    protected Set<PathAddress> getIgnoredChildResourcesForRemovalTest() {

        // create a collection of resources in the test which are not removed by a "remove" command
        // i.e. all resources of form /subsystem=jgroups/stack=maximal/protocol=*

        String[] protocolList = { "MPING", "MERGE2", "FD_SOCK", "FD", "VERIFY_SUSPECT", "BARRIER",
            "pbcast.NAKACK", "UNICAST2", "pbcast.STABLE", "pbcast.GMS", "UFC", "MFC", "FRAG2",
            "pbcast.STATE_TRANSFER", "pbcast.FLUSH" } ;

        PathAddress subsystem = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, JGroupsExtension.SUBSYSTEM_NAME));
        PathAddress stack = subsystem.append(PathElement.pathElement(ModelKeys.STACK, "maximal")) ;

        List<PathAddress> addresses = new ArrayList<PathAddress>() ;
        for (String protocol : protocolList) {
            PathAddress ignoredChild = stack.append(PathElement.pathElement(ModelKeys.PROTOCOL, protocol)); ;
            addresses.add(ignoredChild);
            System.out.println("ignored child address = " + ignoredChild.toString());
        }
        return new HashSet<PathAddress>(addresses) ;
    }

{noformat}

Testsuite now passes.

                  
> Fix JGroups description providers for the improved validation in jboss-as-subsystem-test
> ----------------------------------------------------------------------------------------
>
>                 Key: AS7-1787
>                 URL: https://issues.jboss.org/browse/AS7-1787
>             Project: Application Server 7
>          Issue Type: Feature Request
>          Components: Clustering
>            Reporter: Kabir Khan
>            Assignee: Richard Achmatowicz
>             Fix For: 7.1.0.Final
>
>
> I added a test called JGroupsSubsystemTest which uses our subsystem testing framework which attempts to validate the description providers, this will be committed to upstream in the next few days. 
> To make the tests pass I had to override AdditionalInitialization.getModelValidationConfiguration() as follows:
> {code}
>             @Override
>             protected ValidationConfiguration getModelValidationConfiguration() {
>                 return null;
>             }
> {code}
> Returning null basically turns off validation of the providers. What I have added is a minimum of what is required for subsystem testing, the test framework allows you to do a lot of other stuff, see the jmx subsystem test for some examples.
> The wip lives at https://github.com/kabir/jboss-as/tree/subsystem-test-model-fixes

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list