Package org.codehaus.loom.components.util.profile

Examples of org.codehaus.loom.components.util.profile.PartitionProfile


            new ComponentProfile( c2Info, c2aMetaData );
        final ComponentProfile c2bProfile =
            new ComponentProfile( c2Info, c2bMetaData );
        final ComponentProfile c2cProfile =
            new ComponentProfile( c2Info, c2cMetaData );
        final PartitionProfile blockProfile =
            new PartitionProfile( blockMetaData,
                                  PartitionProfile.EMPTY_SET,
                                  new ComponentProfile[]{c3Profile,
                                                         c2aProfile,
                                                         c2bProfile,
                                                         c2cProfile} );
        final PartitionProfile listenerProfile =
            new PartitionProfile( listenerMetaData,
                                  PartitionProfile.EMPTY_SET,
                                  ComponentProfile.EMPTY_SET );
        final PartitionProfile profile =
            new PartitionProfile( metaData,
                                  new PartitionProfile[]{blockProfile,
                                                         listenerProfile},
                                  ComponentProfile.EMPTY_SET );
        verify( profile );
    }
View Full Code Here


                                   new String[ 0 ],
                                   new PartitionTemplate[]{blockPartitionMD,
                                                           listenerPartitionMD},
                                   ComponentTemplate.EMPTY_SET );

        final PartitionProfile blockPartitionProfile =
            new PartitionProfile( blockPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  new ComponentProfile[]{cp1, cp2} );
        final PartitionProfile listenerPartitionProfile =
            new PartitionProfile( listenerPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  ComponentProfile.EMPTY_SET );
        final PartitionProfile partitionProfile =
            new PartitionProfile( partitionMD,
                                  new PartitionProfile[]{blockPartitionProfile,
                                                         listenerPartitionProfile},
                                  ComponentProfile.EMPTY_SET );
        runApplicationTest( partitionProfile );
    }
View Full Code Here

                                   new String[ 0 ],
                                   new PartitionTemplate[]{blockPartitionMD,
                                                           listenerPartitionMD},
                                   ComponentTemplate.EMPTY_SET );

        final PartitionProfile blockPartitionProfile =
            new PartitionProfile( blockPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  new ComponentProfile[]{cp3,
                                                         cp2a,
                                                         cp2b,
                                                         cp2c} );
        final PartitionProfile listenerPartitionProfile =
            new PartitionProfile( listenerPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  ComponentProfile.EMPTY_SET );
        final PartitionProfile partitionProfile =
            new PartitionProfile( partitionMD,
                                  new PartitionProfile[]{blockPartitionProfile,
                                                         listenerPartitionProfile},
                                  ComponentProfile.EMPTY_SET );
        runApplicationTest( partitionProfile );
    }
View Full Code Here

                                   new String[ 0 ],
                                   new PartitionTemplate[]{blockPartitionMD,
                                                           listenerPartitionMD},
                                   ComponentTemplate.EMPTY_SET );

        final PartitionProfile blockPartitionProfile =
            new PartitionProfile( blockPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  new ComponentProfile[]{cp4,
                                                         cp2a,
                                                         cp2b,
                                                         cp2c} );
        final PartitionProfile listenerPartitionProfile =
            new PartitionProfile( listenerPartitionMD,
                                  PartitionProfile.EMPTY_SET,
                                  ComponentProfile.EMPTY_SET );
        final PartitionProfile partitionProfile =
            new PartitionProfile( partitionMD,
                                  new PartitionProfile[]{blockPartitionProfile,
                                                         listenerPartitionProfile},
                                  ComponentProfile.EMPTY_SET );
        runApplicationTest( partitionProfile );
    }
View Full Code Here

    extends TestCase
{
    public void testBasic()
        throws Exception
    {
        final PartitionProfile partitionProfile = assembleSar( "assembly1.xml" );
        final ComponentProfile[] blocks =
            partitionProfile.getPartition( ContainerConstants.BLOCK_PARTITION ).
            getComponents();
        assertEquals( "Block Count", 2, blocks.length );

        final ComponentProfile block1 = blocks[0];
        final ComponentProfile block2 = blocks[1];
        final DependencyDirective[] dependencies1 = block1.getTemplate()
            .getDependencies();
        final DependencyDirective[] dependencies2 = block2.getTemplate()
            .getDependencies();

        assertEquals( "Block1 getImplementationKey",
                      Component1.class.getName(),
                      block1.getTemplate().getImplementationKey() );
        assertEquals( "Block1 getName", "c1", block1.getTemplate().getName() );
        assertEquals( "Block1 getDependencies count",
                      1, dependencies1.length );
        assertEquals( "Block1 dep1 name",
                      "c2",
                      dependencies1[0].getProviderName() );
        assertEquals( "Block1 dep1 role",
                      Service1.class.getName(), dependencies1[0].getKey() );
        assertTrue( "Block1 getBlockInfo non null",
                    null != block1.getInfo() );
        assertEquals( "Block1 isDisableProxy",
                      false,
                      isProxyDisabled( block1 ) );

        assertEquals( "Block2 getImplementationKey",
                      Component2.class.getName(),
                      block2.getTemplate().getImplementationKey() );
        assertEquals( "Block2 getName", "c2", block2.getTemplate().getName() );
        assertEquals( "Block2 getDependencies count",
                      0, dependencies2.length );
        assertTrue( "Block2 getBlockInfo non null",
                    null != block2.getInfo() );
        assertEquals( "Block2 isDisableProxy",
                      true,
                      isProxyDisabled( block2 ) );

        final ComponentProfile[] listeners =
            partitionProfile.getPartition( ContainerConstants.LISTENER_PARTITION ).
            getComponents();
        final ComponentProfile listener = listeners[0];

        assertEquals( "Listener Count", 1, listeners.length );
        assertEquals( "Listener1 getImplementationKey",
View Full Code Here

    }

    public void testComplex()
        throws Exception
    {
        final PartitionProfile partitionProfile = assembleSar( "assembly2.xml" );
        final ComponentProfile[] blocks =
            partitionProfile.getPartition( ContainerConstants.BLOCK_PARTITION )
            .getComponents();
        assertEquals( "Block Count", 4, blocks.length );

        final ComponentProfile block1 = blocks[0];
        final ComponentProfile block2 = blocks[1];
View Full Code Here

TOP

Related Classes of org.codehaus.loom.components.util.profile.PartitionProfile

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.