summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/etc/poms/ant/pom.xml2
-rw-r--r--src/etc/testcases/taskdefs/optional/replaceregexp.xml26
-rw-r--r--src/etc/testcases/taskdefs/optional/script.xml24
-rw-r--r--src/etc/testcases/taskdefs/optional/script/scriptdef.xml113
-rw-r--r--src/tests/junit/org/apache/tools/ant/taskdefs/InitializeClassTest.java2
-rw-r--r--src/tests/junit/org/apache/tools/ant/taskdefs/XmlnsTest.java2
-rw-r--r--src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java2
7 files changed, 79 insertions, 92 deletions
diff --git a/src/etc/poms/ant/pom.xml b/src/etc/poms/ant/pom.xml
index 15ffeb7c0..b3c285004 100644
--- a/src/etc/poms/ant/pom.xml
+++ b/src/etc/poms/ant/pom.xml
@@ -173,7 +173,7 @@
<!-- obsolete -->
<exclude>org/apache/tools/ant/taskdefs/optional/Jspc*</exclude>
<exclude>org/apache/tools/ant/taskdefs/optional/Pvcs*</exclude>
- <!-- xalan: workaround for diferent resource encoding -->
+ <!-- xalan: workaround for different resource encoding -->
<exclude>org/apache/tools/ant/taskdefs/optional/TraXLiaison*</exclude>
<!-- ERROR: UnknownHostException: chemical -->
<exclude>org/apache/tools/ant/taskdefs/optional/XmlValidateCatalog*</exclude>
diff --git a/src/etc/testcases/taskdefs/optional/replaceregexp.xml b/src/etc/testcases/taskdefs/optional/replaceregexp.xml
index 58fdc59cd..71d0b3221 100644
--- a/src/etc/testcases/taskdefs/optional/replaceregexp.xml
+++ b/src/etc/testcases/taskdefs/optional/replaceregexp.xml
@@ -18,11 +18,9 @@
<project name="test" default="def" basedir=".">
<import file="../../buildfiletest-base.xml"/>
- <property name="root" location="../../../../.."/>
-
<target name="setUp">
- <mkdir dir="${output}" />
- <copy file="replaceregexp.properties" tofile="${output}/test.properties" />
+ <mkdir dir="${output}"/>
+ <copy file="replaceregexp.properties" tofile="${output}/test.properties"/>
</target>
<target name="def">
@@ -30,39 +28,39 @@
</target>
<target name="setUp-nl">
- <mkdir dir="${output}" />
- <copy file="replaceregexp2.properties" tofile="${output}/test.properties" />
+ <mkdir dir="${output}"/>
+ <copy file="replaceregexp2.properties" tofile="${output}/test.properties"/>
</target>
<target name="testReplace" depends="setUp">
<replaceregexp file="${output}/test.properties" byline="true">
- <regexp pattern="Old(.*)=(.*)" />
- <substitution expression="NewProp=\1\2" />
+ <regexp pattern="Old(.*)=(.*)"/>
+ <substitution expression="NewProp=\1\2"/>
</replaceregexp>
</target>
<!-- use in conjunction with testDirectoryDateDoesNotChange to make sure something will happen -->
<target name="touchDirectory">
- <copy file="replaceregexp.properties" tofile="${output}/test.properties" />
+ <copy file="replaceregexp.properties" tofile="${output}/test.properties"/>
</target>
<target name="testDirectoryDateDoesNotChange">
<replaceregexp file="${output}/test.properties" byline="true">
- <regexp pattern="foo" />
+ <regexp pattern="foo"/>
<substitution expression="bar"/>
</replaceregexp>
</target>
<target name="testDontAddNewline1" depends="setUp-nl">
<replaceregexp file="${output}/test.properties" byline="false">
- <regexp pattern="Old(.*)=(.*)" />
- <substitution expression="NewProp=\1\2" />
+ <regexp pattern="Old(.*)=(.*)"/>
+ <substitution expression="NewProp=\1\2"/>
</replaceregexp>
</target>
<target name="testDontAddNewline2" depends="setUp-nl">
<replaceregexp file="${output}/test.properties" byline="true">
- <regexp pattern="Old(.*)=(.*)" />
- <substitution expression="NewProp=\1\2" />
+ <regexp pattern="Old(.*)=(.*)"/>
+ <substitution expression="NewProp=\1\2"/>
</replaceregexp>
</target>
diff --git a/src/etc/testcases/taskdefs/optional/script.xml b/src/etc/testcases/taskdefs/optional/script.xml
index c098289bc..2eaba27f4 100644
--- a/src/etc/testcases/taskdefs/optional/script.xml
+++ b/src/etc/testcases/taskdefs/optional/script.xml
@@ -19,24 +19,20 @@
<import file="../../buildfiletest-base.xml"/>
- <property name="root" location="../../../../.."/>
-
<target name="def">
<fail>This build-file is intended to be run from the test cases</fail>
</target>
<target name="setup1">
-
- <script language="javascript"> <![CDATA[
-
+ <script language="javascript">
+ <![CDATA[
for (i=1; i<=10; i++) {
echo = testproject.createTask("echo");
setup1.addTask(echo);
echo.setMessage(i*i);
}
-
- ]]> </script>
-
+ ]]>
+ </script>
</target>
<target name="example1" depends="setup1"/>
@@ -48,21 +44,21 @@
</target>
<target name="useSrcAndEncoding">
- <mkdir dir="${output}" />
+ <mkdir dir="${output}"/>
<property name="useSrcAndEncoding.encoding" value="UTF-8"/>
<property name="useSrcAndEncoding.reader.encoding" value="${useSrcAndEncoding.encoding}"
- description="Set a different encoding to raise a failure (ex. ISO-8859-1)" />
+ description="Set a different encoding to raise a failure (ex. ISO-8859-1)"/>
<property name="useSrcAndEncoding.file" location="${output}/script.useSrcAndEncoding.js"/>
- <property name="useSrcAndEncoding.expectedProp" value="eacute [&#233;]" />
+ <property name="useSrcAndEncoding.expectedProp" value="eacute [&#233;]"/>
<echo file="${useSrcAndEncoding.file}" encoding="${useSrcAndEncoding.encoding}"
- message="project.setNewProperty('useSrcAndEncoding.prop', '${useSrcAndEncoding.expectedProp}');"/>
+ message="project.setNewProperty('useSrcAndEncoding.prop', '${useSrcAndEncoding.expectedProp}');"/>
<script language="javascript" src="${useSrcAndEncoding.file}" encoding="${useSrcAndEncoding.reader.encoding}"/>
<condition property="useSrcAndEncoding.testOK" >
- <equals arg1="${useSrcAndEncoding.expectedProp}" arg2="${useSrcAndEncoding.prop}" />
+ <equals arg1="${useSrcAndEncoding.expectedProp}" arg2="${useSrcAndEncoding.prop}"/>
</condition>
- <fail message="expected &lt;${useSrcAndEncoding.expectedProp}&gt; but was &lt;${useSrcAndEncoding.prop}&gt;" unless="useSrcAndEncoding.testOK" />
+ <fail message="expected &lt;${useSrcAndEncoding.expectedProp}&gt; but was &lt;${useSrcAndEncoding.prop}&gt;" unless="useSrcAndEncoding.testOK"/>
</target>
</project> \ No newline at end of file
diff --git a/src/etc/testcases/taskdefs/optional/script/scriptdef.xml b/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
index 3b54e3e48..f0a72cd77 100644
--- a/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
+++ b/src/etc/testcases/taskdefs/optional/script/scriptdef.xml
@@ -19,8 +19,6 @@
<import file="../../../buildfiletest-base.xml"/>
- <property name="root" location="../../../../../.."/>
-
<target name="def">
<fail>This build-file is intended to be run from the test cases</fail>
</target>
@@ -30,11 +28,9 @@
<attribute name="attr1"/>
<element name="fileset" type="fileset"/>
<![CDATA[
-
project.log("Attribute attr1 = " + attributes.get("attr1"));
project.log("Fileset basedir = "
+ elements.get("fileset").get(0).getDir(project));
-
]]>
</scriptdef>
@@ -65,11 +61,9 @@
<attribute name="attr1"/>
<element name="fileset" classname="org.apache.tools.ant.types.FileSet"/>
<![CDATA[
-
project.log("Attribute attr1 = " + attributes.get("attr1"));
project.log("Fileset basedir = "
+ elements.get("fileset").get(0).getDir(project));
-
]]>
</scriptdef>
@@ -97,11 +91,9 @@
<attribute name="attr1"/>
<element name="fileset" classname="org.apache.tools.ant.types.FileSet"/>
<![CDATA[
-
java.lang.System.out.println("Attribute attr1 = " + attributes.get("attr1"));
java.lang.System.out.println("Fileset basedir = "
+ elements.get("fileset").get(0).getDir(project));
-
]]>
</scriptdef>
@@ -135,7 +127,6 @@
<scriptdef name="scripttest" language="javascript">
<attribute name="attr1"/>
<![CDATA[
-
project.log("Attribute value = " + attributes.get("attr1"));
]]>
</scriptdef>
@@ -152,78 +143,74 @@
</target>
<target name="useSrcAndEncoding">
- <mkdir dir="${output}" />
+ <mkdir dir="${output}"/>
<property name="useSrcAndEncoding.encoding" value="UTF-8"/>
<property name="useSrcAndEncoding.reader.encoding" value="${useSrcAndEncoding.encoding}"
- description="Set a different encoding to raise a failure (ex. ISO-8859-1)" />
+ description="Set a different encoding to raise a failure (ex. ISO-8859-1)"/>
<property name="useSrcAndEncoding.file" location="${output}/script.useSrcAndEncoding.js"/>
- <property name="useSrcAndEncoding.expectedProp" value="eacute [&#233;]" />
+ <property name="useSrcAndEncoding.expectedProp" value="eacute [&#233;]"/>
<echo file="${useSrcAndEncoding.file}" encoding="${useSrcAndEncoding.encoding}"
- message="project.setNewProperty('useSrcAndEncoding.prop', '${useSrcAndEncoding.expectedProp}');"/>
+ message="project.setNewProperty('useSrcAndEncoding.prop', '${useSrcAndEncoding.expectedProp}');"/>
<scriptdef name="useSrcAndEncoding" language="javascript" src="${useSrcAndEncoding.file}" encoding="${useSrcAndEncoding.reader.encoding}"/>
<useSrcAndEncoding/>
<condition property="useSrcAndEncoding.testOK" >
- <equals arg1="${useSrcAndEncoding.expectedProp}" arg2="${useSrcAndEncoding.prop}" />
+ <equals arg1="${useSrcAndEncoding.expectedProp}" arg2="${useSrcAndEncoding.prop}"/>
</condition>
- <fail message="expected &lt;${useSrcAndEncoding.expectedProp}&gt; but was &lt;${useSrcAndEncoding.prop}&gt;" unless="useSrcAndEncoding.testOK" />
+ <fail message="expected &lt;${useSrcAndEncoding.expectedProp}&gt; but was &lt;${useSrcAndEncoding.prop}&gt;" unless="useSrcAndEncoding.testOK"/>
</target>
<target name="useCompiled">
-
<!-- Test with 'javax' manager, 'bsf' manager already compiles the script. -->
- <scriptdef manager="javax" name="heavyscript" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="true" />
-
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
- <heavyscript />
-
+ <scriptdef manager="javax" name="heavyscript" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="true"/>
+
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
+ <heavyscript/>
</target>
<target name="useNotCompiled">
-
- <scriptdef manager="javax" name="heavyscriptNotCompiled" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="false" />
-
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
- <heavyscriptNotCompiled />
-
+ <scriptdef manager="javax" name="heavyscriptNotCompiled" language="javascript" src="heavy-script.js" encoding="UTF-8" compiled="false"/>
+
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
+ <heavyscriptNotCompiled/>
</target>
</project>
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/InitializeClassTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/InitializeClassTest.java
index 6b6d14f8b..c1bd3f66f 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/InitializeClassTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/InitializeClassTest.java
@@ -31,6 +31,7 @@ import org.junit.Rule;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
/**
* Test to see if static initializers are invoked the same way
@@ -47,6 +48,7 @@ public class InitializeClassTest {
@Before
public void setUp() {
+ assertNotNull("build.tests.value not set", System.getProperty("build.tests.value"));
buildRule.configureProject("src/etc/testcases/taskdefs/initializeclass.xml");
f1 = buildRule.getProject().resolveFile("forkedout");
f2 = buildRule.getProject().resolveFile("unforkedout");
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/XmlnsTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/XmlnsTest.java
index 4f3f65d1f..667eb6450 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/XmlnsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/XmlnsTest.java
@@ -19,6 +19,7 @@
package org.apache.tools.ant.taskdefs;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildFileRule;
@@ -39,6 +40,7 @@ public class XmlnsTest {
@Before
public void setUp() {
+ assertNotNull("build.tests.value not set", System.getProperty("build.tests.value"));
buildRule.configureProject("src/etc/testcases/taskdefs/xmlns.xml");
}
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java
index 66b556066..6d65fa5c1 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTest.java
@@ -24,6 +24,7 @@ import org.junit.Rule;
import org.junit.Test;
import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
/**
@@ -37,6 +38,7 @@ public class JDependTest {
@Before
public void setUp() {
+ assertNotNull("build.tests.value not set", System.getProperty("build.tests.value"));
buildRule.configureProject("src/etc/testcases/taskdefs/optional/jdepend/jdepend.xml");
}