You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ep...@apache.org on 2004/02/13 15:25:57 UTC

cvs commit: jakarta-turbine-fulcrum/testcontainer/src/java/org/apache/fulcrum/testcontainer Container.java

epugh       2004/02/13 06:25:57

  Modified:    testcontainer/src/test/org/apache/fulcrum/testcontainer
                        AlternativeComponentImpl.java
                        SimpleComponentImpl.java ContainerTest.java
                        SimpleComponent.java
               testcontainer project.xml
               testcontainer/xdocs changes.xml
               testcontainer/src/java/org/apache/fulcrum/testcontainer
                        Container.java
  Log:
  Conversion to Avalon Component
  
  Revision  Changes    Path
  1.3       +21 -1     jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/AlternativeComponentImpl.java
  
  Index: AlternativeComponentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/AlternativeComponentImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AlternativeComponentImpl.java	27 Oct 2003 09:27:31 -0000	1.2
  +++ AlternativeComponentImpl.java	13 Feb 2004 14:25:56 -0000	1.3
  @@ -65,6 +65,7 @@
    * Interface of the component
    *
    * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
  + * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
    * @version $Id$
    */
   public class AlternativeComponentImpl
  @@ -73,6 +74,7 @@
               Contextualizable
   {
       private String appRoot;
  +    private String appRoot2;
   
       public void initialize() throws Exception
       {
  @@ -92,5 +94,23 @@
       public void contextualize(Context context) throws ContextException
       {
           appRoot = (String) context.get("componentAppRoot");
  +        appRoot2 = (String) context.get("urn:avalon:home");
  +        
       }
  +    /**
  +     * @return Returns the appRoot.
  +     */
  +    public String getAppRoot()
  +    {
  +        return appRoot;
  +    }
  +
  +    /**
  +     * @return Returns the appRoot2.
  +     */
  +    public String getAppRoot2()
  +    {
  +        return appRoot2;
  +    }
  +
   }
  
  
  
  1.3       +20 -1     jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/SimpleComponentImpl.java
  
  Index: SimpleComponentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/SimpleComponentImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleComponentImpl.java	27 Oct 2003 09:27:31 -0000	1.2
  +++ SimpleComponentImpl.java	13 Feb 2004 14:25:56 -0000	1.3
  @@ -73,6 +73,7 @@
               Contextualizable
   {
       private String appRoot;
  +    private String appRoot2;
   
       public void initialize() throws Exception
       {
  @@ -87,10 +88,28 @@
           setupLogger(this, "SimpleComponent");
           getLogger().debug("test");
           getLogger().debug("ComponentAppRoot = "+appRoot);
  +        getLogger().debug("ComponentAppRoot2 = "+appRoot2);
       }
   
       public void contextualize(Context context) throws ContextException
       {
           appRoot = (String) context.get("componentAppRoot");
  +        appRoot2 = (String) context.get("urn:avalon:home");
       }
  +    /**
  +     * @return Returns the appRoot.
  +     */
  +    public String getAppRoot()
  +    {
  +        return appRoot;
  +    }
  +
  +    /**
  +     * @return Returns the appRoot2.
  +     */
  +    public String getAppRoot2()
  +    {
  +        return appRoot2;
  +    }
  +
   }
  
  
  
  1.5       +2 -1      jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/ContainerTest.java
  
  Index: ContainerTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/ContainerTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ContainerTest.java	27 Oct 2003 09:27:31 -0000	1.4
  +++ ContainerTest.java	13 Feb 2004 14:25:56 -0000	1.5
  @@ -89,6 +89,7 @@
           }
           assertNotNull(sc);
           sc.test();
  +        assertEquals(sc.getAppRoot(),sc.getAppRoot2());
           this.release(sc);
       }
       public void testAlternativeRoles()
  
  
  
  1.2       +11 -6     jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/SimpleComponent.java
  
  Index: SimpleComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/src/test/org/apache/fulcrum/testcontainer/SimpleComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleComponent.java	1 May 2003 17:33:09 -0000	1.1
  +++ SimpleComponent.java	13 Feb 2004 14:25:56 -0000	1.2
  @@ -1,5 +1,7 @@
   package org.apache.fulcrum.testcontainer;
   
  +import org.apache.avalon.framework.component.Component;
  +
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -54,20 +56,23 @@
    * <http://www.apache.org/>.
    */
   
  -import org.apache.avalon.framework.component.Component;
   
   /**
    * Implementation of the test component
    *
    * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
  + * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
    * @version $Id$
    */
  -public interface SimpleComponent
  -        extends Component
  +public interface SimpleComponent extends Component
   {
   
  -    static final String ROLE =
  -            "org.apache.fulcrum.testcontainer.SimpleComponent";
  +    static final String ROLE = SimpleComponent.class.getName();
  +
   
       void test();
  +    
  +    public String getAppRoot();
  +    
  +    public String getAppRoot2();
   }
  
  
  
  1.4       +1 -1      jakarta-turbine-fulcrum/testcontainer/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/project.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project.xml	12 Nov 2003 11:29:12 -0000	1.3
  +++ project.xml	13 Feb 2004 14:25:56 -0000	1.4
  @@ -3,7 +3,7 @@
     <extend>${basedir}/../project.xml</extend>
     <id>fulcrum-testcontainer</id>
     <name>Fulcrum Test Container</name>
  -  <currentVersion>1.0-alpha-2</currentVersion>
  +  <currentVersion>1.0-alpha-3</currentVersion>
   
     <dependencies>
   
  
  
  
  1.4       +6 -0      jakarta-turbine-fulcrum/testcontainer/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/xdocs/changes.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- changes.xml	12 Nov 2003 11:29:12 -0000	1.3
  +++ changes.xml	13 Feb 2004 14:25:57 -0000	1.4
  @@ -9,6 +9,12 @@
     <body>
     	<release version="1.0-alpha-2" date="in cvs">
         <action dev="epugh" type="add">
  +        Add additional context value urn:avalon:home to be more
  +        Merlin friendly.
  +      </action>
  +    </release>  
  +  	<release version="1.0-alpha-2" date="02-13-2004">
  +      <action dev="epugh" type="add">
           allow setup method of subclasses to throw exceptions if they want..
         </action>
       </release>
  
  
  
  1.4       +10 -4     jakarta-turbine-fulcrum/testcontainer/src/java/org/apache/fulcrum/testcontainer/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/testcontainer/src/java/org/apache/fulcrum/testcontainer/Container.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Container.java	27 Oct 2003 09:27:31 -0000	1.3
  +++ Container.java	13 Feb 2004 14:25:57 -0000	1.4
  @@ -76,8 +76,12 @@
   public class Container extends AbstractLogEnabled implements Initializable, Disposable
   {
   	/** Key used in the context for defining the application root */
  -	public static String COMPONENT_APP_ROOT = "componentAppRoot";
  -	
  +    public static String COMPONENT_APP_ROOT = "componentAppRoot";
  +
  +    /** Alternate Merlin Friendly Key used in the context for 
  +     * defining the application root */
  +    public static String URN_AVALON_HOME = "urn:avalon:home";    
  +    
       /** Component manager */
       private ExcaliburComponentManager manager = new ExcaliburComponentManager();
       /** Configurqation file */
  @@ -155,7 +159,9 @@
           this.manager.setLoggerManager(lm);
           this.manager.enableLogging(lm.getLoggerForCategory("org.apache.fulcrum"));
           DefaultContext context = new DefaultContext();
  -        context.put(COMPONENT_APP_ROOT, (new File("")).getAbsolutePath());
  +        String absolutePath = new File("").getAbsolutePath();
  +        context.put(COMPONENT_APP_ROOT, absolutePath);
  +        context.put(URN_AVALON_HOME, absolutePath);
           this.manager.contextualize(context);
           
           this.manager.configure(sysConfig);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org