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

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


                                   C4_NAME,
                                   c4Deps,
                                   null,
                                   null,
                                   false );
        final ComponentProfile cp4 = new ComponentProfile( C4, md4 );
        final ComponentTemplate md2a =
            new ComponentTemplate( "c2a",
                                   C2_NAME,
                                   DependencyDirective.EMPTY_SET,
                                   null,
                                   null,
                                   false );
        final ComponentProfile cp2a = new ComponentProfile( C2, md2a );
        final ComponentTemplate md2b =
            new ComponentTemplate( "c2b",
                                   C2_NAME,
                                   DependencyDirective.EMPTY_SET,
                                   null,
                                   null,
                                   false );
        final ComponentProfile cp2b = new ComponentProfile( C2, md2b );
        final ComponentTemplate md2c =
            new ComponentTemplate( "c2c",
                                   C2_NAME,
                                   DependencyDirective.EMPTY_SET,
                                   null,
                                   null,
                                   false );
        final ComponentProfile cp2c = new ComponentProfile( C2, md2c );

        final PartitionTemplate blockPartitionMD =
            new PartitionTemplate( ContainerConstants.BLOCK_PARTITION,
                                   new String[]{
                                       ContainerConstants.LISTENER_PARTITION},
View Full Code Here


        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",
                      Listener1.class.getName(),
                      listener.getTemplate().getImplementationKey() );
        assertEquals( "Listener1 getName",
                      "l1",
                      listener.getTemplate().getName() );
    }
View Full Code Here

        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];
        final ComponentProfile block3 = blocks[2];
        final ComponentProfile block4 = blocks[3];
        final DependencyDirective[] dependencies1 = block1.getTemplate()
            .getDependencies();
        final DependencyDirective[] dependencies2 = block2.getTemplate()
            .getDependencies();
        final DependencyDirective[] dependencies3 = block3.getTemplate()
            .getDependencies();
        final DependencyDirective[] dependencies4 = block4.getTemplate()
            .getDependencies();

        assertEquals( "Block1 getImplementationKey",
                      Component2.class.getName(),
                      block1.getTemplate().getImplementationKey() );
        assertEquals( "Block1 getName",
                      "c2a",
                      block1.getTemplate().getName() );
        assertEquals( "Block1 getDependencies count",
                      0, dependencies1.length );
        assertTrue( "Block2 getBlockInfo non null",
                    null != block1.getInfo() );
        assertEquals( "Block1 isDisableProxy",
                      false,
                      isProxyDisabled( block1 ) );

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

        assertEquals( "Block3 getImplementationKey",
                      Component2.class.getName(),
                      block3.getTemplate().getImplementationKey() );
        assertEquals( "Block3 getName",
                      "c2c",
                      block3.getTemplate().getName() );
        assertEquals( "Block3 getDependencies count",
                      0, dependencies3.length );
        assertTrue( "Block3 getBlockInfo non null",
                    null != block3.getInfo() );
        assertEquals( "Block3 isDisableProxy",
                      false,
                      isProxyDisabled( block3 ) );

        assertEquals( "Block4 getImplementationKey",
                      Component3.class.getName(),
                      block4.getTemplate().getImplementationKey() );
        assertEquals( "Block4 getName", "c3", block4.getTemplate().getName() );
        assertEquals( "Block4 getDependencies count",
                      3, dependencies4.length );
        final DependencyDirective dependency1 = dependencies4[0];
        final DependencyDirective dependency2 = dependencies4[1];
        final DependencyDirective dependency3 = dependencies4[2];
        assertEquals( "Block4 dep1 name",
                      "c2a",
                      dependency1.getProviderName() );
        assertEquals( "Block4 dep1 role",
                      Service1.class.getName(), dependency1.getKey() );
        assertEquals( "Block4 dep1 name",
                      "c2b",
                      dependency2.getProviderName() );
        assertEquals( "Block4 dep1 role",
                      Service1.class.getName(), dependency2.getKey() );
        assertEquals( "Block4 dep1 name",
                      "c2c",
                      dependency3.getProviderName() );
        assertEquals( "Block4 dep1 role",
                      Service1.class.getName(), dependency3.getKey() );
        assertTrue( "Block4 getBlockInfo non null",
                    null != block4.getInfo() );
        assertEquals( "Block4 isDisableProxy",
                      false,
                      isProxyDisabled( block4 ) );
    }
View Full Code Here

TOP

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

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.