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",