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