(no checks of build.tests.value necessary)master
@@ -106,6 +106,38 @@ | |||||
</tasks> | </tasks> | ||||
</configuration> | </configuration> | ||||
</execution> | </execution> | ||||
<execution> | |||||
<id>create-antlib-test-jar</id> | |||||
<phase>process-test-classes</phase> | |||||
<goals> | |||||
<goal>run</goal> | |||||
</goals> | |||||
<configuration> | |||||
<tasks> | |||||
<jar jarfile="${project.build.testOutputDirectory}/org/apache/tools/ant/taskdefs/test2-antlib.jar"> | |||||
<manifest> | |||||
<attribute name="Extension-name" | |||||
value="org.apache.tools.ant"/> | |||||
<attribute name="Specification-Title" | |||||
value="Apache Ant"/> | |||||
<attribute name="Specification-Version" | |||||
value="${project.version}"/> | |||||
<attribute name="Specification-Vendor" | |||||
value="Apache Software Foundation"/> | |||||
<attribute name="Implementation-Title" | |||||
value="org.apache.tools.ant"/> | |||||
<attribute name="Implementation-Version" | |||||
value="${project.version}"/> | |||||
<attribute name="Implementation-Vendor" | |||||
value="Apache Software Foundation"/> | |||||
</manifest> | |||||
<zipfileset dir="${project.build.scriptSourceDirectory}/testcases" fullpath="taskdefs/test.antlib.xml"> | |||||
<include name="taskdefs/test2.antlib.xml"/> | |||||
</zipfileset> | |||||
</jar> | |||||
</tasks> | |||||
</configuration> | |||||
</execution> | |||||
<execution> | <execution> | ||||
<id>delete-timestamp-file</id> | <id>delete-timestamp-file</id> | ||||
<phase>clean</phase> | <phase>clean</phase> | ||||
@@ -317,6 +349,7 @@ | |||||
</testResources> | </testResources> | ||||
<sourceDirectory>../../../../src/main</sourceDirectory> | <sourceDirectory>../../../../src/main</sourceDirectory> | ||||
<testSourceDirectory>../../../../src/tests/junit</testSourceDirectory> | <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory> | ||||
<scriptSourceDirectory>../../../../src/etc</scriptSourceDirectory> | |||||
<!-- directory name is hardcoded in AntTest --> | <!-- directory name is hardcoded in AntTest --> | ||||
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory> | <outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory> | ||||
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory> | <testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory> | ||||
@@ -19,7 +19,6 @@ | |||||
<project name="dispatch-test" default="disp"> | <project name="dispatch-test" default="disp"> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="${build.tests.value}"/> | |||||
<pathelement path="${java.class.path}"/> | <pathelement path="${java.class.path}"/> | ||||
</path> | </path> | ||||
@@ -36,12 +36,9 @@ | |||||
</target> | </target> | ||||
<target name="define"> | <target name="define"> | ||||
<property name="testclasses" | |||||
location="../../../../build/testcases" /> | |||||
<taskdef name="echoloc" | <taskdef name="echoloc" | ||||
classname="org.apache.tools.ant.LocationTest$EchoLocation"> | |||||
classname="org.apache.tools.ant.LocationTest$EchoLocation"> | |||||
<classpath> | <classpath> | ||||
<pathelement location="${testclasses}" /> | |||||
<pathelement path="${java.class.path}"/> | <pathelement path="${java.class.path}"/> | ||||
</classpath> | </classpath> | ||||
</taskdef> | </taskdef> | ||||
@@ -70,5 +67,4 @@ | |||||
<echo id="echo4">Hello</echo> | <echo id="echo4">Hello</echo> | ||||
<echoloc3/> | <echoloc3/> | ||||
</target> | </target> | ||||
</project> | |||||
</project> |
@@ -21,7 +21,6 @@ | |||||
classname="org.apache.tools.ant.UnknownElementTest$Parent" | classname="org.apache.tools.ant.UnknownElementTest$Parent" | ||||
loaderref="unknown.id"> | loaderref="unknown.id"> | ||||
<classpath> | <classpath> | ||||
<pathelement location="../../../../build/testcases"/> | |||||
<pathelement path="${java.class.path}"/> | <pathelement path="${java.class.path}"/> | ||||
</classpath> | </classpath> | ||||
</taskdef> | </taskdef> | ||||
@@ -33,6 +32,7 @@ | |||||
<child/> | <child/> | ||||
</parent> | </parent> | ||||
</target> | </target> | ||||
<target name="echo"> | <target name="echo"> | ||||
<echo message="Hello, world!"/> | <echo message="Hello, world!"/> | ||||
</target> | </target> | ||||
@@ -20,17 +20,15 @@ | |||||
<import file="../buildfiletest-base.xml"/> | <import file="../buildfiletest-base.xml"/> | ||||
<target name="setUp"> | <target name="setUp"> | ||||
<mkdir dir="${output}" /> | |||||
<mkdir dir="${output}"/> | |||||
</target> | </target> | ||||
<target name="dynamicfilter"> | <target name="dynamicfilter"> | ||||
<path id="test-classes"> | <path id="test-classes"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<typedef | |||||
name="customfilter" | |||||
classname="org.apache.tools.ant.filters.DynamicFilterTest$CustomFilter"> | |||||
<typedef name="customfilter" | |||||
classname="org.apache.tools.ant.filters.DynamicFilterTest$CustomFilter"> | |||||
<classpath refid="test-classes"/> | <classpath refid="test-classes"/> | ||||
</typedef> | </typedef> | ||||
@@ -20,7 +20,7 @@ | |||||
<import file="../buildfiletest-base.xml"/> | <import file="../buildfiletest-base.xml"/> | ||||
<target name="setUp"> | <target name="setUp"> | ||||
<mkdir dir="${output}" /> | |||||
<mkdir dir="${output}"/> | |||||
</target> | </target> | ||||
<target name="tokenfilter"> | <target name="tokenfilter"> | ||||
@@ -314,14 +314,11 @@ | |||||
<target name="customtokenfilter"> | <target name="customtokenfilter"> | ||||
<path id="test-classes"> | <path id="test-classes"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<typedef | |||||
name="capitalize" | |||||
classname="org.apache.tools.ant.filters.TokenFilterTest$Capitalize"> | |||||
<typedef name="capitalize" | |||||
classname="org.apache.tools.ant.filters.TokenFilterTest$Capitalize"> | |||||
<classpath refid="test-classes"/> | <classpath refid="test-classes"/> | ||||
</typedef> | </typedef> | ||||
@@ -17,11 +17,8 @@ | |||||
--> | --> | ||||
<project name="test"> | <project name="test"> | ||||
<property name="testcases.dir" location="../../../../build/testcases"/> | |||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="${testcases.dir}" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="antlib.file"> | <target name="antlib.file"> | ||||
@@ -32,14 +29,14 @@ | |||||
<target name="antlib.resource"> | <target name="antlib.resource"> | ||||
<typedef resource="taskdefs/test.antlib.xml"> | <typedef resource="taskdefs/test.antlib.xml"> | ||||
<classpath> | |||||
<!-- To load the task classes: --> | |||||
<path refid="testclasses"/> | |||||
<!-- For test.antlib.xml: --> | |||||
<pathelement location=".."/> | |||||
<!-- For test2.antlib.xml: --> | |||||
<pathelement location="${testcases.dir}/org/apache/tools/ant/taskdefs/test2-antlib.jar"/> | |||||
</classpath> | |||||
<classpath> | |||||
<!-- To load the task classes: --> | |||||
<path refid="testclasses"/> | |||||
<!-- For test.antlib.xml: --> | |||||
<pathelement location=".."/> | |||||
<!-- For test2.antlib.xml: --> | |||||
<pathelement location="${build.tests.value}/org/apache/tools/ant/taskdefs/test2-antlib.jar"/> | |||||
</classpath> | |||||
</typedef> | </typedef> | ||||
<mytask/> | <mytask/> | ||||
<echo>-and-then-</echo> | <echo>-and-then-</echo> | ||||
@@ -59,7 +56,7 @@ | |||||
<target name="antlib_uri_auto" xmlns:ex="antlib:org.example.tasks"> | <target name="antlib_uri_auto" xmlns:ex="antlib:org.example.tasks"> | ||||
<ex:simple> | <ex:simple> | ||||
<echo message="inside simple" /> | |||||
<echo message="inside simple"/> | |||||
</ex:simple> | </ex:simple> | ||||
</target> | </target> | ||||
@@ -69,4 +66,4 @@ | |||||
</ex:simple> | </ex:simple> | ||||
</target> | </target> | ||||
</project> | |||||
</project> |
@@ -19,14 +19,13 @@ | |||||
<project name="dynamic-test" default="simple"> | <project name="dynamic-test" default="simple"> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="simple"> | <target name="simple"> | ||||
<taskdef name="dyna" | <taskdef name="dyna" | ||||
classname="org.apache.tools.ant.taskdefs.DynamicTask"> | classname="org.apache.tools.ant.taskdefs.DynamicTask"> | ||||
<classpath refid="testclasses" /> | |||||
<classpath refid="testclasses"/> | |||||
</taskdef> | </taskdef> | ||||
<dyna prop1="1" prop2="2"> | <dyna prop1="1" prop2="2"> | ||||
<sub prop3="3"/> | <sub prop3="3"/> | ||||
@@ -20,8 +20,7 @@ | |||||
<import file="../buildfiletest-base.xml"/> | <import file="../buildfiletest-base.xml"/> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<mapper id="testmapper" | <mapper id="testmapper" | ||||
@@ -188,5 +187,4 @@ | |||||
<fail unless="movewithempty.outcome">movewithempty failed</fail> | <fail unless="movewithempty.outcome">movewithempty failed</fail> | ||||
</target> | </target> | ||||
</project> | </project> |
@@ -17,8 +17,7 @@ | |||||
--> | --> | ||||
<project> | <project> | ||||
<path id="test-classes"> | <path id="test-classes"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="simple"> | <target name="simple"> | ||||
@@ -119,7 +118,7 @@ | |||||
<target name="correct_taskname_badattr"> | <target name="correct_taskname_badattr"> | ||||
<presetdef name="mytask"> | <presetdef name="mytask"> | ||||
<javac srcdir="whatever"/> | |||||
<javac srcdir="whatever"/> | |||||
</presetdef> | </presetdef> | ||||
<javac srcdir="whatever" badattr="whatever"/> | <javac srcdir="whatever" badattr="whatever"/> | ||||
@@ -127,7 +126,7 @@ | |||||
<target name="correct_taskname_badel"> | <target name="correct_taskname_badel"> | ||||
<presetdef name="mytask"> | <presetdef name="mytask"> | ||||
<javac srcdir="whatever"/> | |||||
<javac srcdir="whatever"/> | |||||
</presetdef> | </presetdef> | ||||
<javac srcdir="whatever"> | <javac srcdir="whatever"> | ||||
@@ -135,13 +134,12 @@ | |||||
</javac> | </javac> | ||||
</target> | </target> | ||||
<target name="presetdef-with-nested-element-twice"> | |||||
<copy todir="."> | |||||
<fileset dir="." includes="nonexistent"/> | |||||
</copy> | |||||
<presetdef name="copy"> | |||||
<copy verbose="true"/> | |||||
</presetdef> | |||||
</target> | |||||
<target name="presetdef-with-nested-element-twice"> | |||||
<copy todir="."> | |||||
<fileset dir="." includes="nonexistent"/> | |||||
</copy> | |||||
<presetdef name="copy"> | |||||
<copy verbose="true"/> | |||||
</presetdef> | |||||
</target> | |||||
</project> | </project> |
@@ -19,13 +19,11 @@ | |||||
<project name="xxx-test" basedir="." default="test1"> | <project name="xxx-test" basedir="." default="test1"> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<taskdef name="global" | |||||
classname="org.example.tasks.TaskdefTestContainerTask"> | |||||
<classpath refid="testclasses" /> | |||||
<taskdef name="global" classname="org.example.tasks.TaskdefTestContainerTask"> | |||||
<classpath refid="testclasses"/> | |||||
</taskdef> | </taskdef> | ||||
<target name="test1"> | <target name="test1"> | ||||
@@ -45,41 +43,39 @@ | |||||
</target> | </target> | ||||
<target name="test5"> | <target name="test5"> | ||||
<taskdef name="test" classname="org.apache.tools.ant.Project" /> | |||||
<taskdef name="test" classname="org.apache.tools.ant.Project"/> | |||||
</target> | </target> | ||||
<target name="test5a"> | <target name="test5a"> | ||||
<taskdef name="test" classname="org.apache.tools.ant.taskdefs.Copy" /> | |||||
<taskdef name="test" classname="org.apache.tools.ant.taskdefs.Copy"/> | |||||
</target> | </target> | ||||
<target name="test6"> | <target name="test6"> | ||||
<taskdef name="test6" | |||||
classname="org.example.tasks.TaskdefTestSimpleTask"> | |||||
<classpath refid="testclasses" /> | |||||
<taskdef name="test6" classname="org.example.tasks.TaskdefTestSimpleTask"> | |||||
<classpath refid="testclasses"/> | |||||
</taskdef> | </taskdef> | ||||
<test6> | <test6> | ||||
<echo message="worked" /> | |||||
<echo message="worked"/> | |||||
</test6> | </test6> | ||||
</target> | </target> | ||||
<target name="test7"> | <target name="test7"> | ||||
<taskdef name="test7" | |||||
classname="org.example.tasks.TaskdefTestContainerTask"> | |||||
<classpath refid="testclasses" /> | |||||
<taskdef name="test7" classname="org.example.tasks.TaskdefTestContainerTask"> | |||||
<classpath refid="testclasses"/> | |||||
</taskdef> | </taskdef> | ||||
<test7> | <test7> | ||||
<echo message="worked" /> | |||||
<echo message="worked"/> | |||||
</test7> | </test7> | ||||
</target> | </target> | ||||
<target name="testGlobal"> | <target name="testGlobal"> | ||||
<global> | <global> | ||||
<echo message="worked" /> | |||||
<echo message="worked"/> | |||||
</global> | </global> | ||||
</target> | </target> | ||||
<target name="testOverride"> | <target name="testOverride"> | ||||
<taskdef name="copy" classname="org.apache.tools.ant.taskdefs.Echo" /> | |||||
<taskdef name="copy" classname="org.apache.tools.ant.taskdefs.Echo"/> | |||||
<copy>In target</copy> | <copy>In target</copy> | ||||
<sequential> | <sequential> | ||||
<copy>In TaskContainer</copy> | <copy>In TaskContainer</copy> | ||||
@@ -17,10 +17,8 @@ | |||||
--> | --> | ||||
<project name="test" basedir="." default="invalid"> | <project name="test" basedir="." default="invalid"> | ||||
<property name="testcases.dir" location="../../../../build/testcases"/> | |||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="${testcases.dir}" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="taskadapter"> | <target name="taskadapter"> | ||||
@@ -74,6 +72,5 @@ | |||||
onerror="ignore"/> | onerror="ignore"/> | ||||
</target> | </target> | ||||
</project> | </project> | ||||
@@ -23,16 +23,16 @@ | |||||
</target> | </target> | ||||
<target name="empty"> | <target name="empty"> | ||||
<typedef /> | |||||
<typedef/> | |||||
</target> | </target> | ||||
<target name="noClassname"> | <target name="noClassname"> | ||||
<typedef name="dummy" /> | |||||
<typedef name="dummy"/> | |||||
</target> | </target> | ||||
<target name="noName"> | <target name="noName"> | ||||
<typedef classname="org.example.types.TypedefTestType"> | <typedef classname="org.example.types.TypedefTestType"> | ||||
<classpath refid="testclasses" /> | |||||
<classpath refid="testclasses"/> | |||||
</typedef> | </typedef> | ||||
</target> | </target> | ||||
@@ -41,25 +41,24 @@ | |||||
</target> | </target> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<typedef name="global" | <typedef name="global" | ||||
classname="org.example.types.TypedefTestType"> | classname="org.example.types.TypedefTestType"> | ||||
<classpath refid="testclasses" /> | |||||
<classpath refid="testclasses"/> | |||||
</typedef> | </typedef> | ||||
<target name="testGlobal"> | <target name="testGlobal"> | ||||
<global id="global" /> | |||||
<global id="global"/> | |||||
</target> | </target> | ||||
<target name="testLocal"> | <target name="testLocal"> | ||||
<typedef name="localtype" | <typedef name="localtype" | ||||
classname="org.example.types.TypedefTestType"> | classname="org.example.types.TypedefTestType"> | ||||
<classpath refid="testclasses" /> | |||||
<classpath refid="testclasses"/> | |||||
</typedef> | </typedef> | ||||
<localtype id="local" /> | |||||
<localtype id="local"/> | |||||
</target> | </target> | ||||
<target name="double-notpresent"> | <target name="double-notpresent"> | ||||
@@ -79,6 +78,7 @@ | |||||
</target> | </target> | ||||
<target name="noresourcenotfail"> | <target name="noresourcenotfail"> | ||||
<typedef resource="somenotpresentfile.properties" /> | |||||
<typedef resource="somenotpresentfile.properties"/> | |||||
</target> | </target> | ||||
</project> | </project> |
@@ -17,10 +17,8 @@ | |||||
--> | --> | ||||
<project name="test" xmlns:other="this is the other uri" | <project name="test" xmlns:other="this is the other uri" | ||||
other:attr="this should be ignored by ant"> | other:attr="this should be ignored by ant"> | ||||
<property name="testcases.dir" location="${build.tests.value}"/> | |||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="${testcases.dir}"/> | |||||
<pathelement path="${java.class.path}"/> | <pathelement path="${java.class.path}"/> | ||||
</path> | </path> | ||||
@@ -57,38 +57,37 @@ | |||||
<target name="init"> | <target name="init"> | ||||
<property name="nested.package" value="org.apache.tools.ant.types."/> | <property name="nested.package" value="org.apache.tools.ant.types."/> | ||||
<path id="test-classes"> | <path id="test-classes"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<typedef loaderref="nested.loader" classpathref="test-classes" | <typedef loaderref="nested.loader" classpathref="test-classes" | ||||
name = "nested.a" | |||||
name="nested.a" | |||||
classname="${nested.package}AddTypeTest$AImpl"/> | classname="${nested.package}AddTypeTest$AImpl"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "nested.b" | |||||
name="nested.b" | |||||
classname="${nested.package}AddTypeTest$BImpl"/> | classname="${nested.package}AddTypeTest$BImpl"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "nested.c" | |||||
name="nested.c" | |||||
classname="${nested.package}AddTypeTest$CImpl"/> | classname="${nested.package}AddTypeTest$CImpl"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "nested.ab" | |||||
name="nested.ab" | |||||
classname="${nested.package}AddTypeTest$ABImpl"/> | classname="${nested.package}AddTypeTest$ABImpl"/> | ||||
<taskdef loaderref="nested.loader" | <taskdef loaderref="nested.loader" | ||||
name = "nested.container" | |||||
name="nested.container" | |||||
classname="${nested.package}AddTypeTest$NestedContainer"/> | classname="${nested.package}AddTypeTest$NestedContainer"/> | ||||
<taskdef loaderref="nested.loader" | <taskdef loaderref="nested.loader" | ||||
name = "nested.condition.task" | |||||
name="nested.condition.task" | |||||
classname="${nested.package}AddTypeTest$MyCondition"/> | classname="${nested.package}AddTypeTest$MyCondition"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "nested.condition.type" | |||||
name="nested.condition.type" | |||||
classname="${nested.package}AddTypeTest$MyCondition"/> | classname="${nested.package}AddTypeTest$MyCondition"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "myaddconfigured" | |||||
name="myaddconfigured" | |||||
classname="${nested.package}AddTypeTest$MyAddConfigured"/> | classname="${nested.package}AddTypeTest$MyAddConfigured"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "myaddconfiguredvalue" | |||||
name="myaddconfiguredvalue" | |||||
classname="${nested.package}AddTypeTest$MyAddConfiguredValue"/> | classname="${nested.package}AddTypeTest$MyAddConfiguredValue"/> | ||||
<typedef loaderref="nested.loader" | <typedef loaderref="nested.loader" | ||||
name = "myvalue" | |||||
name="myvalue" | |||||
classname="${nested.package}AddTypeTest$MyValue"/> | classname="${nested.package}AddTypeTest$MyValue"/> | ||||
</target> | </target> | ||||
@@ -160,4 +159,5 @@ | |||||
<prefix:eq arg1="a" arg2="b"/> | <prefix:eq arg1="a" arg2="b"/> | ||||
</condition> | </condition> | ||||
</target> | </target> | ||||
</project> | </project> |
@@ -18,15 +18,13 @@ | |||||
<project name="test" default="test" basedir="."> | <project name="test" default="test" basedir="."> | ||||
<path id="testclasses"> | <path id="testclasses"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="test"> | <target name="test"> | ||||
<taskdef name="flexint" | <taskdef name="flexint" | ||||
classname="org.apache.tools.ant.types.FlexIntegerTest" | classname="org.apache.tools.ant.types.FlexIntegerTest" | ||||
classpathref="testclasses" | |||||
/> | |||||
classpathref="testclasses"/> | |||||
<flexint propname="flexint.value1" value="0xA"/> | <flexint propname="flexint.value1" value="0xA"/> | ||||
<flexint propname="flexint.value2" value="010"/> | <flexint propname="flexint.value2" value="010"/> | ||||
@@ -17,7 +17,7 @@ | |||||
--> | --> | ||||
<project> | <project> | ||||
<typedef name="mapperresult" | <typedef name="mapperresult" | ||||
classpath="../../../../../build/testcases" | |||||
classpath="${build.tests.value}" | |||||
classname="org.apache.tools.ant.types.mappers.MapperResult"/> | classname="org.apache.tools.ant.types.mappers.MapperResult"/> | ||||
<!-- this is what you get with no result --> | <!-- this is what you get with no result --> | ||||
@@ -20,19 +20,18 @@ | |||||
<property name="c" value="org.apache.tools.ant.types.PolyTest"/> | <property name="c" value="org.apache.tools.ant.types.PolyTest"/> | ||||
<path id="test-c"> | <path id="test-c"> | ||||
<pathelement location="../../../../build/testcases" /> | |||||
<pathelement path="${java.class.path}" /> | |||||
<pathelement path="${java.class.path}"/> | |||||
</path> | </path> | ||||
<target name="init"> | <target name="init"> | ||||
<typedef loaderref="poly" classpathref="test-c" | |||||
name = "myfileset" classname="${c}$MyFileSet"/> | |||||
<typedef loaderref="poly" classpathref="test-c" | |||||
name="myfileset" classname="${c}$MyFileSet"/> | |||||
<typedef loaderref="poly" classpathref="test-c" | <typedef loaderref="poly" classpathref="test-c" | ||||
name = "mypath" classname="${c}$MyPath"/> | |||||
name="mypath" classname="${c}$MyPath"/> | |||||
<typedef loaderref="poly" classpathref="test-c" | <typedef loaderref="poly" classpathref="test-c" | ||||
name = "mytask" classname="${c}$MyTask"/> | |||||
name="mytask" classname="${c}$MyTask"/> | |||||
</target> | </target> | ||||
<target name="fileset" depends="init"> | <target name="fileset" depends="init"> | ||||
@@ -23,8 +23,6 @@ import org.junit.Rule; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.junit.rules.ExpectedException; | import org.junit.rules.ExpectedException; | ||||
import static org.junit.Assert.assertNotNull; | |||||
public class DispatchTaskTest { | public class DispatchTaskTest { | ||||
@Rule | @Rule | ||||
@@ -35,7 +33,6 @@ public class DispatchTaskTest { | |||||
@Before | @Before | ||||
public void setUp() { | public void setUp() { | ||||
assertNotNull("build.tests.value not set", System.getProperty("build.tests.value")); | |||||
buildRule.configureProject("src/etc/testcases/core/dispatch/dispatch.xml"); | buildRule.configureProject("src/etc/testcases/core/dispatch/dispatch.xml"); | ||||
} | } | ||||
@@ -54,40 +54,40 @@ public class UnknownElementTest { | |||||
*/ | */ | ||||
@Test | @Test | ||||
@Ignore("Previously disabled through naming convention") | @Ignore("Previously disabled through naming convention") | ||||
public void XtestTaskFinishedEvent() { | |||||
public void testTaskFinishedEvent() { | |||||
buildRule.getProject().addBuildListener(new BuildListener() { | buildRule.getProject().addBuildListener(new BuildListener() { | ||||
public void buildStarted(BuildEvent event) { | |||||
} | |||||
public void buildFinished(BuildEvent event) { | |||||
} | |||||
public void targetStarted(BuildEvent event) { | |||||
} | |||||
public void targetFinished(BuildEvent event) { | |||||
} | |||||
public void taskStarted(BuildEvent event) { | |||||
assertTaskProperties(event.getTask()); | |||||
} | |||||
public void taskFinished(BuildEvent event) { | |||||
assertTaskProperties(event.getTask()); | |||||
} | |||||
public void messageLogged(BuildEvent event) { | |||||
} | |||||
private void assertTaskProperties(Task ue) { | |||||
assertNotNull(ue); | |||||
assertThat(ue, instanceOf(UnknownElement.class)); | |||||
Task t = ((UnknownElement) ue).getTask(); | |||||
assertNotNull(t); | |||||
assertEquals("org.apache.tools.ant.taskdefs.Echo", | |||||
t.getClass().getName()); | |||||
} | |||||
}); | |||||
public void buildStarted(BuildEvent event) { | |||||
} | |||||
public void buildFinished(BuildEvent event) { | |||||
} | |||||
public void targetStarted(BuildEvent event) { | |||||
} | |||||
public void targetFinished(BuildEvent event) { | |||||
} | |||||
public void taskStarted(BuildEvent event) { | |||||
assertTaskProperties(event.getTask()); | |||||
} | |||||
public void taskFinished(BuildEvent event) { | |||||
assertTaskProperties(event.getTask()); | |||||
} | |||||
public void messageLogged(BuildEvent event) { | |||||
} | |||||
private void assertTaskProperties(Task ue) { | |||||
assertNotNull(ue); | |||||
assertThat(ue, instanceOf(UnknownElement.class)); | |||||
Task t = ((UnknownElement) ue).getTask(); | |||||
assertNotNull(t); | |||||
assertEquals("org.apache.tools.ant.taskdefs.Echo", | |||||
t.getClass().getName()); | |||||
} | |||||
}); | |||||
buildRule.executeTarget("echo"); | buildRule.executeTarget("echo"); | ||||
} | } | ||||
@@ -26,6 +26,7 @@ import org.junit.Rule; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import static org.junit.Assert.assertNotNull; | |||||
import static org.junit.Assume.assumeTrue; | import static org.junit.Assume.assumeTrue; | ||||
/** | /** | ||||
@@ -62,6 +63,7 @@ public class AntlibTest { | |||||
*/ | */ | ||||
@Test | @Test | ||||
public void testAntlibResource() { | public void testAntlibResource() { | ||||
assertNotNull("build.tests.value not set", System.getProperty("build.tests.value")); | |||||
buildRule.executeTarget("antlib.resource"); | buildRule.executeTarget("antlib.resource"); | ||||
assertEquals("MyTask called-and-then-MyTask2 called", buildRule.getLog()); | assertEquals("MyTask called-and-then-MyTask2 called", buildRule.getLog()); | ||||
} | } | ||||
@@ -51,10 +51,11 @@ public class TypedefTest { | |||||
// TODO assert value | // TODO assert value | ||||
} | } | ||||
@Test(expected = BuildException.class) | |||||
@Test | |||||
public void testNoName() { | public void testNoName() { | ||||
thrown.expect(BuildException.class); | |||||
thrown.expectMessage("Only antlib URIs can be located from the URI alone, not the URI ''"); | |||||
buildRule.executeTarget("noName"); | buildRule.executeTarget("noName"); | ||||
// TODO assert value | |||||
} | } | ||||
@Test(expected = BuildException.class) | @Test(expected = BuildException.class) | ||||
@@ -19,7 +19,6 @@ | |||||
package org.apache.tools.ant.taskdefs; | package org.apache.tools.ant.taskdefs; | ||||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import static org.junit.Assert.assertNotNull; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.BuildFileRule; | import org.apache.tools.ant.BuildFileRule; | ||||
@@ -40,7 +39,6 @@ public class XmlnsTest { | |||||
@Before | @Before | ||||
public void setUp() { | public void setUp() { | ||||
assertNotNull("build.tests.value not set", System.getProperty("build.tests.value")); | |||||
buildRule.configureProject("src/etc/testcases/taskdefs/xmlns.xml"); | buildRule.configureProject("src/etc/testcases/taskdefs/xmlns.xml"); | ||||
} | } | ||||
@@ -73,7 +73,7 @@ public class AddTypeTest { | |||||
@Test | @Test | ||||
public void testNestedB() { | public void testNestedB() { | ||||
buildRule.executeTarget("nested.b"); | buildRule.executeTarget("nested.b"); | ||||
assertThat(buildRule.getLog(), containsString("add B called")); | |||||
assertThat(buildRule.getLog(), containsString("add B called")); | |||||
} | } | ||||
@Test | @Test | ||||
@@ -47,10 +47,10 @@ public class FlexIntegerTest { | |||||
// This class acts as a custom Ant task also | // This class acts as a custom Ant task also | ||||
// and uses these variables/methods in that mode | // and uses these variables/methods in that mode | ||||
private Project taskProject; | private Project taskProject; | ||||
String propName; | |||||
private FlexInteger value; | |||||
String propName; | |||||
private FlexInteger value; | |||||
public void setPropName(String propName) { | public void setPropName(String propName) { | ||||
this.propName = propName; | this.propName = propName; | ||||
@@ -19,6 +19,7 @@ | |||||
package org.apache.tools.ant.types; | package org.apache.tools.ant.types; | ||||
import java.io.File; | import java.io.File; | ||||
import java.nio.file.Paths; | |||||
import java.util.Locale; | import java.util.Locale; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
@@ -32,6 +33,7 @@ import org.junit.rules.ExpectedException; | |||||
import static org.hamcrest.Matchers.endsWith; | import static org.hamcrest.Matchers.endsWith; | ||||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import static org.junit.Assert.assertNotNull; | |||||
import static org.junit.Assert.assertThat; | import static org.junit.Assert.assertThat; | ||||
/** | /** | ||||
@@ -573,11 +575,14 @@ public class PathTest { | |||||
DirSet d = new DirSet(); | DirSet d = new DirSet(); | ||||
d.setProject(project); | d.setProject(project); | ||||
d.setDir(project.resolveFile(".")); | d.setDir(project.resolveFile(".")); | ||||
d.setIncludes("build"); | |||||
String s = System.getProperty("build.tests.value"); | |||||
assertNotNull("build.tests.value not set", s); | |||||
String n = Paths.get(s).getParent().equals("ant") ? "ant" : "build"; | |||||
d.setIncludes(n); | |||||
p.addDirset(d); | p.addDirset(d); | ||||
String[] l = p.list(); | String[] l = p.list(); | ||||
assertEquals(1, l.length); | assertEquals(1, l.length); | ||||
assertEquals(project.resolveFile("build").getAbsolutePath(), l[0]); | |||||
assertEquals(project.resolveFile(n).getAbsolutePath(), l[0]); | |||||
} | } | ||||
@Test | @Test | ||||