Adjust build.xml to update to junit 4.11

Also allow to specify a pattern to only run certain unit tests.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1498178 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2013-06-30 20:49:51 +00:00
parent ea1bb016a9
commit ae5b31d741
1 changed files with 15 additions and 6 deletions

View File

@ -79,6 +79,7 @@ under the License.
JVM system properties for running tests, JVM system properties for running tests,
user.language and user.country are required as we have locale-sensitive formatters user.language and user.country are required as we have locale-sensitive formatters
--> -->
<property name="testpattern" value="Test*"/>
<property name="poi.test.locale" value="-Duser.language=en -Duser.country=US"/> <property name="poi.test.locale" value="-Duser.language=en -Duser.country=US"/>
<property name="POI.testdata.path" value="test-data"/> <property name="POI.testdata.path" value="test-data"/>
<property name="java.awt.headless" value="true"/> <property name="java.awt.headless" value="true"/>
@ -134,8 +135,10 @@ under the License.
value="${repository.m2}/maven2/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"/> value="${repository.m2}/maven2/commons-codec/commons-codec/1.5/commons-codec-1.5.jar"/>
<property name="main.log4j.jar" location="${main.lib}/log4j-1.2.13.jar"/> <property name="main.log4j.jar" location="${main.lib}/log4j-1.2.13.jar"/>
<property name="main.log4j.url" value="${repository.m2}/maven2/log4j/log4j/1.2.13/log4j-1.2.13.jar"/> <property name="main.log4j.url" value="${repository.m2}/maven2/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
<property name="main.junit.jar" location="${main.lib}/junit-3.8.1.jar"/> <property name="main.junit.jar" location="${main.lib}/junit-4.11.jar"/>
<property name="main.junit.url" value="${repository.m2}/maven2/junit/junit/3.8.1/junit-3.8.1.jar"/> <property name="main.junit.url" value="${repository.m2}/maven2/junit/junit/4.11/junit-4.11.jar"/>
<property name="main.hamcrest.jar" location="${main.lib}/hamcrest-core-1.3.jar"/>
<property name="main.hamcrest.url" value="${repository.m2}/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<property name="main.ant.jar" location="${main.lib}/ant-1.8.2.jar"/> <property name="main.ant.jar" location="${main.lib}/ant-1.8.2.jar"/>
<property name="main.ant.url" value="${repository.m2}/maven2/org/apache/ant/ant/1.8.2/ant-1.8.2.jar"/> <property name="main.ant.url" value="${repository.m2}/maven2/org/apache/ant/ant/1.8.2/ant-1.8.2.jar"/>
@ -180,6 +183,7 @@ under the License.
<pathelement location="${main.commons-codec.jar}"/> <pathelement location="${main.commons-codec.jar}"/>
<pathelement location="${main.log4j.jar}"/> <pathelement location="${main.log4j.jar}"/>
<pathelement location="${main.junit.jar}"/> <pathelement location="${main.junit.jar}"/>
<pathelement location="${main.hamcrest.jar}"/>
</path> </path>
<path id="scratchpad.classpath"> <path id="scratchpad.classpath">
@ -310,6 +314,7 @@ under the License.
<available file="${main.commons-codec.jar}"/> <available file="${main.commons-codec.jar}"/>
<available file="${main.log4j.jar}"/> <available file="${main.log4j.jar}"/>
<available file="${main.junit.jar}"/> <available file="${main.junit.jar}"/>
<available file="${main.hamcrest.jar}"/>
<available file="${main.ant.jar}"/> <available file="${main.ant.jar}"/>
</and> </and>
<isset property="disconnected"/> <isset property="disconnected"/>
@ -336,6 +341,10 @@ under the License.
<param name="sourcefile" value="${main.junit.url}"/> <param name="sourcefile" value="${main.junit.url}"/>
<param name="destfile" value="${main.junit.jar}"/> <param name="destfile" value="${main.junit.jar}"/>
</antcall> </antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${main.hamcrest.url}"/>
<param name="destfile" value="${main.hamcrest.jar}"/>
</antcall>
<antcall target="downloadfile"> <antcall target="downloadfile">
<param name="sourcefile" value="${main.ant.url}"/> <param name="sourcefile" value="${main.ant.url}"/>
<param name="destfile" value="${main.ant.jar}"/> <param name="destfile" value="${main.ant.jar}"/>
@ -636,7 +645,7 @@ under the License.
<formatter type="plain"/> <formatter type="plain"/>
<batchtest todir="${main.reports.test}"> <batchtest todir="${main.reports.test}">
<fileset dir="${main.src.test}"> <fileset dir="${main.src.test}">
<include name="**/Test*.java"/> <include name="**/${testpattern}.java"/>
<exclude name="**/All*Tests.java"/> <exclude name="**/All*Tests.java"/>
<exclude name="**/TestUnfixedBugs.java"/> <exclude name="**/TestUnfixedBugs.java"/>
<exclude name="**/TestcaseRecordInputStream.java"/> <exclude name="**/TestcaseRecordInputStream.java"/>
@ -680,7 +689,7 @@ under the License.
<formatter type="plain"/> <formatter type="plain"/>
<batchtest todir="${scratchpad.reports.test}"> <batchtest todir="${scratchpad.reports.test}">
<fileset dir="${scratchpad.src.test}"> <fileset dir="${scratchpad.src.test}">
<include name="**/Test*.java"/> <include name="**/${testpattern}.java"/>
<exclude name="**/AllTests.java"/> <exclude name="**/AllTests.java"/>
</fileset> </fileset>
</batchtest> </batchtest>
@ -712,7 +721,7 @@ under the License.
<formatter type="plain"/> <formatter type="plain"/>
<batchtest todir="${ooxml.reports.test}"> <batchtest todir="${ooxml.reports.test}">
<fileset dir="${ooxml.src.test}"> <fileset dir="${ooxml.src.test}">
<include name="**/Test*.java"/> <include name="**/${testpattern}.java"/>
<exclude name="**/All*Tests.java"/> <exclude name="**/All*Tests.java"/>
</fileset> </fileset>
</batchtest> </batchtest>
@ -772,7 +781,7 @@ under the License.
<formatter type="plain"/> <formatter type="plain"/>
<batchtest todir="${excelant.reports.test}"> <batchtest todir="${excelant.reports.test}">
<fileset dir="${excelant.src.test}"> <fileset dir="${excelant.src.test}">
<include name="**/Test*.java"/> <include name="**/${testpattern}.java"/>
</fileset> </fileset>
</batchtest> </batchtest>
</junit> </junit>