-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.xmli
193 lines (167 loc) · 10.1 KB
/
test.xmli
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0"?>
<project name="ejbcatest" basedir=".">
<target name="test:run" description="run both stand-alone JUnit test cases and system test" depends="deleteDirectories">
<antcall target="test:runsa" inheritrefs="true"><param name="aggregate.results" value="true"/></antcall>
<antcall target="test:runsys" inheritrefs="true"><param name="aggregate.results" value="true"/></antcall>
<antcall target="createreport"/>
</target>
<target name="test:runsys" description="run system test, use -Dtest.includep11=true to include P11 tests" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/systemtests" target="run" />
<antcall target="optionalteststatedump" inheritrefs="true"/>
<antcall target="optionaltestpeerconnector" inheritrefs="true"/>
<antcall target="optionaltestvapublisher" inheritrefs="true"/>
<antcall target="createreport"/>
<!-- The name of the output from the profiling result will vary slightly -->
<fileset id="profilingtest.logfile.id" dir="${reports.base.dir}/test/html/org/ejbca/core/ejb" includes="*_ProfilingTest-out.html"/>
<property name="profilingtest.logfile" refid="profilingtest.logfile.id"/>
<echo message="Profiling results (when enabled) can be found in file://${reports.dir}/html/org/ejbca/core/ejb/${profilingtest.logfile}"/>
</target>
<target name="evaluateAggregate">
<condition property="aggregate.test.results" value="true">
<equals arg1="${aggregate.results}" arg2="true"/>
</condition>
</target>
<target name="deleteDirectories" depends="evaluateAggregate" unless="${aggregate.test.results}" >
<echo message="Deleting old test results."/>
<fail message="'reports.dir' is not set." unless="reports.dir" />
<delete dir="${reports.dir}" />
<mkdir dir="${reports.dir}" />
<mkdir dir="${reports.dir}/html"/>
</target>
<target name="test:runsa" description="run stand-alone JUnit test cases, use -Dtest.includep11=true to include P11 tests" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/ejbca-ejb" target="test" />
<ant antfile="build.xml" dir="modules/ejbca-entity" target="test" />
<ant antfile="build.xml" dir="modules/healthcheck-war" target="test" />
<ant antfile="build.xml" dir="modules/cli-util" target="test" />
<ant antfile="build.xml" dir="modules/buildtools" target="test" />
<antcall target="optionaltestct" inheritrefs="true"/>
<antcall target="createreport"/>
</target>
<condition property="ct.exists"><available file="modules/ct/build.xml" /></condition>
<target name="optionaltestct" if="${ct.exists}"><ant antfile="build.xml" dir="modules/ct" target="test" /></target>
<condition property="statedump.exists"><available file="modules/statedump/build.xml" /></condition>
<target name="optionalteststatedump" if="${statedump.exists}"><antcall target="statedump" inheritrefs="true"/><ant antfile="build.xml" dir="modules/statedump" target="test" /></target>
<condition property="peerconnector.exists"><available file="modules/peerconnector/build.xml" /></condition>
<target name="optionaltestpeerconnector" if="${peerconnector.exists}"><ant antfile="build.xml" dir="modules/peerconnector" target="test" /></target>
<condition property="vapublisher.exists"><available file="modules/va/publisher" /></condition>
<target name="optionaltestvapublisher" if="${vapublisher.exists}"><ant antfile="build.xml" dir="modules/va" target="test" /></target>
<target name="test:rungfver" description="run Glassfish JEE validation tool on the EJBCA EAR" depends="ejbca.ear, deleteDirectories">
<ant antfile="build.xml" dir="modules/systemtests" target="rungfver" />
</target>
<target name="test:runone" description="run a single JUnit-test specified -Dtest.runone=classname" depends="deleteDirectories">
<fail message="'test.runone' not set. Example -Dtest.runone=TestDnComponents " unless="test.runone" />
<!-- Locate the right module where the test resides.. -->
<pathconvert property="test-fullname" dirsep="/" pathsep=" " setonempty="false">
<path>
<fileset dir="${ejbca.home}" id="test.runone.fileset">
<include name="modules/ejbca-ejb/src-test/**/${test.runone}.java" />
<include name="modules/ejbca-entity/src-test/**/${test.runone}.java" />
<include name="modules/systemtests/src-test/**/${test.runone}.java" />
<include name="modules/externalra/src-test/**/${test.runone}.java" />
<include name="modules/statedump/src-test/**/${test.runone}.java" />
<include name="modules/ct/src-test/**/${test.runone}.java" />
<include name="modules/peerconnector/src-test/**/${test.runone}.java" />
</fileset>
</path>
<map from="${ejbca.home}/" to=""/>
</pathconvert>
<echo message="${test-fullname}"/>
<condition property="module" value="modules/ejbca-ejb">
<matches string="${test-fullname}" pattern="^modules/ejbca-ejb/.*$"/>
</condition>
<condition property="module" value="modules/ejbca-entity">
<matches string="${test-fullname}" pattern="^modules/ejbca-entity/.*$"/>
</condition>
<condition property="module" value="modules/externalra">
<matches string="${test-fullname}" pattern="^modules/externalra/.*$"/>
</condition>
<condition property="module" value="modules/statedump">
<matches string="${test-fullname}" pattern="^modules/statedump/.*$"/>
</condition>
<condition property="module" value="modules/ct">
<matches string="${test-fullname}" pattern="^modules/ct/.*$"/>
</condition>
<condition property="module" value="modules/systemtests">
<matches string="${test-fullname}" pattern="^modules/systemtests/.*$"/>
</condition>
<condition property="module" value="modules/peerconnector">
<matches string="${test-fullname}" pattern="^modules/peerconnector/.*$"/>
</condition>
<fail message="The requested test '${test.runone}' was not found." unless="module"/>
<ant antfile="build.xml" dir="${module}" target="runone" />
<antcall target="createreport"/>
</target>
<target name="test:runlots" description="run JUnit testcases that creates lots of users and certificates" >
<ant antfile="build.xml" dir="modules/systemtests" target="runlotsofusers" />
<ant antfile="build.xml" dir="modules/systemtests" target="runperf" />
</target>
<target name="test:runlotsperuser" description="run JUnit testcases that creates lots of users and certificates for each user">
<ant antfile="build.xml" dir="modules/systemtests" target="runlotsperuser" />
</target>
<target name="test:runperf" description="run JUnit performance tests">
<ant antfile="build.xml" dir="modules/systemtests" target="runperf" />
</target>
<target name="test:runweb" description="run JUnit web system tests" depends="deleteDirectories" >
<ant antfile="build.xml" dir="modules/systemtests" target="runweb" />
<antcall target="createreport"/>
</target>
<target name="test:runcmpra" description="run JUnit CMP RA system tests" depends="deleteDirectories" >
<ant antfile="build.xml" dir="modules/systemtests" target="runcmp" />
<antcall target="createreport"/>
</target>
<target name="test:logstress" description="Run log stress tests." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/systemtests" target="runlogstress" />
<antcall target="createreport"/>
</target>
<target name="test:runws" description="Run web service tests." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/systemtests" target="runws" />
<antcall target="createreport"/>
</target>
<target name="test:xkms" description="Run XKMS tests." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/systemtests" target="runxkms" />
<antcall target="createreport"/>
</target>
<target name="test:externalra" description="run JUnit External RA test." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/externalra" target="test" />
<antcall target="createreport"/>
</target>
<target name="test:externalra-scep" description="run JUnit stand-alone SCEP External RA tests" depends="deleteDirectories">
<echo message="Hint: use the ant-target 'test:externalra-scep.setuptest' to setup a proper testing environment for this test."/>
<ant antfile="build.xml" dir="modules/externalra-scep" target="test" />
<antcall target="createreport"/>
</target>
<target name="test:externalra-scep.setuptest" description="setup some a basic environment for the stand-alone SCEP External RA tests" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/externalra-scep" target="setuptest" />
<antcall target="createreport"/>
</target>
<target name="test:dbschema" description="run JUnit test to validate the schema of the configured database" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/ejbca-entity" target="test-dbschema" />
<antcall target="createreport"/>
</target>
<target name="test:statedump" description="run JUnit Statedump test." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/statedump" target="test" />
<antcall target="createreport"/>
</target>
<target name="test:ct" description="run JUnit Certificate Transparency test." depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/ct" target="test" />
<antcall target="createreport"/>
</target>
<target name="test:pc" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/peerconnector" target="test" />
<antcall target="createreport"/>
</target>
<target name="test:vapub" depends="deleteDirectories">
<ant antfile="build.xml" dir="modules/va" target="test" />
<antcall target="createreport"/>
</target>
<target name="createreport">
<junitreport todir="${reports.dir}">
<fileset dir="${reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.dir}/html" />
</junitreport>
<echo message="" />
<echo message="Results are available in file://${reports.dir}/html/index.html" />
</target>
</project>