ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/types/selectors ModifiedSelectorTest.java
Date Wed, 20 Jul 2005 06:54:22 GMT
jhm         2005/07/19 23:54:22

  Modified:    src/testcases/org/apache/tools/ant/types/selectors
                        ModifiedSelectorTest.java
  Log:
  Damn - I forgot to migrate the tests... I love these commit mails :-)
  
  Revision  Changes    Path
  1.14      +49 -3     ant/src/testcases/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
  
  Index: ModifiedSelectorTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ModifiedSelectorTest.java	20 Jul 2005 06:45:30 -0000	1.13
  +++ ModifiedSelectorTest.java	20 Jul 2005 06:54:21 -0000	1.14
  @@ -30,6 +30,7 @@
   import org.apache.tools.ant.types.Path;
   
   // inside MockProject
  +import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Target;
   import org.apache.tools.ant.Task;
  @@ -589,12 +590,35 @@
           }
       }
   
  -
  +    
       public void _testCustomComparator() {
           // same logic as on algorithm, no testcases created
       }
   
  -
  +    
  +    public void testResourceSelectorSimple() {
  +        BFT bft = new BFT("modifiedselector");
  +        bft.doTarget("modifiedselectortest-ResourceSimple");
  +        bft.deleteCachefile();
  +        //new File("src/etc/testcases/types/resources/selectors/cache.properties").delete();
  +    }
  +    public void testResourceSelectorSelresTrue() {
  +        BFT bft = new BFT("modifiedselector");
  +        bft.doTarget("modifiedselectortest-ResourceSelresTrue");
  +        bft.assertLogContaining("does not provide an InputStream");
  +        bft.deleteCachefile();
  +    }
  +    public void testResourceSelectorSelresFalse() {
  +        BFT bft = new BFT("modifiedselector");
  +        bft.doTarget("modifiedselectortest-ResourceSelresFalse");
  +        bft.deleteCachefile();  
  +    }
  +    public void testResourceSelectorScenarioSimple() {
  +        BFT bft = new BFT("modifiedselector");
  +        bft.doTarget("modifiedselectortest-scenario-resourceSimple");
  +        bft.doTarget("modifiedselectortest-scenario-clean");
  +        bft.deleteCachefile();  
  +    }
       /**
        * Test the interface semantic of Comparators.
        * This method does some common test for comparator implementations.
  @@ -874,16 +898,19 @@
        * and property transfer to that project.
        */
       private class BFT extends org.apache.tools.ant.BuildFileTest {
  +        String buildfile = "src/etc/testcases/types/selectors.xml";
  +
           BFT() { super("nothing"); }
           BFT(String name) {
               super(name);
           }
  +        
           String propfile = "ModifiedSelectorTest.properties";
   
           boolean isConfigured = false;
   
           public void setUp() {
  -            configureProject("src/etc/testcases/types/selectors.xml");
  +            configureProject(buildfile);
               isConfigured = true;
           }
   
  @@ -893,6 +920,13 @@
               if (!isConfigured) setUp();
               executeTarget(target);
           }
  +        
  +        protected void assertLogContaining(String substring) {
  +            super.assertLogContaining(substring);
  +        }
  +        protected void assertOutputContaining(String substring) {
  +            super.assertOutputContaining(substring);
  +        }
   
           public String getProperty(String property) {
               return project.getProperty(property);
  @@ -919,9 +953,21 @@
               new File(getProject().getBaseDir(), propfile).delete();
           }
   
  +        public void deleteCachefile() {
  +            File basedir = new File(buildfile).getParentFile();
  +            File cacheFile = new File(basedir, "cache.properties");
  +            cacheFile.delete();
  +        }
  +
           public org.apache.tools.ant.Project getProject() {
               return super.getProject();
           }
  +        public String getBuildfile() {
  +            return buildfile;
  +        }
  +        public void setBuildfile(String buildfile) {
  +            this.buildfile = buildfile;
  +        }
       }//class-BFT
   
   
  
  
  

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


Mime
View raw message