ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs AbstractCvsTaskTest.java
Date Thu, 04 Apr 2002 07:43:36 GMT
bodewig     02/04/03 23:43:36

  Modified:    docs/manual/CoreTasks cvs.html
               src/etc/testcases/taskdefs abstractcvstask.xml
               src/main/org/apache/tools/ant/taskdefs AbstractCvsTask.java
               src/testcases/org/apache/tools/ant BuildFileTest.java
               src/testcases/org/apache/tools/ant/taskdefs
                        AbstractCvsTaskTest.java
  Log:
  If package attribute has been set, <cvs> would place it in front of
  the command - which is wrong.
  
  Reported by:	Ovidiu Predescu <ovidiu@apache.org>
  
  Updated cvs example to point to something usable.
  
  Revision  Changes    Path
  1.10      +6 -5      jakarta-ant/docs/manual/CoreTasks/cvs.html
  
  Index: cvs.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/cvs.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- cvs.html	3 Feb 2002 22:00:42 -0000	1.9
  +++ cvs.html	4 Apr 2002 07:43:35 -0000	1.10
  @@ -98,11 +98,11 @@
     </tr>
   </table>
   <h3>Examples</h3>
  -<pre>  &lt;cvs cvsRoot=&quot;:pserver:anoncvs@jakarta.apache.org:/home/cvspublic&quot;
  -       package=&quot;jakarta-tools&quot;
  +<pre>  &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
  +       package=&quot;jakarta-ant&quot;
          dest=&quot;${ws.dir}&quot;
     /&gt;</pre>
  -<p>checks out the package/module &quot;jakarta-tools&quot; from the CVS
  +<p>checks out the package/module &quot;jakarta-ant&quot; from the CVS
   repository pointed to by the cvsRoot attribute, and stores the files in &quot;${ws.dir}&quot;.</p>
   <pre>  &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
   <p>updates the package/module that has previously been checked out into
  @@ -115,8 +115,9 @@
   before the command, and any command options should appear after the command as in the diff
example
   above. See <a href="http://www.cvshome.org/docs/manual/index.html" target="_top">the
cvs manual</a> for details,
   specifically the <a href="http://www.cvshome.org/docs/manual/cvs_16.html" target="_top">Guide
to CVS commands</a></p>
  -<hr><p align="center">Copyright &copy; 2001 Apache Software Foundation.
All rights
  -Reserved.</p>
  +<hr>
  +<p align="center">Copyright &copy; 2001-2002 Apache Software
  +Foundation.  All rights Reserved.</p>
   
   </body>
   </html>
  
  
  
  1.3       +12 -0     jakarta-ant/src/etc/testcases/taskdefs/abstractcvstask.xml
  
  Index: abstractcvstask.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/abstractcvstask.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- abstractcvstask.xml	3 Apr 2002 16:34:25 -0000	1.2
  +++ abstractcvstask.xml	4 Apr 2002 07:43:35 -0000	1.3
  @@ -22,4 +22,16 @@
       </cvs>
       <cvs failonerror="true" command="status ${file}"/>
     </target>
  +
  +  <target name="package-attribute">
  +    <mkdir dir="tmpdir" />
  +    <cvs cvsroot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
  +         package="jakarta-ant/build.xml"
  +         dest="tmpdir"
  +         quiet="true" />
  +  </target>
  +
  +  <target name="cleanup">
  +    <delete dir="tmpdir" />
  +  </target>
   </project>
  
  
  
  1.5       +2 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  
  Index: AbstractCvsTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractCvsTask.java	4 Apr 2002 05:44:41 -0000	1.4
  +++ AbstractCvsTask.java	4 Apr 2002 07:43:35 -0000	1.5
  @@ -377,8 +377,8 @@
   
           String c = this.getCommand();
           if( c != null ) {
  -            this.addConfiguredCommandline( this.cmd, true );
               this.cmd.createArgument().setLine(c);
  +            this.addConfiguredCommandline( this.cmd, true );
           }
   
           for( int i = 0; i < vecCommandlines.size(); i++ ) {
  @@ -551,7 +551,7 @@
           }
           c.setExecutable( "cvs" );
           if (cvsPackage != null) {
  -            c.createArgument(true).setLine(cvsPackage);
  +            c.createArgument().setLine(cvsPackage);
           }
           if ( this.compression > 0 && this.compression < 10 ) {
               c.createArgument(true).setValue("-z"+this.compression);
  
  
  
  1.12      +13 -2     jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java
  
  Index: BuildFileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BuildFileTest.java	20 Mar 2002 06:42:03 -0000	1.11
  +++ BuildFileTest.java	4 Apr 2002 07:43:36 -0000	1.12
  @@ -99,13 +99,24 @@
       }
   
       /**
  -     * Assert that the given message has been logged with a priority
  -     * &gt;= INFO when running the given target.
  +     * Assert that only the given message has been logged with a
  +     * priority &gt;= INFO when running the given target.
        */
       protected void expectLog(String target, String log) { 
           executeTarget(target);
           String realLog = getLog();
           assertEquals(log, realLog);
  +    }
  +
  +    /**
  +     * Assert that the given message has been logged with a priority
  +     * &gt;= INFO when running the given target.
  +     */
  +    protected void expectLogContaining(String target, String log) { 
  +        executeTarget(target);
  +        String realLog = getLog();
  +        assertTrue("expecting log to contain \""+log+"\"", 
  +                   realLog.indexOf(log) >= 0);
       }
   
       /**
  
  
  
  1.3       +12 -1     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java
  
  Index: AbstractCvsTaskTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AbstractCvsTaskTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractCvsTaskTest.java	4 Apr 2002 05:44:41 -0000	1.2
  +++ AbstractCvsTaskTest.java	4 Apr 2002 07:43:36 -0000	1.3
  @@ -53,11 +53,14 @@
    */
   package org.apache.tools.ant.taskdefs;
    
  +import java.io.File;
  +
   import org.apache.tools.ant.BuildFileTest;
   
   /**
    * @author stephan <stephan@wanderinghorse.net>
  - * @version $Revision: 1.2 $
  + * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  + * @version $Revision: 1.3 $
    */
   public class AbstractCvsTaskTest extends BuildFileTest {
   
  @@ -74,9 +77,17 @@
       }
   
       public void tearDown() {
  +        executeTarget("cleanup");
       }
   
       public void testAbstractCvsTask() {
           executeTarget( "all" );
  +    }
  +
  +    public void testPackageAttribute() {
  +        File f = getProject().resolveFile("tmpdir/jakarta-ant/build.xml");
  +        assertTrue("starting empty", !f.exists());
  +        expectLogContaining("package-attribute", "U jakarta-ant/build.xml");
  +        assertTrue("now it is there", f.exists());
       }
   }
  
  
  

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