mcconnell    2003/02/27 19:46:03

  Modified:    assembly/src/test/org/apache/avalon/assembly TestBase.java
               assembly/src/test/org/apache/avalon/assembly/engine
                        FactoryTestCase.java
               assembly/src/test/org/apache/avalon/playground
                        SimpleComponent.xinfo
               assembly/src/test/org/apache/avalon/playground/factory
                        CustomAppliance.java CustomApplianceFactory.java
                        CustomApplianceFactory.xinfo CustomComponent.xinfo
  Added:       assembly/src/test/org/apache/avalon/playground/factory
                        CustomAppliance.xinfo
  Log:
  Addition of testcase validating the loading of a custom appliance component.
  
  Revision  Changes    Path
  1.2       +1 -1      
avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/TestBase.java
  
  Index: TestBase.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/TestBase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBase.java     27 Feb 2003 23:17:46 -0000      1.1
  +++ TestBase.java     28 Feb 2003 03:46:03 -0000      1.2
  @@ -39,7 +39,7 @@
   
       protected void setUp() throws Exception
       {
  -        setUpLogging( "WARN" );
  +        setUpLogging( "INFO" );
       }
   
       protected void setUpLogging( String priority ) throws Exception
  
  
  
  1.2       +3 -0      
avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/engine/FactoryTestCase.java
  
  Index: FactoryTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/assembly/engine/FactoryTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FactoryTestCase.java      27 Feb 2003 23:19:25 -0000      1.1
  +++ FactoryTestCase.java      28 Feb 2003 03:46:03 -0000      1.2
  @@ -61,13 +61,16 @@
       {
           final String locator = 
"org.apache.avalon.assembly.lifecycle.context.DefaultContextualizer";
           final String factory = 
"org.apache.avalon.playground.factory.CustomApplianceFactory";
  +        final String app = 
"org.apache.avalon.playground.factory.CustomAppliance";
           final String classname = 
"org.apache.avalon.playground.factory.CustomComponent";
   
           try
           {
               m_engine.register( locator );
               m_engine.register( factory );
  +            m_engine.register( app );
               m_engine.register( classname );
  +
               Type type = m_engine.getRepository().getTypeManager().getType( 
classname );
               Profile profile = 
m_engine.getRepository().getProfileManager().getProfile( type );
               DefaultApplianceContext context = new DefaultApplianceContext( 
profile );
  
  
  
  1.8       +0 -1      
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.xinfo
  
  Index: SimpleComponent.xinfo
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/SimpleComponent.xinfo,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SimpleComponent.xinfo     8 Feb 2003 23:30:46 -0000       1.7
  +++ SimpleComponent.xinfo     28 Feb 2003 03:46:03 -0000      1.8
  @@ -20,7 +20,6 @@
       <attributes>
         <attribute key="urn:assembly:appliance.class" 
           value="org.apache.avalon.assembly.appliance.DefaultAppliance"/>
  -      <attribute key="urn:assembly:appliance.version" value="2.0"/>
       </attributes>
     </info>
   
  
  
  
  1.2       +10 -0     
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomAppliance.java
  
  Index: CustomAppliance.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomAppliance.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomAppliance.java      27 Feb 2003 23:19:25 -0000      1.1
  +++ CustomAppliance.java      28 Feb 2003 03:46:03 -0000      1.2
  @@ -54,4 +54,14 @@
   
   public class CustomAppliance extends DefaultAppliance
   {
  +    
//---------------------------------------------------------------------------
  +    // initialization
  +    
//---------------------------------------------------------------------------
  +
  +    public void initialize() throws Exception
  +    {
  +        super.initialize();
  +        getLogger().info( "custom appliance initialization" );
  +    }
  +
   }
  
  
  
  1.2       +9 -0      
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomApplianceFactory.java
  
  Index: CustomApplianceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomApplianceFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomApplianceFactory.java       27 Feb 2003 23:19:25 -0000      1.1
  +++ CustomApplianceFactory.java       28 Feb 2003 03:46:03 -0000      1.2
  @@ -54,4 +54,13 @@
   
   public class CustomApplianceFactory extends DefaultApplianceFactory
   {
  +    
//---------------------------------------------------------------------------
  +    // initialization
  +    
//---------------------------------------------------------------------------
  +
  +    public void initialize() throws Exception
  +    {
  +        super.initialize();
  +        getLogger().info( "custom appliance factory initialization" );
  +    }
   }
  
  
  
  1.2       +3 -0      
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomApplianceFactory.xinfo
  
  Index: CustomApplianceFactory.xinfo
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomApplianceFactory.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomApplianceFactory.xinfo      27 Feb 2003 23:19:25 -0000      1.1
  +++ CustomApplianceFactory.xinfo      28 Feb 2003 03:46:03 -0000      1.2
  @@ -41,6 +41,9 @@
       <entry 
          key="urn:assembly:logging" 
          type="org.apache.avalon.assembly.logging.LoggingManager"/>
  +    <entry 
  +       key="urn:assembly:threads.manager" 
  +       type="org.apache.excalibur.mpool.PoolManager"/>
   
     </context>
   
  
  
  
  1.2       +22 -0     
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomComponent.xinfo
  
  Index: CustomComponent.xinfo
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomComponent.xinfo,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomComponent.xinfo     27 Feb 2003 23:19:26 -0000      1.1
  +++ CustomComponent.xinfo     28 Feb 2003 03:46:03 -0000      1.2
  @@ -15,11 +15,33 @@
   
   <type>
   
  +  <!--
  +  The following info block declares a custom appliance factory and a custom 
  +  appliance class.  In practice this is rather spectacular level of 
  +  customerization but is provided here for the purpose of system testing.
  +  Normal customization would be applied at the level of the appliance class
  +  when required (e.g. the establishment of a particular type of object 
  +  requires service that are not provided by the default appliance 
  +  implementation).
  +  -->
  +  
     <info>
       <name>custom</name>
       <attributes>
  +
  +      <!--
  +      Decalration of a custom appliance factory.
  +      -->
  +
         <attribute key="urn:assembly:appliance.factory" 
            
value="org.apache.avalon.playground.factory.CustomApplianceFactory"/>
  +
  +      <!--
  +      Declaration of a cutom appliance class.
  +      -->
  +      <attribute key="urn:assembly:appliance.class" 
  +        value="org.apache.avalon.playground.factory.CustomAppliance"/>
  +
       </attributes>
     </info>
   
  
  
  
  1.1                  
avalon-sandbox/assembly/src/test/org/apache/avalon/playground/factory/CustomAppliance.xinfo
  
  Index: CustomAppliance.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://avalon.apache.org/dtds/meta/type_1_1.dtd"; >
  
  <!--  
  Copyright (C) The Apache Software Foundation. All rights reserved.
  This software is published under the terms of the Apache Software License
  version 1.1, a copy of which has been included with this distribution in
  the LICENSE.txt file.
  
  @author  Avalon Development Team
  @version 1.0 12/03/2001
  -->
  
  <type>
  
    <info>
      <name>custom-appliance-factory</name>
    </info>
  
    <context>
  
      <!-- 
      the appliance factroy uses a custom contextualization strategy
      which is declared under the following context attributes
      -->
      <attributes>
        <attribute 
            key="urn:assembly:lifecycle.context.strategy"
            value="org.apache.avalon.assembly.locator.Contextualizable"/>
      </attributes>
  
      <!--
      the appliance repository and logging manager are supplied to the 
      factory under the custom contextualization phase
      -->
      <entry 
         key="urn:assembly:engine" 
         type="org.apache.avalon.assembly.engine.EngineClassLoader"/>
      <entry 
         key="urn:assembly:lifestyle.service" 
         type="org.apache.avalon.assembly.lifestyle.LifestyleService"/>
      <entry 
         key="urn:assembly:appliance.context" 
         type="org.apache.avalon.assembly.appliance.ApplianceContext"/>
      <entry 
         key="urn:assembly:appliance.system" 
         type="org.apache.avalon.assembly.locator.Locator"/>
      <entry 
         key="urn:assembly:appliance.repository" 
         type="org.apache.avalon.assembly.appliance.ApplianceRepository"/>
      <entry 
         key="urn:assembly:threads.manager" 
         type="org.apache.excalibur.mpool.PoolManager"/>
  
    </context>
  
    <services>
      <service type="org.apache.avalon.assembly.appliance.Appliance"/>
    </services>
  
  </type>
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to