forked from lamikae/html2jsr286
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_test.xml
128 lines (112 loc) · 4.28 KB
/
build_test.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Version: 0.1
-->
<project basedir="." default="test" name="rails-portlet">
<!--
#################################################################
Properties for the build process; Change the parameters you need
#################################################################
-->
<!-- This folder holds a complete report of the execution -->
<property name="junit.output.dir" value="junit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.5"/>
<property name="source" value="1.5"/>
<!-- The Runner class -->
<property name="test.loader.dir" value="com.celamanzi.liferay.portlets.rails286.TestLoader"/>
<path id="test.classpath">
<pathelement location="bin"/>
<pathelement location="WEB-INF/lib/commons-codec-1.3.jar"/>
<pathelement location="WEB-INF/lib/commons-httpclient-3.1.jar"/>
<pathelement location="WEB-INF/lib/commons-logging.jar"/>
<pathelement location="WEB-INF/lib/commons-fileupload-1.2.1.jar"/>
<pathelement location="WEB-INF/lib/commons-lang-2.4.jar"/>
<pathelement location="WEB-INF/lib/htmlparser-1.6.jar"/>
<pathelement location="WEB-INF/lib/junit-4.6.jar"/>
<pathelement location="WEB-INF/lib/log4j-1.2.15.jar"/>
<pathelement location="WEB-INF/lib/portal-service-5.2.3.jar"/>
<pathelement location="WEB-INF/lib/portal-service-6.0.5.jar"/>
<pathelement location="WEB-INF/lib/portlet-2.0.jar"/>
<pathelement location="WEB-INF/lib/servlet-api-2.4.jar"/>
<pathelement location="WEB-INF/lib/spring-core-3.0.2.jar"/>
<pathelement location="WEB-INF/lib/spring-webmvc-3.0.2.jar"/>
<pathelement location="WEB-INF/lib/spring-webmvc-portlet-3.0.2.jar"/>
<pathelement location="WEB-INF/lib/spring-test-3.0.2.jar"/>
<pathelement location="WEB-INF/lib/util-java.jar"/>
</path>
<!--
#################################################################
Tasks to compile, test and generate a report of the project
#################################################################
-->
<target name="init">
<delete dir="junit" /> <!-- Report dir -->
<delete dir="bin" />
<mkdir dir="bin" />
</target>
<target name="compile" depends="init">
<echo message="${ant.project.name}: ${ant.file}"/>
<!-- Compile src -->
<javac
debug="true"
debuglevel="${debuglevel}"
destdir="bin"
source="${source}"
target="${target}"
includeantruntime="false"
encoding="UTF-8"
>
<src path="WEB-INF/src"/>
<classpath refid="test.classpath"/>
</javac>
<!-- Compile test src -->
<javac
debug="true"
debuglevel="${debuglevel}"
destdir="bin"
source="${source}"
target="${target}"
includeantruntime="false"
encoding="UTF-8"
>
<src path="test"/>
<classpath refid="test.classpath"/>
</javac>
<!-- copy log4j configuration for test debugging -->
<copy file="test/log4j.properties" tofile="bin/log4j.properties" />
</target>
<target name="test" depends="compile">
<!-- Execute JUnit -->
<mkdir dir="${junit.output.dir}"/>
<junit fork="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<test name="${test.loader.dir}" todir="${junit.output.dir}"/>
<classpath refid="test.classpath"/>
</junit>
<!-- Generate some html report with the result -->
<echo message="Generating report"/>
<junitreport todir="${junit.output.dir}">
<fileset dir="${junit.output.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junit.output.dir}"/>
</junitreport>
</target>
<!-- Run just a single test class, or a single test method -->
<target name="ensure-test-name" unless="test">
<fail message="You must run this target with -Dtest=TestName"/>
</target>
<target name="runtest" description="Runs the test you specify on the command
line with -Dtest=" depends="compile, ensure-test-name">
<junit printsummary="true" fork="yes">
<classpath refid="test.classpath" />
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="test">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>