summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGintas Grigelionis <gintas@apache.org>2018-10-25 20:57:42 +0200
committerGintas Grigelionis <gintas@apache.org>2018-10-25 20:57:42 +0200
commitf32cf7cfa542457455366a8caddb62f4d950992f (patch)
tree518a77dbbcde54e68c4f15d0e5da8ce3c30a383a /src
parentf7aa06b03f474ad9dfd9e74f64956c3cfc58df13 (diff)
downloadant-f32cf7cfa542457455366a8caddb62f4d950992f.tar.gz
More hardcoded assumptions about file tree structure
Diffstat (limited to 'src')
-rw-r--r--src/etc/poms/ant/pom.xml6
-rw-r--r--src/etc/testcases/taskdefs/signjar.xml34
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java2
-rw-r--r--src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java8
-rw-r--r--src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java4
-rw-r--r--src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java4
6 files changed, 26 insertions, 32 deletions
diff --git a/src/etc/poms/ant/pom.xml b/src/etc/poms/ant/pom.xml
index a501d6563..3acd17c67 100644
--- a/src/etc/poms/ant/pom.xml
+++ b/src/etc/poms/ant/pom.xml
@@ -228,12 +228,12 @@
<value>${env.ANT_HOME}</value>
</property>
<property>
- <name>build.tests</name>
- <value>target/${project.artifactId}/testcases</value>
+ <name>build.classes.value</name>
+ <value>${project.basedir}/../../../../target/${project.artifactId}/classes</value>
</property>
<property>
<name>build.tests.value</name>
- <value>${project.basedir}/target/${project.artifactId}/testcases</value>
+ <value>${project.basedir}/../../../../target/${project.artifactId}/testcases</value>
</property>
<property>
<name>offline</name>
diff --git a/src/etc/testcases/taskdefs/signjar.xml b/src/etc/testcases/taskdefs/signjar.xml
index 38a13592c..93a2abe83 100644
--- a/src/etc/testcases/taskdefs/signjar.xml
+++ b/src/etc/testcases/taskdefs/signjar.xml
@@ -20,42 +20,38 @@
<import file="../buildfiletest-base.xml"/>
<target name="setUp">
- <mkdir dir="${output}" />
- <property name="subdir" location="${output}/subdir" />
- <property name="classes.dir" value="../../../build/classes"/>
- <property name="test.jar" location="${output}/signtest.jar" />
- <property name="subdirtest.jar" location="${subdir}/signtest.jar" />
-
+ <mkdir dir="${output}"/>
+ <property name="subdir" location="${output}/subdir"/>
+ <property name="test.jar" location="${output}/signtest.jar"/>
+ <property name="subdirtest.jar" location="${subdir}/signtest.jar"/>
</target>
<macrodef name="assertSigned">
- <attribute name="jar" default="${test.jar}" />
+ <attribute name="jar" default="${test.jar}"/>
<sequential>
- <fail message="not signed: @{jar}" >
+ <fail message="not signed: @{jar}">
<condition>
- <not><issigned file="@{jar}" /></not>
+ <not><issigned file="@{jar}"/></not>
</condition>
</fail>
</sequential>
</macrodef>
<presetdef name="sign-base">
- <signjar alias="testonly" keystore="testkeystore"
- storepass="apacheant"/>
+ <signjar alias="testonly" keystore="testkeystore" storepass="apacheant"/>
</presetdef>
<presetdef name="verify-base">
- <verifyjar keystore="testkeystore"
- storepass="apacheant"/>
+ <verifyjar keystore="testkeystore" storepass="apacheant"/>
</presetdef>
<presetdef name="sign">
- <sign-base jar="${test.jar}" />
+ <sign-base jar="${test.jar}"/>
</presetdef>
<target name="jar" depends="setUp">
- <jar jarfile="${test.jar}" basedir="${classes.dir}" includes="**/Task.class"/>
+ <jar jarfile="${test.jar}" basedir="${build.classes.value}" includes="**/Task.class"/>
</target>
<target name="help">
@@ -63,7 +59,7 @@
</target>
<target name="basic" depends="jar">
- <sign />
+ <sign/>
<assertSigned/>
</target>
@@ -84,14 +80,12 @@
</target>
<target name="urlKeystoreHTTP" depends="jar">
- <sign
- keystore="http://ant.apache.org/webtest/testkeystore"
- />
+ <sign keystore="http://ant.apache.org/webtest/testkeystore"/>
<assertSigned/>
</target>
<target name="testTsaLocalhost" depends="jar">
- <sign tsaurl="http://localhost:0/" />
+ <sign tsaurl="http://localhost:0/"/>
</target>
</project>
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
index 53f36b8ab..70c619889 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
@@ -102,7 +102,7 @@ import org.apache.tools.ant.util.StringUtils;
* &lt;junit printsummary="no" haltonfailure="yes" fork="${junit.fork}"&gt;
* &lt;jvmarg value="-classic"/&gt;
* &lt;classpath refid="tests-classpath"/&gt;
- * &lt;sysproperty key="build.tests" value="${build.tests}"/&gt;
+ * &lt;sysproperty key="build.tests.value" value="${build.tests.value}"/&gt;
* &lt;formatter type="brief" usefile="false" /&gt;
* &lt;batchtest&gt;
* &lt;fileset dir="${tests.dir}"&gt;
diff --git a/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java b/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java
index fcaf5cbf3..a5d09412b 100644
--- a/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java
+++ b/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java
@@ -58,8 +58,8 @@ public class AntClassLoaderDelegationTest {
@Test
public void testFindResources() throws Exception {
// This path should contain the class files for these testcases:
- String buildTestcases = System.getProperty("build.tests");
- assertNotNull("defined ${build.tests}", buildTestcases);
+ String buildTestcases = System.getProperty("build.tests.value");
+ assertNotNull("defined ${build.tests.value}", buildTestcases);
assertTrue("have a dir " + buildTestcases,
new File(buildTestcases).isDirectory());
Path path = new Path(p, buildTestcases + "/org");
@@ -84,8 +84,8 @@ public class AntClassLoaderDelegationTest {
@SuppressWarnings("resource")
@Test
public void testFindIsolateResources() throws Exception {
- String buildTestcases = System.getProperty("build.tests");
- assertNotNull("defined ${build.tests}", buildTestcases);
+ String buildTestcases = System.getProperty("build.tests.value");
+ assertNotNull("defined ${build.tests.value}", buildTestcases);
assertTrue("have a dir " + buildTestcases,
new File(buildTestcases).isDirectory());
Path path = new Path(p, buildTestcases + "/org");
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
index 747e44d4e..256b0bc9a 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteJavaTest.java
@@ -119,9 +119,9 @@ public class ExecuteJavaTest {
* This is severely dependent on the build.xml properties.
*/
private static String getTestClassPath() {
- String classpath = System.getProperty("build.tests");
+ String classpath = System.getProperty("build.tests.value");
if (classpath == null) {
- System.err.println("WARNING: 'build.tests' property is not available!");
+ System.err.println("WARNING: 'build.tests.value' property is not available!");
classpath = System.getProperty("java.class.path");
}
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
index 994f7af4a..3a4e7af83 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
@@ -56,9 +56,9 @@ public class ExecuteWatchdogTest {
* severely tied to the build.xml properties.
*/
private static String getTestClassPath() {
- String classpath = System.getProperty("build.tests");
+ String classpath = System.getProperty("build.tests.value");
if (classpath == null) {
- System.err.println("WARNING: 'build.tests' property is not available!");
+ System.err.println("WARNING: 'build.tests.value' property is not available!");
classpath = System.getProperty("java.class.path");
}