avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/assembler/test AssemblerTestCase.java
Date Sat, 01 Mar 2003 01:33:54 GMT
donaldp     2003/02/28 17:33:54

  Modified:    src/test/org/apache/avalon/phoenix/tools/assembler/test
                        AssemblerTestCase.java
  Log:
  Get unit test compiling again
  
  Revision  Changes    Path
  1.7       +61 -52    avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/assembler/test/AssemblerTestCase.java
  
  Index: AssemblerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/test/org/apache/avalon/phoenix/tools/assembler/test/AssemblerTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AssemblerTestCase.java	1 Oct 2002 06:17:58 -0000	1.6
  +++ AssemblerTestCase.java	1 Mar 2003 01:33:54 -0000	1.7
  @@ -7,14 +7,15 @@
    */
   package org.apache.avalon.phoenix.tools.assembler.test;
   
  -import org.apache.avalon.phoenix.metadata.BlockMetaData;
  -import org.apache.avalon.phoenix.metadata.DependencyMetaData;
  -import org.apache.avalon.phoenix.metadata.SarMetaData;
   import org.apache.avalon.phoenix.test.AbstractContainerTestCase;
   import org.apache.avalon.phoenix.test.data.Component1;
   import org.apache.avalon.phoenix.test.data.Component2;
   import org.apache.avalon.phoenix.test.data.Component3;
   import org.apache.avalon.phoenix.test.data.Service2;
  +import org.apache.avalon.phoenix.containerkit.registry.PartitionProfile;
  +import org.apache.avalon.phoenix.containerkit.registry.ComponentProfile;
  +import org.apache.avalon.phoenix.containerkit.metadata.DependencyMetaData;
  +import org.apache.avalon.phoenix.components.ContainerConstants;
   
   /**
    *  An basic test case for the LogManager.
  @@ -33,105 +34,113 @@
       public void testBasic()
           throws Exception
       {
  -        final SarMetaData sarMetaData = assembleSar( "assembly1.xml" );
  -        final BlockMetaData[] blocks = sarMetaData.getBlocks();
  +        final PartitionProfile partitionProfile = assembleSar( "assembly1.xml" );
  +        final ComponentProfile[] blocks =
  +            partitionProfile.getPartition( ContainerConstants.BLOCK_PARTITION ).
  +            getComponents();
           assertEquals( "Block Count", 2, blocks.length );
   
  -        final BlockMetaData block1 = blocks[ 0 ];
  -        final BlockMetaData block2 = blocks[ 1 ];
  -        final DependencyMetaData[] dependencies1 = block1.getDependencies();
  -        final DependencyMetaData[] dependencies2 = block2.getDependencies();
  +        final ComponentProfile block1 = blocks[ 0 ];
  +        final ComponentProfile block2 = blocks[ 1 ];
  +        final DependencyMetaData[] dependencies1 = block1.getMetaData().getDependencies();
  +        final DependencyMetaData[] dependencies2 = block2.getMetaData().getDependencies();
   
           assertEquals( "Block1 getImplementationKey",
                         Component1.class.getName(),
  -                      block1.getImplementationKey() );
  -        assertEquals( "Block1 getName", "c1", block1.getName() );
  +                      block1.getMetaData().getImplementationKey() );
  +        assertEquals( "Block1 getName", "c1", block1.getMetaData().getName() );
           assertEquals( "Block1 getDependencies count",
                         1, dependencies1.length );
  -        assertEquals( "Block1 dep1 name", "c2", dependencies1[ 0 ].getName() );
  +        assertEquals( "Block1 dep1 name", "c2", dependencies1[ 0 ].getProviderName() );
           assertEquals( "Block1 dep1 role",
  -                      Service2.class.getName(), dependencies1[ 0 ].getRole() );
  +                      Service2.class.getName(), dependencies1[ 0 ].getKey() );
           assertTrue( "Block1 getBlockInfo non null",
  -                       null != block1.getBlockInfo() );
  -        assertEquals( "Block1 isDisableProxy", false, block1.isDisableProxy() );
  +                    null != block1.getInfo() );
  +        assertEquals( "Block1 isDisableProxy", false, isProxyDisabled( block1 ) );
   
           assertEquals( "Block2 getImplementationKey",
                         Component2.class.getName(),
  -                      block2.getImplementationKey() );
  -        assertEquals( "Block2 getName", "c2", block2.getName() );
  +                      block2.getMetaData().getImplementationKey() );
  +        assertEquals( "Block2 getName", "c2", block2.getMetaData().getName() );
           assertEquals( "Block2 getDependencies count",
                         0, dependencies2.length );
           assertTrue( "Block2 getBlockInfo non null",
  -                       null != block2.getBlockInfo() );
  -        assertEquals( "Block2 isDisableProxy", true, block2.isDisableProxy() );
  +                    null != block2.getInfo() );
  +        assertEquals( "Block2 isDisableProxy", true, isProxyDisabled( block2 ) );
  +    }
  +
  +    private boolean isProxyDisabled( final ComponentProfile block2 )
  +    {
  +        return block2.getMetaData().getAttribute( ContainerConstants.DISABLE_PROXY_ATTR
) == null;
       }
   
       public void testComplex()
           throws Exception
       {
  -        final SarMetaData sarMetaData = assembleSar( "assembly2.xml" );
  -        final BlockMetaData[] blocks = sarMetaData.getBlocks();
  +        final PartitionProfile partitionProfile = assembleSar( "assembly2.xml" );
  +        final ComponentProfile[] blocks =
  +            partitionProfile.getPartition( ContainerConstants.BLOCK_PARTITION ).getComponents();
           assertEquals( "Block Count", 4, blocks.length );
   
  -        final BlockMetaData block1 = blocks[ 0 ];
  -        final BlockMetaData block2 = blocks[ 1 ];
  -        final BlockMetaData block3 = blocks[ 2 ];
  -        final BlockMetaData block4 = blocks[ 3 ];
  -        final DependencyMetaData[] dependencies1 = block1.getDependencies();
  -        final DependencyMetaData[] dependencies2 = block2.getDependencies();
  -        final DependencyMetaData[] dependencies3 = block3.getDependencies();
  -        final DependencyMetaData[] dependencies4 = block4.getDependencies();
  +        final ComponentProfile block1 = blocks[ 0 ];
  +        final ComponentProfile block2 = blocks[ 1 ];
  +        final ComponentProfile block3 = blocks[ 2 ];
  +        final ComponentProfile block4 = blocks[ 3 ];
  +        final DependencyMetaData[] dependencies1 = block1.getMetaData().getDependencies();
  +        final DependencyMetaData[] dependencies2 = block2.getMetaData().getDependencies();
  +        final DependencyMetaData[] dependencies3 = block3.getMetaData().getDependencies();
  +        final DependencyMetaData[] dependencies4 = block4.getMetaData().getDependencies();
   
           assertEquals( "Block1 getImplementationKey",
                         Component2.class.getName(),
  -                      block1.getImplementationKey() );
  -        assertEquals( "Block1 getName", "c2a", block1.getName() );
  +                      block1.getMetaData().getImplementationKey() );
  +        assertEquals( "Block1 getName", "c2a", block1.getMetaData().getName() );
           assertEquals( "Block1 getDependencies count",
                         0, dependencies1.length );
           assertTrue( "Block2 getBlockInfo non null",
  -                       null != block1.getBlockInfo() );
  -        assertEquals( "Block1 isDisableProxy", false, block1.isDisableProxy() );
  +                    null != block1.getInfo() );
  +        assertEquals( "Block1 isDisableProxy", false, isProxyDisabled( block1 ) );
   
           assertEquals( "Block2 getImplementationKey",
                         Component2.class.getName(),
  -                      block2.getImplementationKey() );
  -        assertEquals( "Block2 getName", "c2b", block2.getName() );
  +                      block2.getMetaData().getImplementationKey() );
  +        assertEquals( "Block2 getName", "c2b", block2.getMetaData().getName() );
           assertEquals( "Block2 getDependencies count",
                         0, dependencies2.length );
           assertTrue( "Block2 getBlockInfo non null",
  -                       null != block2.getBlockInfo() );
  -        assertEquals( "Block2 isDisableProxy", false, block2.isDisableProxy() );
  +                    null != block2.getInfo() );
  +        assertEquals( "Block2 isDisableProxy", false, isProxyDisabled( block2 ) );
   
           assertEquals( "Block3 getImplementationKey",
                         Component2.class.getName(),
  -                      block3.getImplementationKey() );
  -        assertEquals( "Block3 getName", "c2c", block3.getName() );
  +                      block3.getMetaData().getImplementationKey() );
  +        assertEquals( "Block3 getName", "c2c", block3.getMetaData().getName() );
           assertEquals( "Block3 getDependencies count",
                         0, dependencies3.length );
           assertTrue( "Block3 getBlockInfo non null",
  -                       null != block3.getBlockInfo() );
  -        assertEquals( "Block3 isDisableProxy", false, block3.isDisableProxy() );
  +                    null != block3.getInfo() );
  +        assertEquals( "Block3 isDisableProxy", false, isProxyDisabled( block3 ) );
   
           assertEquals( "Block4 getImplementationKey",
                         Component3.class.getName(),
  -                      block4.getImplementationKey() );
  -        assertEquals( "Block4 getName", "c3", block4.getName() );
  +                      block4.getMetaData().getImplementationKey() );
  +        assertEquals( "Block4 getName", "c3", block4.getMetaData().getName() );
           assertEquals( "Block4 getDependencies count",
                         3, dependencies4.length );
           final DependencyMetaData dependency1 = dependencies4[ 0 ];
           final DependencyMetaData dependency2 = dependencies4[ 1 ];
           final DependencyMetaData dependency3 = dependencies4[ 2 ];
  -        assertEquals( "Block4 dep1 name", "c2a", dependency1.getName() );
  +        assertEquals( "Block4 dep1 name", "c2a", dependency1.getProviderName() );
           assertEquals( "Block4 dep1 role",
  -                      Service2.class.getName(), dependency1.getRole() );
  -        assertEquals( "Block4 dep1 name", "c2b", dependency2.getName() );
  +                      Service2.class.getName(), dependency1.getKey() );
  +        assertEquals( "Block4 dep1 name", "c2b", dependency2.getProviderName() );
           assertEquals( "Block4 dep1 role",
  -                      Service2.class.getName(), dependency2.getRole() );
  -        assertEquals( "Block4 dep1 name", "c2c", dependency3.getName() );
  +                      Service2.class.getName(), dependency2.getKey() );
  +        assertEquals( "Block4 dep1 name", "c2c", dependency3.getProviderName() );
           assertEquals( "Block4 dep1 role",
  -                      Service2.class.getName(), dependency3.getRole() );
  +                      Service2.class.getName(), dependency3.getKey() );
           assertTrue( "Block4 getBlockInfo non null",
  -                       null != block4.getBlockInfo() );
  -        assertEquals( "Block4 isDisableProxy", false, block4.isDisableProxy() );
  +                    null != block4.getInfo() );
  +        assertEquals( "Block4 isDisableProxy", false, isProxyDisabled( block4 ) );
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message