develog

JUnit Ant build.xml 본문

Dev/junit

JUnit Ant build.xml

냐옴 2012. 12. 5. 18:59

- MyEclipse 5.1.1 GA

- JUnit-4.11

- ant-1.8.4


<?xml version="1.0" encoding="utf-8"?>

<project name="Auto-Test" default="Run-Test" basedir=".">

<target name="Run-Test">

<antcall target="JUnit-Test" />

<antcall target="JUnit-TestReport" />

<antcall target="delete-test-result-file" />

<antcall target="open-report" />

</target>

<target name="JUnit-Test">

<junit printsummary="yes">

<classpath>

<pathelement location="${basedir}/lib/junit-4.11.jar" />

<pathelement location="${basedir}/bin/" />

</classpath>

<formatter type="xml" />

<!-- 하나씩 실행 -->

<test name="test.CalculatorTest" />

<test name="test.CalculatorTest2" />

<test name="test.AllTests" />

<!-- 여러개 한번에 -->

<batchtest fork="yes">

<fileset dir="${basedir}/test">

<include name="**/*Test.java" />

<include name="**/*Tests.java" />

<exclude name="**/service/*Test.java" />

</fileset>

</batchtest>

</junit>

</target>

        

<target name="JUnit-TestReport">

<delete dir="${basedir}/TestReport" />

<mkdir dir="${basedir}/TestReport" />

<junitreport todir="${basedir}/TestReport">

<fileset dir="${basedir}">

<include name="TEST-*.xml" />

</fileset>

<report todir="${basedir}/TestReport/html" />

</junitreport>

</target>

<target name="delete-test-result-file">

<delete>

<fileset dir="${basedir}">

<include name="TEST-*.xml" />

</fileset>

</delete>

</target>

<target name="open-report">

<exec executable="C:/Documents and Settings/{PC_USER}/Local Settings/Application Data/Google/Chrome/Application/chrome.exe">

<arg value="${basedir}/TestReport/html/index.html" />

</exec>

</target>

</project>


'Dev > junit' 카테고리의 다른 글

JUnit Test Project '.classpath'  (0) 2013.07.09
junit transaction rollback  (0) 2013.07.09
spring 2.5 에서는 junit 4.4 버전 사용  (0) 2012.12.05
JUnit 4 Test Suite  (0) 2012.12.02
JUnit Parameterized Test  (0) 2012.12.02
Comments