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 IntrospectionHelperTest.java
Date Fri, 07 Dec 2001 11:14:03 GMT
bodewig     01/12/07 03:14:03

  Modified:    src/testcases/org/apache/tools/ant
                        IntrospectionHelperTest.java
  Log:
  fix testcase that requires /tmp to exist (at least I hope so).
  
  Revision  Changes    Path
  1.11      +9 -9      jakarta-ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java
  
  Index: IntrospectionHelperTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/IntrospectionHelperTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- IntrospectionHelperTest.java	2001/10/31 11:05:00	1.10
  +++ IntrospectionHelperTest.java	2001/12/07 11:14:03	1.11
  @@ -58,6 +58,7 @@
   import junit.framework.AssertionFailedError;
   import java.io.File;
   import java.util.*;
  +import org.apache.tools.ant.taskdefs.condition.Os;
   
   /**
    * JUnit 3 testcases for org.apache.tools.ant.IntrospectionHelper.
  @@ -68,16 +69,15 @@
   public class IntrospectionHelperTest extends TestCase {
   
       private Project p;
  +    private static final String projectBasedir = File.separator;
   
  -    public static boolean isUnixStyle = File.pathSeparatorChar == ':';
  -
       public IntrospectionHelperTest(String name) {
           super(name);
       }
       
       public void setUp() {
           p = new Project();
  -        p.setBasedir("/tmp");
  +        p.setBasedir(projectBasedir);
       }
   
       public void testAddText() throws BuildException {
  @@ -307,7 +307,7 @@
           ih.setAttribute(p, this, "ten", "2");
           try {
               ih.setAttribute(p, this, "ten", "3");
  -            fail("/tmp/2 shouldn't be equals to /tmp/3");
  +            fail(projectBasedir+"2 shouldn't be equals to "+projectBasedir+"3");
           } catch (BuildException be) {
               assertTrue(be.getException() instanceof AssertionFailedError);
           }
  @@ -422,12 +422,12 @@
       }
   
       public void setTen(File f) {
  -        if (isUnixStyle) { 
  -            assertEquals("/tmp/2", f.getAbsolutePath());
  -        } else if (System.getProperty("os.name").toLowerCase(Locale.US).equals("netware"))
{
  -            assertEquals("\\tmp\\2", f.getAbsolutePath().toLowerCase(Locale.US));
  +        if (Os.isFamily("unix")) { 
  +            assertEquals(projectBasedir+"2", f.getAbsolutePath());
  +        } else if (Os.isFamily("netware")) {
  +            assertEquals(projectBasedir+"2", f.getAbsolutePath().toLowerCase(Locale.US));
           } else {
  -            assertEquals(":\\tmp\\2", f.getAbsolutePath().toLowerCase(Locale.US).substring(1));
  +            assertEquals(":"+projectBasedir+"2", f.getAbsolutePath().toLowerCase(Locale.US).substring(1));
           }
       }
   
  
  
  

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