git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1585377 13f79535-47bb-0310-9956-ffa450edef68master
@@ -18,11 +18,10 @@ | |||||
<project name="antlr-test" basedir="." default="test1"> | <project name="antlr-test" basedir="." default="test1"> | ||||
<property name="tmp.dir" location="antlr.tmp"/> | |||||
<import file="../../../buildfiletest-base.xml"/> | |||||
<target name="setup"> | |||||
<mkdir dir="${tmp.dir}"/> | |||||
<target name="setUp"> | |||||
<mkdir dir="${output}" /> | |||||
</target> | </target> | ||||
<target name="test1"> | <target name="test1"> | ||||
@@ -30,17 +29,17 @@ | |||||
</target> | </target> | ||||
<target name="test2"> | <target name="test2"> | ||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}"/> | |||||
<antlr target="antlr.g" outputdirectory="${output}"/> | |||||
</target> | </target> | ||||
<target name="test3" depends="setup"> | |||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}"/> | |||||
<target name="test3" depends="setUp"> | |||||
<antlr target="antlr.g" outputdirectory="${output}"/> | |||||
<fail> | <fail> | ||||
<condition> | <condition> | ||||
<!-- to prove each of these files exists; | <!-- to prove each of these files exists; | ||||
ANTLR >= 2.7.6 leaves behind new (.smap) files as well. --> | ANTLR >= 2.7.6 leaves behind new (.smap) files as well. --> | ||||
<resourcecount when="ne" count="5"> | <resourcecount when="ne" count="5"> | ||||
<fileset dir="${tmp.dir}"> | |||||
<fileset dir="${output}"> | |||||
<include name="CalcParserTokenTypes.txt" /> | <include name="CalcParserTokenTypes.txt" /> | ||||
<include name="CalcParserTokenTypes.java" /> | <include name="CalcParserTokenTypes.java" /> | ||||
<include name="CalcLexer.java" /> | <include name="CalcLexer.java" /> | ||||
@@ -52,20 +51,20 @@ | |||||
</fail> | </fail> | ||||
</target> | </target> | ||||
<target name="test4" depends="setup"> | |||||
<antlr target="java.g" outputdirectory="${tmp.dir}"/> | |||||
<antlr dir="${tmp.dir}" target="java.tree.g" outputdirectory="${tmp.dir}"/> | |||||
<target name="test4" depends="setUp"> | |||||
<antlr target="java.g" outputdirectory="${output}"/> | |||||
<antlr dir="${output}" target="java.tree.g" outputdirectory="${output}"/> | |||||
</target> | </target> | ||||
<target name="test5" depends="setup"> | |||||
<antlr target="java.tree.g" outputdirectory="${tmp.dir}" fork="yes"/> | |||||
<target name="test5" depends="setUp"> | |||||
<antlr target="java.tree.g" outputdirectory="${output}" fork="yes"/> | |||||
</target> | </target> | ||||
<target name="test6" depends="setup"> | |||||
<antlr target="java.g" outputdirectory="${tmp.dir}" /> | |||||
<antlr dir="${tmp.dir}" | |||||
<target name="test6" depends="setUp"> | |||||
<antlr target="java.g" outputdirectory="${output}" /> | |||||
<antlr dir="${output}" | |||||
target="java.tree.g" | target="java.tree.g" | ||||
outputdirectory="${tmp.dir}" | |||||
outputdirectory="${output}" | |||||
fork="yes"/> | fork="yes"/> | ||||
</target> | </target> | ||||
@@ -73,58 +72,58 @@ | |||||
<antlr target="antlr.xml"/> | <antlr target="antlr.xml"/> | ||||
</target> | </target> | ||||
<target name="test8" depends="setup"> | |||||
<antlr target="extended.calc.g" outputdirectory="${tmp.dir}" glib="non-existent-file.g"/> | |||||
<target name="test8" depends="setUp"> | |||||
<antlr target="extended.calc.g" outputdirectory="${output}" glib="non-existent-file.g"/> | |||||
</target> | </target> | ||||
<target name="test9" depends="setup"> | |||||
<target name="test9" depends="setUp"> | |||||
<!-- Note that I had to copy the grammars over to the temporary directory. --> | <!-- Note that I had to copy the grammars over to the temporary directory. --> | ||||
<!-- This is because ANTLR expects the super grammar and its generated java --> | <!-- This is because ANTLR expects the super grammar and its generated java --> | ||||
<!-- files to be in the same directory, which won't be the case if I use --> | <!-- files to be in the same directory, which won't be the case if I use --> | ||||
<!-- the output directory option. --> | <!-- the output directory option. --> | ||||
<copy file="antlr.g" todir="${tmp.dir}"/> | |||||
<copy file="extended.calc.g" todir="${tmp.dir}"/> | |||||
<antlr target="${tmp.dir}/antlr.g"/> | |||||
<antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/> | |||||
<copy file="antlr.g" todir="${output}"/> | |||||
<copy file="extended.calc.g" todir="${output}"/> | |||||
<antlr target="${output}/antlr.g"/> | |||||
<antlr target="${output}/extended.calc.g" glib="${output}/antlr.g"/> | |||||
</target> | </target> | ||||
<target name="test10" depends="setup"> | |||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}" html="yes"/> | |||||
<target name="test10" depends="setUp"> | |||||
<antlr target="antlr.g" outputdirectory="${output}" html="yes"/> | |||||
</target> | </target> | ||||
<target name="test11" depends="setup"> | |||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}" diagnostic="yes"/> | |||||
<target name="test11" depends="setUp"> | |||||
<antlr target="antlr.g" outputdirectory="${output}" diagnostic="yes"/> | |||||
</target> | </target> | ||||
<target name="test12" depends="setup"> | |||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}" trace="yes"/> | |||||
<target name="test12" depends="setUp"> | |||||
<antlr target="antlr.g" outputdirectory="${output}" trace="yes"/> | |||||
</target> | </target> | ||||
<target name="test13" depends="setup"> | |||||
<antlr target="antlr.g" outputdirectory="${tmp.dir}" traceLexer="yes" traceParser="yes" traceTreeWalker="yes"/> | |||||
<target name="test13" depends="setUp"> | |||||
<antlr target="antlr.g" outputdirectory="${output}" traceLexer="yes" traceParser="yes" traceTreeWalker="yes"/> | |||||
</target> | </target> | ||||
<!-- test9 will have been run before that --> | <!-- test9 will have been run before that --> | ||||
<target name="noRecompile"> | <target name="noRecompile"> | ||||
<antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/> | |||||
<antlr target="${output}/extended.calc.g" glib="${output}/antlr.g"/> | |||||
</target> | </target> | ||||
<!-- test9 will have been run before that --> | <!-- test9 will have been run before that --> | ||||
<target name="normalRecompile"> | <target name="normalRecompile"> | ||||
<sleep seconds="2"/> | <sleep seconds="2"/> | ||||
<touch file="${tmp.dir}/extended.calc.g"/> | |||||
<antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/> | |||||
<touch file="${output}/extended.calc.g"/> | |||||
<antlr target="${output}/extended.calc.g" glib="${output}/antlr.g"/> | |||||
</target> | </target> | ||||
<!-- test9 will have been run before that --> | <!-- test9 will have been run before that --> | ||||
<target name="supergrammarChangeRecompile"> | <target name="supergrammarChangeRecompile"> | ||||
<sleep seconds="2"/> | <sleep seconds="2"/> | ||||
<touch file="${tmp.dir}/antlr.g"/> | |||||
<antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/> | |||||
<touch file="${output}/antlr.g"/> | |||||
<antlr target="${output}/extended.calc.g" glib="${output}/antlr.g"/> | |||||
</target> | </target> | ||||
<target name="cleanup"> | |||||
<delete dir="${tmp.dir}" /> | |||||
<target name="tearDown"> | |||||
<delete dir="${output}" /> | |||||
<delete file="../../../../../../CalcParserTokenTypes.txt"/> | <delete file="../../../../../../CalcParserTokenTypes.txt"/> | ||||
</target> | </target> | ||||
@@ -16,68 +16,68 @@ | |||||
limitations under the License. | limitations under the License. | ||||
--> | --> | ||||
<project name="test" default="def" basedir="."> | <project name="test" default="def" basedir="."> | ||||
<property name="tmpregexp" location="tmpregexp"/> | |||||
<target name="def"> | |||||
<fail>This build file should only be run from within the testcase</fail> | |||||
<import file="../../buildfiletest-base.xml"/> | |||||
<property name="root" location="../../../../.."/> | |||||
<target name="setUp"> | |||||
<mkdir dir="${output}" /> | |||||
<copy file="replaceregexp.properties" tofile="${output}/test.properties" /> | |||||
</target> | </target> | ||||
<target name="setup"> | |||||
<copy file="replaceregexp.properties" tofile="test.properties" /> | |||||
<target name="def"> | |||||
<fail>This build file should only be run from within the testcase</fail> | |||||
</target> | </target> | ||||
<target name="setup-nl"> | |||||
<copy file="replaceregexp2.properties" tofile="test.properties" /> | |||||
<target name="setUp-nl"> | |||||
<mkdir dir="${output}" /> | |||||
<copy file="replaceregexp2.properties" tofile="${output}/test.properties" /> | |||||
</target> | </target> | ||||
<target name="testReplace" depends="setup"> | |||||
<replaceregexp file="test.properties" byline="true"> | |||||
<target name="testReplace" depends="setUp"> | |||||
<replaceregexp file="${output}/test.properties" byline="true"> | |||||
<regexp pattern="Old(.*)=(.*)" /> | <regexp pattern="Old(.*)=(.*)" /> | ||||
<substitution expression="NewProp=\1\2" /> | <substitution expression="NewProp=\1\2" /> | ||||
</replaceregexp> | </replaceregexp> | ||||
</target> | </target> | ||||
<!-- use in conjunction with testDirectoryDateDoesNotChange to make sure something will happen --> | <!-- use in conjunction with testDirectoryDateDoesNotChange to make sure something will happen --> | ||||
<target name="touchDirectory"> | <target name="touchDirectory"> | ||||
<mkdir dir="${tmpregexp}"/> | |||||
<copy file="replaceregexp.properties" tofile="${tmpregexp}/test.properties" /> | |||||
<copy file="replaceregexp.properties" tofile="${output}/test.properties" /> | |||||
<sleep seconds="2"/> | <sleep seconds="2"/> | ||||
</target> | </target> | ||||
<target name="testDirectoryDateDoesNotChange"> | <target name="testDirectoryDateDoesNotChange"> | ||||
<replaceregexp file="${tmpregexp}/test.properties" byline="true"> | |||||
<replaceregexp file="${output}/test.properties" byline="true"> | |||||
<regexp pattern="foo" /> | <regexp pattern="foo" /> | ||||
<substitution expression="bar"/> | <substitution expression="bar"/> | ||||
</replaceregexp> | </replaceregexp> | ||||
</target> | </target> | ||||
<target name="testDontAddNewline1" depends="setup-nl"> | |||||
<replaceregexp file="test.properties" byline="false"> | |||||
<target name="testDontAddNewline1" depends="setUp-nl"> | |||||
<replaceregexp file="${output}/test.properties" byline="false"> | |||||
<regexp pattern="Old(.*)=(.*)" /> | <regexp pattern="Old(.*)=(.*)" /> | ||||
<substitution expression="NewProp=\1\2" /> | <substitution expression="NewProp=\1\2" /> | ||||
</replaceregexp> | </replaceregexp> | ||||
</target> | </target> | ||||
<target name="testDontAddNewline2" depends="setup-nl"> | |||||
<replaceregexp file="test.properties" byline="true"> | |||||
<target name="testDontAddNewline2" depends="setUp-nl"> | |||||
<replaceregexp file="${output}/test.properties" byline="true"> | |||||
<regexp pattern="Old(.*)=(.*)" /> | <regexp pattern="Old(.*)=(.*)" /> | ||||
<substitution expression="NewProp=\1\2" /> | <substitution expression="NewProp=\1\2" /> | ||||
</replaceregexp> | </replaceregexp> | ||||
</target> | </target> | ||||
<target name="lastModifiedSetup"> | <target name="lastModifiedSetup"> | ||||
<mkdir dir="${tmpregexp}"/> | |||||
<echo file="${tmpregexp}/test.txt">Hello, world!</echo> | |||||
<echo file="${output}/test.txt">Hello, world!</echo> | |||||
</target> | </target> | ||||
<target name="testNoPreserve"> | <target name="testNoPreserve"> | ||||
<replaceregexp match="world" replace="Ant" file="${tmpregexp}/test.txt"/> | |||||
<replaceregexp match="world" replace="Ant" file="${output}/test.txt"/> | |||||
</target> | </target> | ||||
<target name="testPreserve"> | <target name="testPreserve"> | ||||
<replaceregexp match="world" replace="Ant" file="${tmpregexp}/test.txt" | |||||
<replaceregexp match="world" replace="Ant" file="${output}/test.txt" | |||||
preserveLastModified="true"/> | preserveLastModified="true"/> | ||||
</target> | </target> | ||||
<target name="cleanup"> | |||||
<delete file="test.properties" /> | |||||
<delete dir="${tmpregexp}" quiet="true"/> | |||||
</target> | |||||
</project> | </project> | ||||
@@ -16,14 +16,17 @@ | |||||
limitations under the License. | limitations under the License. | ||||
--> | --> | ||||
<project name="xslt" default="xslt" basedir="."> | |||||
<property name="nonasciidir" value="xml/ãnt"/> | |||||
<target name="init"> | |||||
<mkdir dir="xml/out"/> | |||||
<project name="xslt" default="tearDown" basedir="."> | |||||
<import file="../../buildfiletest-base.xml"/> | |||||
<target name="setUp"> | |||||
<mkdir dir="${output}" /> | |||||
</target> | </target> | ||||
<target name="initNonAscii"> | |||||
<mkdir dir="${nonasciidir}"/> | |||||
<target name="initNonAscii" depends="setUp"> | |||||
<property name="nonasciidir" value="${output}/ãnt"/> | |||||
<mkdir dir="${nonasciidir}"/> | |||||
<copy todir="${nonasciidir}"> | <copy todir="${nonasciidir}"> | ||||
<fileset dir="xml"> | <fileset dir="xml"> | ||||
<include name="docwithentity.xml"/> | <include name="docwithentity.xml"/> | ||||
@@ -32,13 +35,8 @@ | |||||
</copy> | </copy> | ||||
</target> | </target> | ||||
<target name="teardown"> | |||||
<delete dir="xml/out"/> | |||||
<delete dir="${nonasciidir}" quiet="true"/> | |||||
</target> | |||||
<target name="testCatchNoDtd" depends="init"> | |||||
<xslt basedir="xml" destdir="xml/out" | |||||
<target name="testCatchNoDtd" depends="setUp"> | |||||
<xslt basedir="xml" destdir="${output}" | |||||
includes="about.xml" | includes="about.xml" | ||||
extension=".txt" | extension=".txt" | ||||
style="xml/doc.xsl"> | style="xml/doc.xsl"> | ||||
@@ -50,8 +48,8 @@ | |||||
location="xml/doc.dtd"/> | location="xml/doc.dtd"/> | ||||
</xmlcatalog> | </xmlcatalog> | ||||
<target name="testCatalog" depends="init"> | |||||
<xslt destdir="xml/out" | |||||
<target name="testCatalog" depends="setUp"> | |||||
<xslt destdir="${output}" | |||||
includes="about.xml" | includes="about.xml" | ||||
extension=".txt" | extension=".txt" | ||||
style="xml/doc.xsl"> | style="xml/doc.xsl"> | ||||
@@ -59,9 +57,9 @@ | |||||
</xslt> | </xslt> | ||||
</target> | </target> | ||||
<target name="testOutputProperty" depends="init"> | |||||
<target name="testOutputProperty" depends="setUp"> | |||||
<xslt in="xml/test.xml" | <xslt in="xml/test.xml" | ||||
out="xml/out/test-out.xml" | |||||
out="${output}/test-out.xml" | |||||
style="xml/test.xsl"> | style="xml/test.xsl"> | ||||
<outputproperty name="method" value="xml"/> | <outputproperty name="method" value="xml"/> | ||||
<outputproperty name="standalone" value="yes"/> | <outputproperty name="standalone" value="yes"/> | ||||
@@ -71,17 +69,17 @@ | |||||
</target> | </target> | ||||
<target name="testFactory" depends="init"> | |||||
<target name="testFactory" depends="setUp"> | |||||
<xslt in="xml/test.xml" | <xslt in="xml/test.xml" | ||||
out="xml/out/test-out.xml" | |||||
out="${output}/test-out.xml" | |||||
style="xml/test.xsl"> | style="xml/test.xsl"> | ||||
<factory name="org.apache.xalan.processor.TransformerFactoryImpl"/> | <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/> | ||||
</xslt> | </xslt> | ||||
</target> | </target> | ||||
<target name="testAttribute" depends="init"> | |||||
<target name="testAttribute" depends="setUp"> | |||||
<xslt in="xml/test.xml" | <xslt in="xml/test.xml" | ||||
out="xml/out/test-out.xml" | |||||
out="${output}/test-out.xml" | |||||
style="xml/test.xsl"> | style="xml/test.xsl"> | ||||
<factory name="org.apache.xalan.processor.TransformerFactoryImpl"> | <factory name="org.apache.xalan.processor.TransformerFactoryImpl"> | ||||
<attribute name="http://xml.apache.org/xalan/features/optimize" value="true"/> | <attribute name="http://xml.apache.org/xalan/features/optimize" value="true"/> | ||||
@@ -91,13 +89,13 @@ | |||||
<!-- inspired by bug report 37348 --> | <!-- inspired by bug report 37348 --> | ||||
<target name="testXMLWithEntitiesInNonAsciiPath" depends="initNonAscii"> | <target name="testXMLWithEntitiesInNonAsciiPath" depends="initNonAscii"> | ||||
<xslt in="${nonasciidir}/docwithentity.xml" | <xslt in="${nonasciidir}/docwithentity.xml" | ||||
out="xml/out/test-out.xml" | |||||
out="${output}/test-out.xml" | |||||
style="xml/apache.xsl"> | style="xml/apache.xsl"> | ||||
</xslt> | </xslt> | ||||
</target> | </target> | ||||
<target name="testStyleSheetWithInclude" depends="init"> | |||||
<target name="testStyleSheetWithInclude" depends="setUp"> | |||||
<xslt in="xml/books.xml" | <xslt in="xml/books.xml" | ||||
out="xml/out/test-out.xml" | |||||
out="${output}/test-out.xml" | |||||
style="xml/stylesheet_with_include.xsl"> | style="xml/stylesheet_with_include.xsl"> | ||||
</xslt> | </xslt> | ||||
</target> | </target> | ||||
@@ -44,10 +44,6 @@ public class ANTLRTest extends BuildFileTest { | |||||
configureProject(TASKDEFS_DIR + "antlr.xml"); | configureProject(TASKDEFS_DIR + "antlr.xml"); | ||||
} | } | ||||
public void tearDown() { | |||||
executeTarget("cleanup"); | |||||
} | |||||
public void test1() { | public void test1() { | ||||
expectBuildException("test1", "required argument, target, missing"); | expectBuildException("test1", "required argument, target, missing"); | ||||
} | } | ||||
@@ -99,8 +95,7 @@ public class ANTLRTest extends BuildFileTest { | |||||
*/ | */ | ||||
public void test10() { | public void test10() { | ||||
executeTarget("test10"); | executeTarget("test10"); | ||||
File outputDirectory = new File(System.getProperty("root"), TASKDEFS_DIR + "antlr.tmp"); | |||||
String[] calcFiles = outputDirectory.list(new HTMLFilter()); | |||||
String[] calcFiles = getOutputDir().list(new HTMLFilter()); | |||||
assertTrue(calcFiles.length > 0); | assertTrue(calcFiles.length > 0); | ||||
} | } | ||||
@@ -41,15 +41,11 @@ public class ReplaceRegExpTest extends BuildFileTest { | |||||
configureProject(PROJECT_PATH + "/replaceregexp.xml"); | configureProject(PROJECT_PATH + "/replaceregexp.xml"); | ||||
} | } | ||||
public void tearDown() { | |||||
executeTarget("cleanup"); | |||||
} | |||||
public void testReplace() throws IOException { | public void testReplace() throws IOException { | ||||
Properties original = new Properties(); | Properties original = new Properties(); | ||||
FileInputStream propsFile = null; | FileInputStream propsFile = null; | ||||
try { | try { | ||||
propsFile = new FileInputStream(new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp.properties")); | |||||
propsFile = new FileInputStream(new File(project.getBaseDir() + "/replaceregexp.properties")); | |||||
original.load(propsFile); | original.load(propsFile); | ||||
} finally { | } finally { | ||||
if (propsFile != null) { | if (propsFile != null) { | ||||
@@ -64,7 +60,7 @@ public class ReplaceRegExpTest extends BuildFileTest { | |||||
Properties after = new Properties(); | Properties after = new Properties(); | ||||
try { | try { | ||||
propsFile = new FileInputStream(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties")); | |||||
propsFile = new FileInputStream(new File(getOutputDir(), "test.properties")); | |||||
after.load(propsFile); | after.load(propsFile); | ||||
} finally { | } finally { | ||||
if (propsFile != null) { | if (propsFile != null) { | ||||
@@ -79,7 +75,7 @@ public class ReplaceRegExpTest extends BuildFileTest { | |||||
// inspired by bug 22541 | // inspired by bug 22541 | ||||
public void testDirectoryDateDoesNotChange() { | public void testDirectoryDateDoesNotChange() { | ||||
executeTarget("touchDirectory"); | executeTarget("touchDirectory"); | ||||
File myFile = new File(System.getProperty("root"), PROJECT_PATH + "/" + getProject().getProperty("tmpregexp")); | |||||
File myFile = getOutputDir(); | |||||
long timeStampBefore = myFile.lastModified(); | long timeStampBefore = myFile.lastModified(); | ||||
executeTarget("testDirectoryDateDoesNotChange"); | executeTarget("testDirectoryDateDoesNotChange"); | ||||
long timeStampAfter = myFile.lastModified(); | long timeStampAfter = myFile.lastModified(); | ||||
@@ -90,34 +86,32 @@ public class ReplaceRegExpTest extends BuildFileTest { | |||||
executeTarget("testDontAddNewline1"); | executeTarget("testDontAddNewline1"); | ||||
assertTrue("Files match", | assertTrue("Files match", | ||||
FILE_UTILS | FILE_UTILS | ||||
.contentEquals(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties"), | |||||
new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp2.result.properties"))); | |||||
.contentEquals(new File(getOutputDir(), "test.properties"), | |||||
new File(getProjectDir(), "replaceregexp2.result.properties"))); | |||||
} | } | ||||
public void testDontAddNewline2() throws IOException { | public void testDontAddNewline2() throws IOException { | ||||
executeTarget("testDontAddNewline2"); | executeTarget("testDontAddNewline2"); | ||||
assertTrue("Files match", | assertTrue("Files match", | ||||
FILE_UTILS | FILE_UTILS | ||||
.contentEquals(new File(System.getProperty("root"), PROJECT_PATH + "/test.properties"), | |||||
new File(System.getProperty("root"), PROJECT_PATH + "/replaceregexp2.result.properties"))); | |||||
.contentEquals(new File(getOutputDir(), "test.properties"), | |||||
new File(getProjectDir(), "replaceregexp2.result.properties"))); | |||||
} | } | ||||
public void testNoPreserveLastModified() throws Exception { | public void testNoPreserveLastModified() throws Exception { | ||||
executeTarget("lastModifiedSetup"); | executeTarget("lastModifiedSetup"); | ||||
String tmpdir = project.getProperty("tmpregexp"); | |||||
long ts1 = new File(tmpdir, "test.txt").lastModified(); | |||||
long ts1 = new File(getOutputDir(), "test.txt").lastModified(); | |||||
Thread.sleep(3000); | Thread.sleep(3000); | ||||
executeTarget("testNoPreserve"); | executeTarget("testNoPreserve"); | ||||
assertTrue(ts1 < new File(tmpdir, "test.txt").lastModified()); | |||||
assertTrue(ts1 < new File(getOutputDir(), "test.txt").lastModified()); | |||||
} | } | ||||
public void testPreserveLastModified() throws Exception { | public void testPreserveLastModified() throws Exception { | ||||
executeTarget("lastModifiedSetup"); | executeTarget("lastModifiedSetup"); | ||||
String tmpdir = project.getProperty("tmpregexp"); | |||||
long ts1 = new File(tmpdir, "test.txt").lastModified(); | |||||
long ts1 = new File(getOutputDir(), "test.txt").lastModified(); | |||||
Thread.sleep(3000); | Thread.sleep(3000); | ||||
executeTarget("testPreserve"); | executeTarget("testPreserve"); | ||||
assertTrue(ts1 == new File(tmpdir, "test.txt").lastModified()); | |||||
assertTrue(ts1 == new File(getOutputDir(), "test.txt").lastModified()); | |||||
} | } | ||||
}// ReplaceRegExpTest | }// ReplaceRegExpTest |
@@ -50,14 +50,6 @@ public class XsltTest extends BuildFileTest { | |||||
} | } | ||||
/** | |||||
* The teardown method for JUnit | |||||
*/ | |||||
public void tearDown() { | |||||
executeTarget("teardown"); | |||||
} | |||||
/** | /** | ||||
* A unit test for JUnit | * A unit test for JUnit | ||||
@@ -79,16 +71,6 @@ public class XsltTest extends BuildFileTest { | |||||
executeTarget("testOutputProperty"); | executeTarget("testOutputProperty"); | ||||
} | } | ||||
/* Only runs if xalan.jar is in CP (not incl. Sun's JRE repackaging): | |||||
public void testFactory() throws Exception { | |||||
executeTarget("testFactory"); | |||||
} | |||||
public void testAttribute() throws Exception { | |||||
executeTarget("testAttribute"); | |||||
} | |||||
*/ | |||||
public void testXMLWithEntitiesInNonAsciiPath() throws Exception { | public void testXMLWithEntitiesInNonAsciiPath() throws Exception { | ||||
executeTarget("testXMLWithEntitiesInNonAsciiPath"); | executeTarget("testXMLWithEntitiesInNonAsciiPath"); | ||||
} | } | ||||