ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hol...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs BasenameTest.java DirnameTest.java
Date Wed, 20 Mar 2002 02:48:15 GMT
holtdl      02/03/19 18:48:15

  Modified:    src/main/org/apache/tools/ant/taskdefs defaults.properties
  Added:       docs/manual/CoreTasks basename.html dirname.html
               src/main/org/apache/tools/ant/taskdefs Basename.java
                        Dirname.java
               src/etc/testcases/taskdefs basename.xml dirname.xml
               src/testcases/org/apache/tools/ant/taskdefs
                        BasenameTest.java DirnameTest.java
  Log:
  Finally add the new <basename> and <dirname> tasks. (yay!)
  
  Revision  Changes    Path
  1.1                  jakarta-ant/docs/manual/CoreTasks/basename.html
  
  Index: basename.html
  ===================================================================
  <html>
  
  <head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Basename Task</title>
  </head>
  
  <body>
  
  <h2><a name="echo">Basename</a></h2>
  <h3>Description</h3>
  <p>
  Task to determine the basename of a specified file, optionally minus a
  specified suffix.
  </p>
  <p>
  When this task executes, it will set the specified property to the
  value of the last path element of the specified file. If <code>file</code> is
a
  directory, the basename will be the last directory element. If
  <code>file</code> is a full-path, relative-path, or simple filename,
  the basename will be the simple file name, without any directory elements.
  </p>
  <p> 
  <h3>Parameters</h3>
  <table border="1" cellpadding="2" cellspacing="0">
    <tr>
      <td valign="top"><b>Attribute</b></td>
      <td valign="top"><b>Description</b></td>
      <td align="center" valign="top"><b>Required</b></td>
    </tr>
    <tr>
      <td valign="top">file</td>
      <td valign="top">The path to take the basename of.</td>
      <td valign="top" align="center">Yes</td>
    </tr>
    <tr>
      <td valign="top">property</td>
      <td valign="top">The name of the property to set.</td>
      <td valign="top" align="center">Yes</td>
    </tr>
    <tr>
      <td valign="top">suffix</td>
      <td valign="top">The suffix to remove from the resulting basename
        (specified either with or with the &quot;<code>.</code>&quot;).</td>
      <td valign="top" align="center">No</td>
    </tr>
  </table>
  
  <h3>Examples</h3>
  <pre>  &lt;basename property=&quot;jar.filename&quot; file=&quot;${lib.jarfile}&quot;/&gt;</pre>
  will set <code>jar.filename</code> to
  <code>myjar.jar</code>, if <code>lib.jarfile</code> is defined as
either a
  full-path filename (eg., <code>/usr/local/lib/myjar.jar</code>),
  a relative-path filename (eg., <code>lib/myjar.jar</code>),
  or a simple filename (eg., <code>myjar.jar</code>).
  <pre>  &lt;basename property=&quot;cmdname&quot; file=&quot;D:/usr/local/foo.exe&quot;
