ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/framework/src/test/org/apache/myrmidon AbstractTaskTestCase.java
Date Tue, 04 Jun 2002 13:09:04 GMT
adammurdoch    2002/06/04 06:09:04

  Modified:    antlib/src/test/org/apache/antlib
                        AbstractProjectTestCase.java
               framework/src/test/org/apache/myrmidon
                        AbstractTaskTestCase.java
  Log:
  Allow a unit test to override which project builder gets used.
  
  Revision  Changes    Path
  1.8       +9 -1      jakarta-ant-myrmidon/antlib/src/test/org/apache/antlib/AbstractProjectTestCase.java
  
  Index: AbstractProjectTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/test/org/apache/antlib/AbstractProjectTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractProjectTestCase.java	4 Jun 2002 12:47:51 -0000	1.7
  +++ AbstractProjectTestCase.java	4 Jun 2002 13:09:04 -0000	1.8
  @@ -13,7 +13,7 @@
    * A base class for test cases which need to execute projects or tasks.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.7 $ $Date: 2002/06/04 12:47:51 $
  + * @version $Revision: 1.8 $ $Date: 2002/06/04 13:09:04 $
    *
    * @todo - use the real project builder, rather than the simplified one
    * from framework.
  @@ -24,5 +24,13 @@
       public AbstractProjectTestCase( final String name )
       {
           super( name );
  +    }
  +
  +    /**
  +     * Returns the project type to use when executing projects.
  +     */
  +    protected String getProjectType()
  +    {
  +        return null;
       }
   }
  
  
  
  1.6       +11 -2     jakarta-ant-myrmidon/framework/src/test/org/apache/myrmidon/AbstractTaskTestCase.java
  
  Index: AbstractTaskTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/test/org/apache/myrmidon/AbstractTaskTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractTaskTestCase.java	4 Jun 2002 12:45:47 -0000	1.5
  +++ AbstractTaskTestCase.java	4 Jun 2002 13:09:04 -0000	1.6
  @@ -19,7 +19,7 @@
    * A base class for test cases which need to execute tasks.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/06/04 12:45:47 $
  + * @version $Revision: 1.6 $ $Date: 2002/06/04 13:09:04 $
    */
   public class AbstractTaskTestCase
       extends AbstractComponentTest
  @@ -30,6 +30,14 @@
       }
   
       /**
  +     * Returns the project type to use when executing projects.
  +     */
  +    protected String getProjectType()
  +    {
  +        return "simple";
  +    }
  +
  +    /**
        * Executes a target in a project, and asserts that it fails.
        */
       protected void executeTargetExpectError( final File projectFile,
  @@ -163,7 +171,7 @@
               embeddor.setSharedClassLoader( getClass().getClassLoader() );
               embeddor.setContainerClassLoader( getClass().getClassLoader() );
               embeddor.setProjectFile( projectFile.getAbsolutePath() );
  -            embeddor.setProjectType( "simple" );
  +            embeddor.setProjectType( getProjectType() );
               if( props != null )
               {
                   for( Iterator iterator = props.entrySet().iterator(); iterator.hasNext();
)
  @@ -198,4 +206,5 @@
               ( (TrackingTaskListener)listener ).assertComplete();
           }
       }
  +
   }
  
  
  

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