git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272555 13f79535-47bb-0310-9956-ffa450edef68master
@@ -58,6 +58,7 @@ import org.apache.tools.ant.input.DefaultInputHandler; | |||||
import org.apache.tools.ant.input.InputHandler; | import org.apache.tools.ant.input.InputHandler; | ||||
import org.apache.tools.ant.input.PropertyFileInputHandler; | import org.apache.tools.ant.input.PropertyFileInputHandler; | ||||
import org.apache.tools.ant.types.*; | import org.apache.tools.ant.types.*; | ||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
import java.io.File; | import java.io.File; | ||||
@@ -199,7 +200,7 @@ public class ProjectTest extends TestCase { | |||||
* java full version "Linux_JDK_1.1.8_v3_green_threads" | * java full version "Linux_JDK_1.1.8_v3_green_threads" | ||||
* from time to time | * from time to time | ||||
*/ | */ | ||||
assertSame(Project.JAVA_1_1, p.getJavaVersion()); | |||||
assertTrue(JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)); | |||||
assertTaskDefFails(DummyTaskProtected.class, | assertTaskDefFails(DummyTaskProtected.class, | ||||
"No public no-arg constructor in " | "No public no-arg constructor in " | ||||
+ DummyTaskProtected.class); | + DummyTaskProtected.class); | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs; | |||||
import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
/** | /** | ||||
* @author Nico Seessle <nico@seessle.de> | * @author Nico Seessle <nico@seessle.de> | ||||
@@ -200,7 +201,7 @@ public class AvailableTest extends BuildFileTest { | |||||
// Core class that exists in system classpath is ignored, but found in specified classpath | // Core class that exists in system classpath is ignored, but found in specified classpath | ||||
public void test21() { | public void test21() { | ||||
if (project.getJavaVersion() == Project.JAVA_1_1) { | |||||
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
// java.* classes are not found in JDK 1.1 even if specified in classpath attribute; test24 shows correct operation | // java.* classes are not found in JDK 1.1 even if specified in classpath attribute; test24 shows correct operation | ||||
return; | return; | ||||
} | } | ||||
@@ -57,6 +57,7 @@ package org.apache.tools.ant.taskdefs; | |||||
import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
import java.io.File; | import java.io.File; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
@@ -118,7 +119,7 @@ public class CopyTest extends BuildFileTest { | |||||
} | } | ||||
//file time checks for java1.2+ | //file time checks for java1.2+ | ||||
if (Project.getJavaVersion() != Project.JAVA_1_1) { | |||||
if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
assertTrue(file3a.lastModified()==file3.lastModified()); | assertTrue(file3a.lastModified()==file3.lastModified()); | ||||
assertTrue(file3c.lastModified()<file3a.lastModified()); | assertTrue(file3c.lastModified()<file3a.lastModified()); | ||||
} | } | ||||
@@ -57,6 +57,7 @@ package org.apache.tools.ant.taskdefs; | |||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
import java.io.File; | import java.io.File; | ||||
@@ -135,7 +136,7 @@ public class ExecuteJavaTest extends TestCase { | |||||
} | } | ||||
// JDK 1.1 needs classes.zip in -classpath argument | // JDK 1.1 needs classes.zip in -classpath argument | ||||
if (Project.getJavaVersion() == Project.JAVA_1_1) { | |||||
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
classpath += File.pathSeparator | classpath += File.pathSeparator | ||||
+ System.getProperty("java.home") | + System.getProperty("java.home") | ||||
+ File.separator + "lib" | + File.separator + "lib" | ||||
@@ -54,7 +54,7 @@ | |||||
package org.apache.tools.ant.taskdefs; | package org.apache.tools.ant.taskdefs; | ||||
import org.apache.tools.ant.Project; | |||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
import java.net.*; | import java.net.*; | ||||
import junit.framework.*; | import junit.framework.*; | ||||
@@ -96,7 +96,7 @@ public class ExecuteWatchdogTest extends TestCase { | |||||
} | } | ||||
// JDK 1.1 needs classes.zip in -classpath argument | // JDK 1.1 needs classes.zip in -classpath argument | ||||
if (Project.getJavaVersion() == Project.JAVA_1_1) { | |||||
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
classpath += File.pathSeparator | classpath += File.pathSeparator | ||||
+ System.getProperty("java.home") | + System.getProperty("java.home") | ||||
+ File.separator + "lib" | + File.separator + "lib" | ||||
@@ -59,6 +59,7 @@ import java.io.*; | |||||
import junit.framework.AssertionFailedError; | import junit.framework.AssertionFailedError; | ||||
import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.util.JavaEnvUtils; | |||||
/** | /** | ||||
* @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a> | * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a> | ||||
@@ -168,7 +169,7 @@ public class FixCrLfTest extends BuildFileTest { | |||||
} | } | ||||
public void testEncoding() throws IOException { | public void testEncoding() throws IOException { | ||||
if (project.getJavaVersion() == Project.JAVA_1_1) { | |||||
if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
// UTF16 is not supported in JDK 1.1 | // UTF16 is not supported in JDK 1.1 | ||||
return; | return; | ||||
} | } | ||||