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 JavacTest.java
Date Wed, 24 Apr 2002 11:24:28 GMT
bodewig     02/04/24 04:24:28

  Modified:    src/testcases/org/apache/tools/ant/taskdefs JavacTest.java
  Log:
  Make javac testcase work on JDK 1.4
  
  Thanks Magesh.
  
  Revision  Changes    Path
  1.8       +21 -5     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java
  
  Index: JavacTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JavacTest.java	18 Apr 2002 14:19:00 -0000	1.7
  +++ JavacTest.java	24 Apr 2002 11:24:28 -0000	1.8
  @@ -59,7 +59,9 @@
   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;
  +import org.apache.tools.ant.util.JavaEnvUtils;
   
   import junit.framework.TestCase;
   
  @@ -67,7 +69,7 @@
    * Testcase for <javac>.
    *
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  - * @version $Revision: 1.7 $ $Date: 2002/04/18 14:19:00 $
  + * @version $Revision: 1.8 $ $Date: 2002/04/24 11:24:28 $
    */
   public class JavacTest extends TestCase {
   
  @@ -138,10 +140,10 @@
           assertEquals("implementation is jikes but build.compiler is null", 
                        0, args.length);
   
  -        project.setProperty("build.compiler", "classic");
  +        project.setProperty("build.compiler", "jvc");
           args = javac.getCurrentCompilerArgs();
           assertNotNull(args);
  -        assertEquals("implementation is jikes but build.compiler is classic", 
  +        assertEquals("implementation is jikes but build.compiler is jvc", 
                        0, args.length);
   
           project.setProperty("build.compiler", "jikes");
  @@ -219,11 +221,25 @@
       }
   
       public void testCompilerAdapter() {
  -        javac.setCompiler("javac1.1");
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) 
  +            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) 
  +            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
  +            javac.setCompiler("javac1.1");
  +        } else {
  +            javac.setCompiler("javac1.4");
  +        }
  +
           javac.setDepend(true);
           CompilerAdapter adapter = 
               CompilerAdapterFactory.getCompiler(javac.getCompiler(), javac);
  -        assertTrue(adapter instanceof Javac12);
  +
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) 
  +            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) 
  +            || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
  +            assertTrue(adapter instanceof Javac12);
  +        } else {
  +            assertTrue(adapter instanceof Javac13);
  +        }
   
           javac.setFork(true);
           adapter = 
  
  
  

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