ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test DefaultEmbeddorTest.java
Date Tue, 11 Jun 2002 04:02:57 GMT
donaldp     2002/06/10 21:02:57

  Modified:    container/src/java/org/apache/myrmidon/components/builder
                        DefaultProject.java DefaultTargetMetaData.java
               container/src/java/org/apache/myrmidon/components/workspace
                        ProjectEntry.java
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
               container/src/java/org/apache/myrmidon/interfaces/oldmodel
                        ProjectHelper.java
               container/src/test/org/apache/myrmidon/components/builder/test
                        DefaultProjectBuilderTestCase.java
               container/src/test/org/apache/myrmidon/components/embeddor/test
                        DefaultEmbeddorTest.java
  Log:
  Move TargetMetaData to be side-by-side with project and to no longer support nested meta-datas
  
  Revision  Changes    Path
  1.29      +11 -15    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProject.java
  
  Index: DefaultProject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProject.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DefaultProject.java	11 Jun 2002 03:07:26 -0000	1.28
  +++ DefaultProject.java	11 Jun 2002 04:02:57 -0000	1.29
  @@ -8,15 +8,14 @@
   package org.apache.myrmidon.components.builder;
   
   import java.io.File;
  -import java.util.Collection;
   import java.util.HashMap;
   import java.util.Map;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.metadata.ModelElement;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
   
  @@ -52,7 +51,7 @@
        */
       private final Map m_targetMetaDataSet = new HashMap();
   
  -    private DefaultTargetMetaData m_metaData;
  +    private final DefaultTargetMetaData m_metaData;
   
       private final ProjectDescriptor m_descriptor;
   
  @@ -85,12 +84,20 @@
           m_projectRefs = projectRefs;
           m_targets = targets;
   
  +        m_metaData =
  +            new DefaultTargetMetaData( m_defaultTarget,
  +                                       null );
           for( int i = 0; i < m_targets.length; i++ )
           {
               addTargetMetaData( m_targets[ i ] );
           }
       }
   
  +    public ProjectRef[] getProjectRefs()
  +    {
  +        return m_projectRefs;
  +    }
  +
       private void addTargetMetaData( final ModelElement model )
       {
           final String name = model.getAttribute( "name" );
  @@ -190,17 +197,6 @@
        */
       public TargetMetaData getMetaData()
       {
  -        if( null == m_metaData )
  -        {
  -            final Collection targets = m_targetMetaDataSet.values();
  -            final TargetMetaData[] targetMetaDatas =
  -                (TargetMetaData[])targets.toArray( new TargetMetaData[ targets.size() ]
);
  -
  -            m_metaData =
  -                new DefaultTargetMetaData( m_defaultTarget,
  -                                           null,
  -                                           targetMetaDatas );
  -        }
           return m_metaData;
       }
   }
  
  
  
  1.2       +2 -25     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultTargetMetaData.java
  
  Index: DefaultTargetMetaData.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultTargetMetaData.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultTargetMetaData.java	7 Jun 2002 07:13:03 -0000	1.1
  +++ DefaultTargetMetaData.java	11 Jun 2002 04:02:57 -0000	1.2
  @@ -7,7 +7,7 @@
    */
   package org.apache.myrmidon.components.builder;
   
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   
   /**
    * Targets in build file.
  @@ -18,25 +18,14 @@
   public class DefaultTargetMetaData
       implements TargetMetaData
   {
  -    private static final TargetMetaData[] EMPTY_TARGETS = new TargetMetaData[ 0 ];
  -
       private final String m_name;
       private final String m_descrption;
  -    private final TargetMetaData[] m_targets;
   
       public DefaultTargetMetaData( final String name,
                                     final String description )
       {
  -        this( name, description, EMPTY_TARGETS );
  -    }
  -
  -    public DefaultTargetMetaData( final String name,
  -                                  final String description,
  -                                  final TargetMetaData[] targets )
  -    {
           m_name = name;
           m_descrption = description;
  -        m_targets = targets;
       }
   
       /**
  @@ -57,17 +46,5 @@
       public String getDescription()
       {
           return m_descrption;
  -    }
  -
  -    /**
  -     * Return an array of child targets.
  -     * Must return a non-null value, even when there
  -     * are no child targets.
  -     *
  -     * @return a non-null array of child targets.
  -     */
  -    public TargetMetaData[] getTargets()
  -    {
  -        return m_targets;
       }
   }
  
  
  
  1.11      +2 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectEntry.java
  
  Index: ProjectEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectEntry.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProjectEntry.java	7 Jun 2002 07:07:52 -0000	1.10
  +++ ProjectEntry.java	11 Jun 2002 04:02:57 -0000	1.11
  @@ -10,7 +10,7 @@
   import java.util.HashMap;
   import java.util.Map;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   
   /**
  
  
  
  1.20      +2 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java
  
  Index: EmbeddedAnt.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- EmbeddedAnt.java	11 Jun 2002 03:07:27 -0000	1.19
  +++ EmbeddedAnt.java	11 Jun 2002 04:02:57 -0000	1.20
  @@ -24,7 +24,7 @@
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   import org.apache.myrmidon.interfaces.oldmodel.ProjectHelper;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  
  
  
  1.2       +1 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/ProjectHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectHelper.java	11 Jun 2002 03:07:27 -0000	1.1
  +++ ProjectHelper.java	11 Jun 2002 04:02:57 -0000	1.2
  @@ -12,7 +12,6 @@
   import org.apache.myrmidon.components.workspace.DefaultWorkspace;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
   import org.apache.myrmidon.api.TaskException;
   
   /**
  
  
  
  1.18      +2 -9      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/builder/test/DefaultProjectBuilderTestCase.java
  
  Index: DefaultProjectBuilderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/builder/test/DefaultProjectBuilderTestCase.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultProjectBuilderTestCase.java	11 Jun 2002 02:27:50 -0000	1.17
  +++ DefaultProjectBuilderTestCase.java	11 Jun 2002 04:02:57 -0000	1.18
  @@ -22,7 +22,7 @@
   import org.apache.myrmidon.interfaces.builder.ProjectBuilder;
   import org.apache.myrmidon.interfaces.builder.ProjectException;
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
  @@ -330,13 +330,6 @@
       {
           assertEquals( expected.getName(), actual.getName() );
           assertEquals( expected.getDescription(), actual.getDescription() );
  -        final TargetMetaData[] expectedChildren = expected.getTargets();
  -        final TargetMetaData[] actualChildren = actual.getTargets();
  -        assertEquals( expectedChildren.length, actualChildren.length );
  -        for( int i = 0; i < actualChildren.length; i++ )
  -        {
  -            assertSameMetaData( expectedChildren[ i ], actualChildren[ i ] );
  -        }
       }
   
       /**
  
  
  
  1.26      +2 -2      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java
  
  Index: DefaultEmbeddorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DefaultEmbeddorTest.java	11 Jun 2002 03:07:26 -0000	1.25
  +++ DefaultEmbeddorTest.java	11 Jun 2002 04:02:57 -0000	1.26
  @@ -18,7 +18,7 @@
   import org.apache.myrmidon.components.embeddor.DefaultEmbeddor;
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   import org.apache.myrmidon.interfaces.oldmodel.ProjectHelper;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message