suffix=&quot;.exe&quot;/&gt;</pre>
  will set <code>cmdname</code> to <code>foo</code>.
  <pre>  &lt;basename property=&quot;temp.dirname&quot; file=&quot;${env.TEMP}&quot;/&gt;</pre>
  
  will set <code>temp.dirname</code> to the last directory element of
  the path defined for the <code>TEMP</code> environment variable.</p>
  
  <hr>
  <p align="center">Copyright &copy; 2002 Apache Software Foundation.
  All rights Reserved.</p>
  
  </body>
  </html>
  
  
  
  
  1.1                  jakarta-ant/docs/manual/CoreTasks/dirname.html
  
  Index: dirname.html
  ===================================================================
  <html>
  
  <head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Dirname Task</title>
  </head>
  
  <body>
  
  <h2><a name="echo">Dirname</a></h2>
  <h3>Description</h3>
  <p>
  Task to determine the directory path of a specified file.
  </p>
  <p> 
  When this task executes, it will set the specified property to the
  value of the specified file up to, but not including, the last path
  element. If the specified file is a path that ends in a filename,
  the filename will be dropped. If the specified file is just a filename,
  the directory will be the current directory.
  </p>
  <h3>Parameters</h3>
  <table border="1" cellpadding="2" cellspacing="0">
    <tr>
      <td valign="top"><b>Attribute</b></td>
      <td valign="top"><b>Description</b></td>
      <td align="center" valign="top"><b>Required</b></td>
    </tr>
    <tr>
      <td valign="top">file</td>
      <td valign="top">The path to take the basename of.</td>
      <td valign="top" align="center">Yes</td>
    </tr>
    <tr>
      <td valign="top">property</td>
      <td valign="top">The name of the property to set.</td>
      <td valign="top" align="center">Yes</td>
    </tr>
  </table>
  
  <h3>Examples</h3>
  <pre>  &lt;dirname property=&quot;antfile.dir&quot; file=&quot;${ant.file}&quot;/&gt;</pre>
  will set <code>antfile.dir</code> to the directory path for
  <code>${ant.file}</code>.
  <pre>  &lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;</pre>
  will set <code>foo.dirname</code> to the current directory.</p>
  
  <hr>
  <p align="center">Copyright &copy; 2002 Apache Software Foundation.
  All rights Reserved.</p>
  
  </body>
  </html>
  
  
  
  
  1.111     +2 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties
  
  Index: defaults.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- defaults.properties	6 Mar 2002 03:25:50 -0000	1.110
  +++ defaults.properties	20 Mar 2002 02:48:15 -0000	1.111
  @@ -61,6 +61,8 @@
   loadfile=org.apache.tools.ant.taskdefs.LoadFile
   manifest=org.apache.tools.ant.taskdefs.Manifest
   loadproperties=org.apache.tools.ant.taskdefs.LoadProperties
  +basename=org.apache.tools.ant.taskdefs.Basename
  +dirname=org.apache.tools.ant.taskdefs.Dirname
   
   # optional tasks
   script=org.apache.tools.ant.taskdefs.optional.Script
  
  
  
  1.1                  jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Basename.java
  
  Index: Basename.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Ant", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.tools.ant.taskdefs;
  
  import java.io.File;
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Task;
  
  /**
   * Task to determine the basename of a specified file, optionally minus a
   * specified suffix.
   *
   * This task can accept the following attributes:
   * <ul>
   * <li>file
   * <li>property
   * <li>suffix
   * </ul>
   * The <b>file</b> and <b>property</b> attributes are required.
The
   * <b>suffix</b> attribute can be specified either with or without
   * the &quot;.&quot;, and the result will be the same (ie., the
   * returned file name will be minus the .suffix).
   * <p>
   * When this task executes, it will set the specified property to the
   * value of the last element in the specified file. If file is a
   * directory, the basename will be the last directory element. If file
   * is a full-path filename, the basename will be the simple file name.
   * If a suffix is specified, and the specified file ends in that suffix,
   * the basename will be the simple file name without the suffix.
   *
   * @author Diane Holt <a href="mailto:holtdl@apache.org">holtdl@apache.org</a>
   *
   * @version $Revision: 1.1 $
   *
   * @ant.task category="property"
   */
  
  public class Basename extends Task {
    private File file;
    private String property;
    private String suffix;
  
    // The setter for the `file' attribute
    public void setFile(File file) {
      this.file = file;
    }
  
    // The setter for the `property' attribute
    public void setProperty(String property) {
      this.property  = property ;
    }
  
    // The setter for the `suffix' attribute
    public void setSuffix(String suffix) {
      this.suffix = suffix;
    }
  
  
    // The method executing the task
    public void execute() throws BuildException {
        String value;
        if (property == null) {
            throw new BuildException("property attribute required", location);
        }
        if (file == null) {
            throw new BuildException("file attribute required", location);
        } else {
          value = file.getName();
          if (suffix != null && value.endsWith(suffix)) {
              int pos = value.indexOf('.');
              value = value.substring(0, pos);
          }
          this.project.setProperty(property, value);
        }
    }
  }
  
  
  
  
  1.1                  jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Dirname.java
  
  Index: Dirname.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Ant", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.tools.ant.taskdefs;
  
  import java.io.File;
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.Task;
  
  /**
   * Task to determine the directory name of the specified file.
   *
   * This task can accept the following attributes:
   * <ul>
   * <li>file
   * <li>property
   * </ul>
   * Both <b>file</b> and <b>property</b> are required.
   * <p>
   * When this task executes, it will set the specified property to the
   * value of the specified file up to, but not including, the last path
   * element. If file is a file, the directory will be the current
   * directory.
   *
   * @author Diane Holt <a href="mailto:holtdl@apache.org">holtdl@apache.org</a>
   *
   * @version $Revision: 1.1 $
   *
   * @ant.task category="property"
   */
  
  public class Dirname extends Task {
    private File file;
    private String property;
  
    // The setter for the `file' attribute
    public void setFile(File file) {
      this.file = file;
    }
  
    // The setter for the `property' attribute
    public void setProperty(String property) {
      this.property  = property ;
    }
  
  
    // The method executing the task
    public void execute() throws BuildException {
        if (property == null) {
            throw new BuildException("property attribute required", location);
        }
        if (file == null) {
            throw new BuildException("file attribute required", location);
        } else {
          String value = file.getParent();
          this.project.setProperty(property, value);
        }
    }
  }
  
  
  
  
  1.1                  jakarta-ant/src/etc/testcases/taskdefs/basename.xml
  
  Index: basename.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project name="xxx-test" basedir="." default="test1">
  
    <target name="test1">
      <basename/>
    </target>
  
    <target name="test2">
      <basename property="propname"/>
    </target>
  
    <target name="test3">
      <basename file="filename"/>
    </target>
  
    <target name="test4">
      <basename property="file.w.suf" file="${user.dir}/foo.txt"/>
    </target>
  
    <target name="test5">
      <basename property="file.wo.suf" file="foo.txt" suffix="txt"/>
    </target>
  
  </project>
  
  
  
  1.1                  jakarta-ant/src/etc/testcases/taskdefs/dirname.xml
  
  Index: dirname.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project name="xxx-test" basedir="." default="test1">
  
    <target name="test1">
      <dirname/>
    </target>
  
    <target name="test2">
      <dirname property="propname"/>
    </target>
  
    <target name="test3">
      <dirname file="filename"/>
    </target>
  
    <target name="test4">
      <dirname property="local.dir" file="/usr/local/foo.txt"/>
    </target>
  
    <target name="test5">
      <dirname property="base.dir" file="foo.txt"/>
    </target>
  
  </project>
  
  
  
  1.1                  jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/BasenameTest.java
  
  Index: BasenameTest.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Ant", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.tools.ant.taskdefs;
  
  import java.io.File;
  import org.apache.tools.ant.BuildFileTest;
  
  /**
   * @author Diane Holt <holtdl@apache.org> 
   */
  public class BasenameTest extends BuildFileTest { 
      
      public BasenameTest(String name) { 
          super(name);
      }    
      
      public void setUp() { 
          configureProject("src/etc/testcases/taskdefs/basename.xml");
      }
  
      public void test1() { 
          expectBuildException("test1", "required attribute missing");
      }
  
      public void test2() { 
          expectBuildException("test2", "required attribute missing");
      }
  
      public void test3() { 
          expectBuildException("test3", "required attribute missing");
      }
  
      public void test4() { 
          executeTarget("test4");
          String expected = "foo.txt";
          String checkprop = project.getProperty("file.w.suf");
          if (!checkprop.equals(expected)) { 
              fail("basename failed");
          }
      }
      
      public void test5() { 
          executeTarget("test5");
          String expected = "foo";
          String checkprop = project.getProperty("file.wo.suf");
          if (!checkprop.equals(expected)) { 
              fail("basename failed");
          }
      }
      
  }
  
  
  
  1.1                  jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/DirnameTest.java
  
  Index: DirnameTest.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Ant", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.tools.ant.taskdefs;
  
  import java.io.File;
  import org.apache.tools.ant.BuildFileTest;
  
  /**
   * @author Diane Holt <holtdl@apache.org> 
   */
  public class DirnameTest extends BuildFileTest { 
      
      public DirnameTest(String name) { 
          super(name);
      }    
      
      public void setUp() { 
          configureProject("src/etc/testcases/taskdefs/dirname.xml");
      }
  
      public void test1() { 
          expectBuildException("test1", "required attribute missing");
      }
  
      public void test2() { 
          expectBuildException("test2", "required attribute missing");
      }
  
      public void test3() { 
          expectBuildException("test3", "required attribute missing");
      }
  
      public void test4() { 
          executeTarget("test4");
          String filesep = System.getProperty("file.separator");
          String expected = filesep + "usr" + filesep + "local";
          String checkprop = project.getProperty("local.dir");
          if (!checkprop.equals(expected)) { 
              fail("dirname failed");
          }
      }
      
      public void test5() { 
          executeTarget("test5");
          String expected = project.getProperty("basedir");
          String checkprop = project.getProperty("base.dir");
          if (!checkprop.equals(expected)) { 
              fail("dirname failed");
          }
      }
      
  }
  
  
  

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