ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject cvs commit: ant/src/etc/testcases/taskdefs input.xml
Date Tue, 29 Mar 2005 18:35:46 GMT
jglick      2005/03/29 10:35:46

  Modified:    src/testcases/org/apache/tools/ant/util
                        JavaEnvUtilsTest.java
               src/testcases/org/apache/tools/ant/types/selectors
                        PresentSelectorTest.java DependSelectorTest.java
                        DateSelectorTest.java
               src/testcases/org/apache/tools/ant/taskdefs/optional/net
                        FTPTest.java
               src/testcases/org/apache/tools/ant/taskdefs
                        ProcessDestroyerTest.java JavacTest.java
                        InputTest.java ExecuteWatchdogTest.java
                        ExecuteJavaTest.java CopyTest.java
               src/testcases/org/apache/tools/ant ProjectTest.java
               src/main/org/apache/tools/ant/util JavaEnvUtils.java
               src/main/org/apache/tools/ant/types Path.java
               src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        Coverage.java
               src/main/org/apache/tools/ant/taskdefs/optional/javah
                        SunJavah.java
               src/main/org/apache/tools/ant/taskdefs/compilers
                        DefaultCompilerAdapter.java
                        CompilerAdapterFactory.java
               src/etc/testcases/taskdefs input.xml
  Log:
  Removing old code testing for JDK 1.0 and 1.1.
  
  Revision  Changes    Path
  1.11      +3 -12     ant/src/testcases/org/apache/tools/ant/util/JavaEnvUtilsTest.java
  
  Index: JavaEnvUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/JavaEnvUtilsTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JavaEnvUtilsTest.java	6 Jan 2005 12:05:07 -0000	1.10
  +++ JavaEnvUtilsTest.java	29 Mar 2005 18:35:45 -0000	1.11
  @@ -69,15 +69,8 @@
                       FILE_UTILS.normalize(javaHome+"/..").getAbsolutePath();
                   assertTrue(j+" is normalized and in the JDK dir",
                              j.startsWith(javaHomeParent));
  -
  -                if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_0 ||
  -                    JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1) {
  -                    assertTrue(j+" is normalized and in the JRE dir",
  -                               j.startsWith(javaHome));
  -                } else {
  -                    assertTrue(j+" is normalized and not in the JRE dir",
  -                               !j.startsWith(javaHome));
  -                }
  +                assertTrue(j+" is normalized and not in the JRE dir",
  +                           !j.startsWith(javaHome));
   
               } catch (AssertionFailedError e) {
                   // java.home is bogus
  @@ -117,9 +110,7 @@
               assertTrue(j+" is normalized and in the JDK dir",
                          j.startsWith(javaHomeParent));
   
  -            if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_0 ||
  -                JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1 ||
  -                Os.isFamily("mac")) {
  +            if (Os.isFamily("mac")) {
                   assertTrue(j+" is normalized and in the JRE dir",
                              j.startsWith(javaHome));
               } else {
  
  
  
  1.10      +1 -12     ant/src/testcases/org/apache/tools/ant/types/selectors/PresentSelectorTest.java
  
  Index: PresentSelectorTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/selectors/PresentSelectorTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PresentSelectorTest.java	7 Dec 2004 09:10:38 -0000	1.9
  +++ PresentSelectorTest.java	29 Mar 2005 18:35:45 -0000	1.10
  @@ -19,17 +19,10 @@
   
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.util.*;
  -import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.types.Mapper;
  -import org.apache.tools.ant.util.FileNameMapper;
  -import org.apache.tools.ant.util.IdentityMapper;
  -import org.apache.tools.ant.util.GlobPatternMapper;
   
   import java.io.File;
   
  -import junit.framework.TestCase;
  -import junit.framework.AssertionFailedError;
   
   /**
    * Tests Present Selectors
  @@ -113,11 +106,7 @@
               m = s.createMapper();
               m.setType(flatten);
               results = selectionString(s);
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -                assertEquals("TTTTTFFFFFFF", results);
  -            } else {
  -                assertEquals("TTTTTTTTTTTF", results);
  -            }
  +            assertEquals("TTTTTTTTTTTF", results);
   
               s = (PresentSelector)getInstance();
               s.setTargetdir(beddir);
  
  
  
  1.9       +24 -33    ant/src/testcases/org/apache/tools/ant/types/selectors/DependSelectorTest.java
  
  Index: DependSelectorTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/selectors/DependSelectorTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DependSelectorTest.java	9 Mar 2004 16:49:07 -0000	1.8
  +++ DependSelectorTest.java	29 Mar 2005 18:35:45 -0000	1.9
  @@ -19,17 +19,10 @@
   
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.types.Mapper;
  -import org.apache.tools.ant.util.FileNameMapper;
  -import org.apache.tools.ant.util.IdentityMapper;
  -import org.apache.tools.ant.util.GlobPatternMapper;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
   import java.io.File;
   
  -import junit.framework.TestCase;
  -import junit.framework.AssertionFailedError;
   
   /**
    * Tests Depend Selectors
  @@ -106,34 +99,32 @@
               results = selectionString(s);
               assertEquals("FFFFFFFFFFFF", results);
   
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -                s = (DependSelector)getInstance();
  -                s.setTargetdir(beddir);
  -                m = s.createMapper();
  -                m.setType(merge);
  -                m.setTo("asf-logo.gif.gz");
  -                results = selectionString(s);
  -                assertEquals("TFFFFTTTFFF", results.substring(0,11));
  +            s = (DependSelector)getInstance();
  +            s.setTargetdir(beddir);
  +            m = s.createMapper();
  +            m.setType(merge);
  +            m.setTo("asf-logo.gif.gz");
  +            results = selectionString(s);
  +            assertEquals("TFFFFTTTFFF", results.substring(0,11));
   
  -                s = (DependSelector)getInstance();
  -                s.setTargetdir(beddir);
  -                m = s.createMapper();
  -                m.setType(merge);
  -                m.setTo("asf-logo.gif.bz2");
  -                results = selectionString(s);
  -                assertEquals("TTFTTTTTTTTT", results);
  +            s = (DependSelector)getInstance();
  +            s.setTargetdir(beddir);
  +            m = s.createMapper();
  +            m.setType(merge);
  +            m.setTo("asf-logo.gif.bz2");
  +            results = selectionString(s);
  +            assertEquals("TTFTTTTTTTTT", results);
   
  -                // Test for path relative to project base directory
  -                s = (DependSelector)getInstance();
  -                subdir = new File("selectortest/tar/bz2");
  -                s.setTargetdir(subdir);
  -                m = s.createMapper();
  -                m.setType(glob);
  -                m.setFrom("*.bz2");
  -                m.setTo("*.tar.bz2");
  -                results = selectionString(s);
  -                assertEquals("FFTFFFFFFTTF", results);
  -            }
  +            // Test for path relative to project base directory
  +            s = (DependSelector)getInstance();
  +            subdir = new File("selectortest/tar/bz2");
  +            s.setTargetdir(subdir);
  +            m = s.createMapper();
  +            m.setType(glob);
  +            m.setFrom("*.bz2");
  +            m.setTo("*.tar.bz2");
  +            results = selectionString(s);
  +            assertEquals("FFTFFFFFFTTF", results);
   
               s = (DependSelector)getInstance();
               subdir = new File(beddir,"tar/bz2");
  
  
  
  1.9       +35 -41    ant/src/testcases/org/apache/tools/ant/types/selectors/DateSelectorTest.java
  
  Index: DateSelectorTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/selectors/DateSelectorTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DateSelectorTest.java	9 Mar 2004 16:49:06 -0000	1.8
  +++ DateSelectorTest.java	29 Mar 2005 18:35:45 -0000	1.9
  @@ -19,16 +19,12 @@
   
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.types.Parameter;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
   import java.text.SimpleDateFormat;
   import java.text.ParsePosition;
   import java.util.Date;
   
  -import junit.framework.TestCase;
  -import junit.framework.AssertionFailedError;
   
   /**
    * Tests Date Selectors.
  @@ -170,47 +166,45 @@
               results = selectionString(s);
               assertEquals("TTTTTTTTTTTT", results);
   
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -                s = (DateSelector)getInstance();
  -                s.setDatetime("11/21/2001 4:54 AM");
  -                s.setWhen(before);
  -                results = selectionString(s);
  -                assertEquals("TFTFFFFFFFFT", results);
  +            s = (DateSelector)getInstance();
  +            s.setDatetime("11/21/2001 4:54 AM");
  +            s.setWhen(before);
  +            results = selectionString(s);
  +            assertEquals("TFTFFFFFFFFT", results);
   
  -                s = (DateSelector)getInstance();
  -                s.setDatetime("11/21/2001 4:55 AM");
  -                SimpleDateFormat formatter = new SimpleDateFormat();
  -                Date d = formatter.parse("11/21/2001 4:55 AM",new ParsePosition(0));
  -
  -                long milliseconds = s.getMillis();
  -                s.setWhen(equal);
  -                results = selectionString(s);
  -                assertEquals("TTFFTFFFTTTT", results);
  +            s = (DateSelector)getInstance();
  +            s.setDatetime("11/21/2001 4:55 AM");
  +            SimpleDateFormat formatter = new SimpleDateFormat();
  +            Date d = formatter.parse("11/21/2001 4:55 AM",new ParsePosition(0));
   
  -                s = (DateSelector)getInstance();
  -                s.setMillis(milliseconds);
  -                s.setWhen(equal);
  -                results = selectionString(s);
  -                assertEquals("TTFFTFFFTTTT", results);
  +            long milliseconds = s.getMillis();
  +            s.setWhen(equal);
  +            results = selectionString(s);
  +            assertEquals("TTFFTFFFTTTT", results);
   
  -                s = (DateSelector)getInstance();
  -                s.setDatetime("11/21/2001 4:56 AM");
  -                s.setWhen(after);
  -                results = selectionString(s);
  -                assertEquals("TFFTFTTTFFFT", results);
  +            s = (DateSelector)getInstance();
  +            s.setMillis(milliseconds);
  +            s.setWhen(equal);
  +            results = selectionString(s);
  +            assertEquals("TTFFTFFFTTTT", results);
   
  -                s = (DateSelector)getInstance();
  -                Parameter param1 = new Parameter();
  -                Parameter param2 = new Parameter();
  -                param1.setName("datetime");
  -                param1.setValue("11/21/2001 4:56 AM");
  -                param2.setName("when");
  -                param2.setValue("after");
  -                Parameter[] params = {param1,param2};
  -                s.setParameters(params);
  -                results = selectionString(s);
  -                assertEquals("TFFTFTTTFFFT", results);
  -            }
  +            s = (DateSelector)getInstance();
  +            s.setDatetime("11/21/2001 4:56 AM");
  +            s.setWhen(after);
  +            results = selectionString(s);
  +            assertEquals("TFFTFTTTFFFT", results);
  +
  +            s = (DateSelector)getInstance();
  +            Parameter param1 = new Parameter();
  +            Parameter param2 = new Parameter();
  +            param1.setName("datetime");
  +            param1.setValue("11/21/2001 4:56 AM");
  +            param2.setName("when");
  +            param2.setValue("after");
  +            Parameter[] params = {param1,param2};
  +            s.setParameters(params);
  +            results = selectionString(s);
  +            assertEquals("TFFTFTTTFFFT", results);
               try {
                   makeMirror();
   
  
  
  
  1.14      +1 -2      ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java
  
  Index: FTPTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FTPTest.java	9 Feb 2004 21:05:45 -0000	1.13
  +++ FTPTest.java	29 Mar 2005 18:35:45 -0000	1.14
  @@ -31,8 +31,7 @@
   
   public class FTPTest extends BuildFileTest{
       // keep track of what operating systems are supported here.
  -    private boolean supportsSymlinks = Os.isFamily("unix")
  -        && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1);
  +    private boolean supportsSymlinks = Os.isFamily("unix");
   
       private FTPClient ftp;
       private boolean connectionSucceeded = true;
  
  
  
  1.6       +1 -2      ant/src/testcases/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java
  
  Index: ProcessDestroyerTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ProcessDestroyerTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProcessDestroyerTest.java	9 Mar 2004 16:48:57 -0000	1.5
  +++ ProcessDestroyerTest.java	29 Mar 2005 18:35:45 -0000	1.6
  @@ -39,8 +39,7 @@
       }
   
       public void testProcessDestroyer(){
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  -            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) {
               return;
           }
   
  
  
  
  1.18      +2 -5      ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java
  
  Index: JavacTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JavacTest.java	9 Mar 2005 00:20:39 -0000	1.17
  +++ JavacTest.java	29 Mar 2005 18:35:45 -0000	1.18
  @@ -20,7 +20,6 @@
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter;
   import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory;
  -import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter;
   import org.apache.tools.ant.taskdefs.compilers.Javac12;
   import org.apache.tools.ant.taskdefs.compilers.Javac13;
   import org.apache.tools.ant.taskdefs.compilers.JavacExternal;
  @@ -189,8 +188,7 @@
       }
   
       public void testCompilerAdapter() {
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  -            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
               || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
               javac.setCompiler("javac1.1");
           } else {
  @@ -201,8 +199,7 @@
           CompilerAdapter adapter =
               CompilerAdapterFactory.getCompiler(javac.getCompiler(), javac);
   
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  -            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
               || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
               assertTrue(adapter instanceof Javac12);
           } else {
  
  
  
  1.11      +7 -17     ant/src/testcases/org/apache/tools/ant/taskdefs/InputTest.java
  
  Index: InputTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/InputTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- InputTest.java	9 Mar 2004 16:48:57 -0000	1.10
  +++ InputTest.java	29 Mar 2005 18:35:45 -0000	1.11
  @@ -19,19 +19,12 @@
   
   import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.input.PropertyFileInputHandler;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
  -/**
  - */
  -public class InputTest extends BuildFileTest {
   
  -    private String targetPostfix = "";
  +public class InputTest extends BuildFileTest {
   
       public InputTest(String name) {
           super(name);
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            targetPostfix = ".1";
  -        }
       }
   
       public void setUp() {
  @@ -44,15 +37,15 @@
       }
   
       public void test1() {
  -        executeTarget("test1" + targetPostfix);
  +        executeTarget("test1");
       }
   
       public void test2() {
  -        executeTarget("test2" + targetPostfix);
  +        executeTarget("test2");
       }
   
       public void test3() {
  -        expectSpecificBuildException("test3" + targetPostfix, "invalid input",
  +        expectSpecificBuildException("test3", "invalid input",
                                        "Found invalid input test for \'"
                                        + getKey("All data is"
                                                 + " going to be deleted from DB"
  @@ -61,19 +54,16 @@
       }
   
       public void test5() {
  -        executeTarget("test5" + targetPostfix);
  +        executeTarget("test5");
       }
   
       public void test6() {
  -        executeTarget("test6" + targetPostfix);
  +        executeTarget("test6");
           assertEquals("scott", project.getProperty("db.user"));
       }
   
       private String getKey(String key) {
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            key = key.replace(' ', '_');
  -        }
  -        return key;
  +        return key; // XXX what is this for?
       }
   
   }
  
  
  
  1.19      +0 -10     ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
  
  Index: ExecuteWatchdogTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ExecuteWatchdogTest.java	9 Mar 2004 16:48:57 -0000	1.18
  +++ ExecuteWatchdogTest.java	29 Mar 2005 18:35:45 -0000	1.19
  @@ -18,8 +18,6 @@
   package org.apache.tools.ant.taskdefs;
   
   import org.apache.tools.ant.util.JavaEnvUtils;
  -
  -import java.net.*;
   import junit.framework.*;
   import java.io.*;
   
  @@ -57,14 +55,6 @@
               classpath = System.getProperty("java.class.path");
           }
   
  -        // JDK 1.1 needs classes.zip in -classpath argument
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            classpath +=   File.pathSeparator
  -                + System.getProperty("java.home")
  -                + File.separator + "lib"
  -                + File.separator + "classes.zip";
  -        }
  -
           return classpath;
       }
   
  
  
  
  1.12      +0 -10     ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
  
  Index: ExecuteJavaTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ExecuteJavaTest.java	1 Mar 2005 21:26:34 -0000	1.11
  +++ ExecuteJavaTest.java	29 Mar 2005 18:35:45 -0000	1.12
  @@ -23,8 +23,6 @@
   import org.apache.tools.ant.taskdefs.condition.Os;
   import org.apache.tools.ant.util.JavaEnvUtils;
   
  -import java.io.File;
  -
   import junit.framework.TestCase;
   
   /**
  @@ -130,14 +128,6 @@
               classpath = System.getProperty("java.class.path");
           }
   
  -        // JDK 1.1 needs classes.zip in -classpath argument
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            classpath +=   File.pathSeparator
  -                + System.getProperty("java.home")
  -                + File.separator + "lib"
  -                + File.separator + "classes.zip";
  -        }
  -
           return classpath;
       }
   
  
  
  
  1.20      +2 -5      ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java
  
  Index: CopyTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CopyTest.java	6 Jan 2005 12:05:03 -0000	1.19
  +++ CopyTest.java	29 Mar 2005 18:35:45 -0000	1.20
  @@ -19,7 +19,6 @@
   
   import org.apache.tools.ant.BuildFileTest;
   import org.apache.tools.ant.util.FileUtils;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   import java.io.File;
   import java.io.IOException;
   
  @@ -83,10 +82,8 @@
           }
   
           //file time checks for java1.2+
  -        if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            assertTrue(file3a.lastModified()==file3.lastModified());
  -            assertTrue(file3c.lastModified()<file3a.lastModified());
  -        }
  +        assertTrue(file3a.lastModified()==file3.lastModified());
  +        assertTrue(file3c.lastModified()<file3a.lastModified());
   
       }
   
  
  
  
  1.30      +3 -20     ant/src/testcases/org/apache/tools/ant/ProjectTest.java
  
  Index: ProjectTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/ProjectTest.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ProjectTest.java	1 Mar 2005 22:59:44 -0000	1.29
  +++ ProjectTest.java	29 Mar 2005 18:35:45 -0000	1.30
  @@ -22,14 +22,10 @@
   import org.apache.tools.ant.input.PropertyFileInputHandler;
   import org.apache.tools.ant.taskdefs.condition.Os;
   import org.apache.tools.ant.types.*;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
   import java.io.File;
  -
  -import junit.framework.AssertionFailedError;
  -import junit.framework.Test;
   import junit.framework.TestCase;
  -import junit.framework.TestSuite;
  +
   
   /**
    * Very limited test class for Project. Waiting to be extended.
  @@ -191,21 +187,8 @@
   
           assertTaskDefFails(DummyTaskPrivate.class,   DummyTaskPrivate.class   + " is not
public");
   
  -        try {
  -            assertTaskDefFails(DummyTaskProtected.class,
  -                               DummyTaskProtected.class + " is not public");
  -        } catch (AssertionFailedError e) {
  -            /*
  -             * I don't understand this, but this is what happens with
  -             * > java -fullversion
  -             * java full version "Linux_JDK_1.1.8_v3_green_threads"
  -             * from time to time
  -             */
  -            assertTrue(JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1));
  -            assertTaskDefFails(DummyTaskProtected.class,
  -                               "No public no-arg constructor in "
  -                               + DummyTaskProtected.class);
  -        }
  +        assertTaskDefFails(DummyTaskProtected.class,
  +                           DummyTaskProtected.class + " is not public");
   
           assertTaskDefFails(DummyTaskPackage.class,   DummyTaskPackage.class   + " is not
public");
   
  
  
  
  1.27      +2 -0      ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
  
  Index: JavaEnvUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- JavaEnvUtils.java	23 Mar 2005 15:36:10 -0000	1.26
  +++ JavaEnvUtils.java	29 Mar 2005 18:35:45 -0000	1.27
  @@ -138,6 +138,8 @@
        * Compares the current Java version to the passed in String -
        * assumes the argument is one of the constants defined in this
        * class.
  +     * Note that Ant now requires JDK 1.2+ so {@link #JAVA_1_0} and
  +     * {@link #JAVA_1_1} need no longer be tested for.
        * @param version the version to check against the current version.
        * @return true if the version of Java is the same as the given version.
        * @since Ant 1.5
  
  
  
  1.71      +2 -7      ant/src/main/org/apache/tools/ant/types/Path.java
  
  Index: Path.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Path.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- Path.java	14 Mar 2005 16:56:41 -0000	1.70
  +++ Path.java	29 Mar 2005 18:35:46 -0000	1.71
  @@ -649,20 +649,15 @@
           }
   
           if (System.getProperty("java.vendor").toLowerCase(Locale.US).indexOf("microsoft")
>= 0) {
  +            // XXX is this code still necessary? is there any 1.2+ port?
               // Pull in *.zip from packages directory
               FileSet msZipFiles = new FileSet();
               msZipFiles.setDir(new File(System.getProperty("java.home")
                   + File.separator + "Packages"));
               msZipFiles.setIncludes("*.ZIP");
               addFileset(msZipFiles);
  -        } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            addExisting(new Path(null,
  -                                 System.getProperty("java.home")
  -                                 + File.separator + "lib"
  -                                 + File.separator
  -                                 + "classes.zip"));
           } else {
  -            // JDK > 1.1 seems to set java.home to the JRE directory.
  +            // JDK 1.2+ seems to set java.home to the JRE directory.
               addExisting(new Path(null,
                                    System.getProperty("java.home")
                                    + File.separator + "lib"
  
  
  
  1.24      +3 -5      ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Coverage.java	9 Mar 2004 16:48:35 -0000	1.23
  +++ Coverage.java	29 Mar 2005 18:35:46 -0000	1.24
  @@ -332,12 +332,10 @@
           // check for info, do your best to select the java executable.
           // JProbe 3.0 fails if there is no javaexe option. So
           if (javaExe == null && (vm == null || "java2".equals(vm))) {
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -                if (vm == null) {
  -                    vm = "java2";
  -                }
  -                javaExe = new File(JavaEnvUtils.getJreExecutable("java"));
  +            if (vm == null) {
  +                vm = "java2";
               }
  +            javaExe = new File(JavaEnvUtils.getJreExecutable("java"));
           }
       }
   
  
  
  
  1.3       +13 -20    ant/src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java
  
  Index: SunJavah.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SunJavah.java	10 Feb 2005 23:10:17 -0000	1.2
  +++ SunJavah.java	29 Mar 2005 18:35:46 -0000	1.3
  @@ -24,7 +24,7 @@
   import org.apache.tools.ant.taskdefs.optional.Javah;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
  -import org.apache.tools.ant.util.JavaEnvUtils;
  +
   
   /**
    * Adapter to com.sun.tools.javah.oldjavah.Main or com.sun.tools.javah.Main.
  @@ -83,25 +83,18 @@
               cmd.createArgument().setPath(javah.getClasspath());
           }
   
  -        // JDK1.1 is rather simpler than JDK1.2
  -        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
  -            if (javah.getVerbose()) {
  -                cmd.createArgument().setValue("-v");
  -            }
  -        } else {
  -            if (javah.getVerbose()) {
  -                cmd.createArgument().setValue("-verbose");
  -            }
  -            if (javah.getOld()) {
  -                cmd.createArgument().setValue("-old");
  -            }
  -            if (javah.getForce()) {
  -                cmd.createArgument().setValue("-force");
  -            }
  -            if (javah.getStubs() && !javah.getOld()) {
  -                throw new BuildException("stubs only available in old mode.", 
  -                                         javah.getLocation());
  -            }
  +        if (javah.getVerbose()) {
  +            cmd.createArgument().setValue("-verbose");
  +        }
  +        if (javah.getOld()) {
  +            cmd.createArgument().setValue("-old");
  +        }
  +        if (javah.getForce()) {
  +            cmd.createArgument().setValue("-force");
  +        }
  +        if (javah.getStubs() && !javah.getOld()) {
  +            throw new BuildException("stubs only available in old mode.", 
  +                                     javah.getLocation());
           }
   
           if (javah.getStubs()) {
  
  
  
  1.61      +1 -5      ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- DefaultCompilerAdapter.java	21 Mar 2005 15:26:16 -0000	1.60
  +++ DefaultCompilerAdapter.java	29 Mar 2005 18:35:46 -0000	1.61
  @@ -529,11 +529,7 @@
        * @since Ant 1.5
        */
       protected boolean assumeJava11() {
  -        return "javac1.1".equals(attributes.getCompilerVersion())
  -            || ("classic".equals(attributes.getCompilerVersion())
  -                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1))
  -            || ("extJavac".equals(attributes.getCompilerVersion())
  -                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1));
  +        return "javac1.1".equals(attributes.getCompilerVersion());
       }
   
       /**
  
  
  
  1.28      +1 -2      ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
  
  Index: CompilerAdapterFactory.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- CompilerAdapterFactory.java	30 Sep 2004 12:41:52 -0000	1.27
  +++ CompilerAdapterFactory.java	29 Mar 2005 18:35:46 -0000	1.28
  @@ -62,8 +62,7 @@
           throws BuildException {
               boolean isClassicCompilerSupported = true;
               //as new versions of java come out, add them to this test
  -            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  -                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
  +            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
                   && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
                   isClassicCompilerSupported = false;
               }
  
  
  
  1.5       +0 -26     ant/src/etc/testcases/taskdefs/input.xml
  
  Index: input.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/input.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- input.xml	23 Apr 2002 10:29:42 -0000	1.4
  +++ input.xml	29 Mar 2005 18:35:46 -0000	1.5
  @@ -28,30 +28,4 @@
              />
     </target>
   
  -  <target name="test1.1">
  -    <input>Press_Return_key_to_continue...</input>
  -  </target>
  -
  -  <target name="test2.1">
  -    <input message="Press_Return_key_to_continue..." />
  -  </target>
  -
  -  <target name="test3.1">
  -    <input message="All_data_is_going_to_be_deleted_from_DB_continue?"
  -           validargs="y,n"
  -           />
  -  </target>
  -
  -  <target name="test5.1">
  -    <input message="All_data_is_going_to_be_deleted_from_db_continue_(y/n)?"
  -           validargs="y,n"
  -           />
  -  </target>
  -
  -  <target name="test6.1">
  -    <input message="Please_enter_db_username"
  -           addproperty="db.user"
  -           />
  -  </target>
  -
   </project>
  
  
  

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


Mime
View raw message