-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild_security.xml
483 lines (418 loc) · 20.6 KB
/
build_security.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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
<project name="topcoder" default="main" basedir=".">
<property environment="env"/>
<property name="Name" value="TopCoder"/>
<property name="build" value="build"/>
<property name="war.dir" value="${build}/wars"/>
<property name="ear.dir" value="${build}/ears"/>
<property name="sar.dir" value="${build}/sars"/>
<property name="ejb_jars" value="${build}/ejb_jars"/>
<property name="classes" value="${build}/classes"/>
<property name="testclasses" value="${build}/testcases"/>
<property name="global-dist.dir" value="${basedir}/../dist/artifacts"/>
<property name="external.jars.dir" location="../external-artifacts"/>
<property name="build.javadocs" value="${build}/javadocs"/>
<property name="lib.dir" value="lib"/>
<property name="jars.dir" value="${lib.dir}/jars"/>
<property name="bin" value="lib/bin"/>
<property name="src.dir" value="src"/>
<property name="java" value="${src.dir}/main"/>
<property name="shared.build" value="${basedir}/../shared"/>
<property name="shared" value="../shared/src/main"/>
<property name="testjava" value="${src.dir}/testcases"/>
<property name="resources" value="resources"/>
<property name="conf" value="conf"/>
<property name="taglib" value="${resources}/taglib"/>
<property name="images" value="images"/>
<property name="shared.jar" value="${bin}/shared.jar"/>
<property name="common.jar" value="${bin}/tcwebcommon.jar"/>
<property name="tccache.jar" value="${jars.dir}/tcs/tc_cache/1.0.0/tc_cache.jar"/>
<property name="web" value="src/main/com/topcoder/web"/>
<property name="jboss_home" value="${env.JBOSS_HOME}"/>
<property name="jboss_deploy" value="${jboss_home}/server/security/deploy"/>
<property name="jboss_lib" value="${jboss_home}/server/security/lib"/>
<property name="jboss_conf" value="${jboss_home}/server/security/conf"/>
<property name="security_groups_conf" value="${resources}/security_groups/conf" />
<property name="deprecation" value="true"/>
<property name="debug" value="true"/>
<property name="junitsummary" value="on"/>
<property file="securityGroups.properties" />
<property name="hibernate" value="${jars.dir}/hibernate-3.6.8" />
<property name="spring" value="${jars.dir}/spring3.0.5" />
<property name="test_file.dir" value="test_files" />
<property name="security_groups_test_lib.dir" value="${test_file.dir}/test_libs" />
<property name="informix.jdbc.jar" value="${security_groups_test_lib.dir}/ifxjdbc.jar" />
<target name="main" depends="compile">
</target>
<path id="class.path">
<pathelement location="${classes}"/>
<pathelement location="${shared.jar}"/>
<pathelement location="${tccache.jar}"/>
<pathelement location="${testclasses}"/>
<pathelement location="${resources}"/>
<pathelement location="${resources}/hibernate"/>
<pathelement location="${images}"/>
<pathelement location="${jars.dir}/log4j-1.2.7.jar"/>
<pathelement location="${jars.dir}/ifxjdbc.jar"/>
<pathelement location="${jars.dir}/bfograph.jar"/>
<pathelement location="${jars.dir}/activation.jar"/>
<pathelement location="${jars.dir}/jboss/javax.servlet.jar"/>
<pathelement location="${jars.dir}/jboss/javax.servlet.jsp.jar"/>
<pathelement location="${jars.dir}/jboss/jbossall-client.jar"/>
<pathelement location="${jars.dir}/jboss/xalan.jar"/>
<pathelement location="${jars.dir}/jboss/xercesImpl.jar"/>
<pathelement location="${jars.dir}/jboss/xml-apis.jar"/>
<pathelement location="${jars.dir}/jboss/mail.jar"/>
<pathelement location="${jars.dir}/jboss/jboss-system.jar"/>
<pathelement location="${jars.dir}/jboss/jboss-cache.jar"/>
<pathelement location="${jars.dir}/jboss/jgroups.jar"/>
<pathelement location="${jars.dir}/jboss/scheduler-plugin.jar"/>
<!-- TCS Components -->
<pathelement location="${jars.dir}/tcs/configuration_api/1.1.0/configuration_api.jar"/>
<pathelement location="${jars.dir}/tcs/configuration_manager/2.1.5/configuration_manager.jar"/>
<pathelement location="${jars.dir}/tcs/configuration_persistence/1.0.2/configuration_persistence.jar"/>
<pathelement location="${jars.dir}/tcs/document_generator/3.1.0/document_generator.jar"/>
<pathelement location="${jars.dir}/tcs/email_engine/3.2.0/email_engine.jar"/>
<pathelement location="${jars.dir}/object_formatter.jar"/>
<pathelement location="${jars.dir}/tcs/id_generator/3.0/id_generator.jar"/>
<pathelement location="${jars.dir}/tcs/db_connection_factory/1.0/db_connection_factory.jar"/>
<pathelement location="${jars.dir}/tcs/file_upload/2.0.2.0/file_upload.jar"/>
<pathelement location="${jars.dir}/tcs/json_object/1.0/json_object.jar"/>
<pathelement location="${jars.dir}/tcs/base_exception/2.0.0/base_exception.jar"/>
<pathelement location="${jars.dir}/tcs/typesafe_enum/1.0/typesafe_enum.jar"/>
<pathelement location="${jars.dir}/tcs/topcoder_commons_utility/1.0.0/topcoder_commons_utility.jar"/>
<!--required for aol alerts only -->
<pathelement location="${jars.dir}/tcs/alerts_wrapper/1.0/java_alerts_wrapper.jar"/>
<pathelement location="${jars.dir}/tcs/logging_wrapper.jar"/>
<pathelement location="${jars.dir}/tcs/object_factory/2.0.1/object_factory.jar"/>
<!-- LDAP SDK -->
<pathelement location="${jars.dir}/tcs/ldap_sdk_interface/1.0.2/ldap_sdk_interface.jar"/>
<pathelement location="${jars.dir}/netscape_ldap_sdk.jar"/>
<pathelement location="${jars.dir}/ldap.jar"/>
<!-- TCS Other -->
<pathelement location="${jars.dir}/tcs/catalog.jar"/>
<pathelement location="${jars.dir}/tcs/user.jar"/>
<pathelement location="${jars.dir}/tcs/topcoder_commons_utility/1.0.0/topcoder_commons_utility.jar"/>
<!-- file conversion component -->
<pathelement location="${jars.dir}/fileconvert.jar"/>
<pathelement location="${jars.dir}/httpunit.jar"/>
<pathelement location="${jars.dir}/itext-1.1.jar"/>
<pathelement location="${external.jars.dir}/jboss-4.2.2-ejb3x.jar"/>
<pathelement location="${external.jars.dir}/jboss-4.2.2-jaxws.jar"/>
<pathelement location="${external.jars.dir}/jaxb-api-jboss-4.2.2.jar"/>
<!-- Hibernate 3.6.8 -->
<pathelement location="${hibernate}/antlr-2.7.6.jar"/>
<pathelement location="${hibernate}/commons-collections-3.1.jar"/>
<pathelement location="${hibernate}/dom4j-1.6.1.jar"/>
<pathelement location="${hibernate}/hibernate3.jar"/>
<pathelement location="${hibernate}/javassist-3.12.0.GA.jar"/>
<pathelement location="${hibernate}/jta-1.1.jar"/>
<pathelement location="${hibernate}/slf4j-api-1.6.1.jar"/>
<pathelement location="${hibernate}/log4j-1.2.16.jar"/>
<pathelement location="${hibernate}/slf4j-log4j12-1.6.1.jar"/>
<pathelement location="${hibernate}/commons-logging-1.1.1.jar"/>
<pathelement location="${hibernate}/cglib-nodep-2.2.2.jar"/>
<!--Spring 3.0.5 -->
<pathelement location="${spring}/org.springframework.aop-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.asm-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.aspects-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.beans-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.context.support-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.context-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.core-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.expression-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.instrument.tomcat-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.instrument-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.jdbc-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.orm-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.test-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.transaction-3.0.5.RELEASE.jar"/>
<pathelement location="${spring}/org.springframework.web-3.0.5.RELEASE.jar"/>
</path>
<!-- adding this here because i can't figure out how to use the above path element in other path elements-->
<property name="class.path" refid="class.path"/>
<target name="init">
<mkdir dir="${classes}"/>
<mkdir dir="${testclasses}"/>
<mkdir dir="${bin}"/>
<mkdir dir="${ejb_jars}"/>
<mkdir dir="${ear.dir}"/>
</target>
<target name="compile_common" depends="init" unless="compile_common_set">
<ant antfile="build_common.xml" target="build-dist"/>
<property name="compile_common_set" value="true"/>
</target>
<target name="compile" depends="init, compile_common" unless="compile_set">
<depend srcdir="${java}" destdir="${classes}" cache="${build}/cache"/>
<javac
srcdir="${java}"
destdir="${classes}"
classpathref="class.path"
deprecation="${deprecation}"
debug="${debug}"
source="1.5"
target="1.5" memoryMaximumSize="380m" memoryInitialSize="380m" fork="true">
<include name="com/topcoder/web/ejb/security/**"/>
</javac>
<property name="compile_set" value="true"/>
</target>
<target name="clean">
<!-- kill the entire build dir -->
<delete dir="${build}"/>
<delete dir="${bin}"/>
<ant dir="${shared.build}" target="clean"/>
</target>
<target name="package-EJB-SecurityBean" depends="compile">
<jar jarfile="${ejb_jars}/Security.jar">
<zipfileset dir="${classes}" includes="com/topcoder/web/ejb/security/*.class"/>
</jar>
</target>
<target name="deploy" depends="compile, package-EJB-SecurityBean, build-ejbs, build-security">
<antcall target="expand"/>
</target>
<target name="expand">
<antcall target="move-libs"/>
<antcall target="move-conf"/>
<antcall target="deploy-security"/>
<copy todir="${jboss_deploy}">
<fileset dir="${ejb_jars}">
<include name="Security.jar"/>
<include name="User.jar"/>
<include name="Email.jar"/>
</fileset>
</copy>
</target>
<target name="move-conf">
<copy todir="${jboss_conf}">
<fileset dir="${resources}">
<include name="ApplicationServer.properties"/>
<include name="DBMS.properties"/>
<include name="cache.properties"/>
<include name="LDAP.properties"/>
</fileset>
</copy>
<mkdir dir="${jboss_conf}/com/topcoder/security"/>
<mkdir dir="${jboss_conf}/com/topcoder/util/config"/>
<copy todir="${jboss_conf}/com/topcoder/security">
<fileset dir="${resources}/com/topcoder/security">
<include name="Util.properties"/>
</fileset>
</copy>
<copy todir="${jboss_conf}/com/topcoder/util/config">
<fileset dir="${resources}/com/topcoder/util/config">
<include name="ConfigManager.properties"/>
</fileset>
</copy>
</target>
<target name="move-libs">
<copy todir="${jboss_lib}">
<fileset dir="${bin}">
<include name="tcwebcommon.jar"/>
</fileset>
</copy>
<copy todir="${jboss_lib}" file="${shared.jar}"/>
<copy todir="${jboss_lib}" file="${tccache.jar}"/>
<copy todir="${jboss_lib}" file="${jars.dir}/jedis-2.8.1.jar" />
<copy todir="${jboss_lib}" file="${jars.dir}/commons-pool2-2.4.2.jar" />
<copy todir="${jboss_lib}">
<fileset dir="${ejb_jars}">
<include name="security.jar"/>
</fileset>
</copy>
<copy todir="${jboss_lib}">
<fileset dir="${external.jars.dir}">
<include name="ifxjdbc-3.00.JC3.jar"/>
<include name="configuration_manager-2.1.5.jar"/>
<include name="id_generator-3.0.0.jar"/>
</fileset>
<fileset dir="${jars.dir}">
<include name="netscape_ldap_sdk.jar"/>
<include name="ldap.jar"/>
</fileset>
<fileset dir="${jars.dir}/tcs/ldap_sdk_interface/1.0.2">
<include name="ldap_sdk_interface.jar"/>
</fileset>
</copy>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/base_exception/2.0.0/base_exception.jar"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/topcoder_commons_utility/1.0.0/topcoder_commons_utility.jar"/>
</target>
<target name="deploy-security">
<copy todir="${jboss_deploy}">
<fileset dir="${ear.dir}">
<include name="security.ear"/>
</fileset>
</copy>
</target>
<target name="build-security" depends="compile_common">
<javac
srcdir="${java}"
destdir="${classes}"
classpathref="class.path"
deprecation="${deprecation}"
debug="${debug}"
source="1.5"
target="1.5"
>
<include name="com/topcoder/security/**"/>
</javac>
<jar jarfile="${ejb_jars}/security.jar">
<zipfileset dir="${classes}" includes="com/topcoder/security/**"/>
<zipfileset dir="${classes}" includes="com/topcoder/shared/util/logging/**"/>
<metainf dir="${resources}/security/conf" includes="*.xml" excludes="application.xml"/>
</jar>
<ear earfile="${ear.dir}/security.ear" appxml="${resources}/security/conf/application.xml">
<fileset dir="${jars.dir}">
<include name="configmanager2.jar"/>
</fileset>
<fileset dir="${jars.dir}/tcs/id_generator/3.0">
<include name="id_generator.jar"/>
</fileset>
<fileset dir="${jars.dir}/tcs/base_exception/2.0.0">
<include name="base_exception.jar"/>
</fileset>
<fileset dir="${jars.dir}/tcs/db_connection_factory/1.0">
<include name="db_connection_factory.jar"/>
</fileset>
<fileset dir="${ejb_jars}">
<include name="security.jar"/>
</fileset>
</ear>
</target>
<target name="build-ejbs">
<ant antfile="build_tc.xml" target="package-EJB-UserBean"/>
<ant antfile="build_tc.xml" target="package-EJB-EmailBean"/>
</target>
<target name="compile_tests" depends="compile">
<javac srcdir="${testjava}" destdir="${testclasses}"
classpathref="class.path"
deprecation="${deprecation}"
debug="${debug}">
<include name="com/topcoder/web/ejb/security/**"/>
</javac>
</target>
<target name="run_tests" depends="compile_tests" description="run junit tests">
<junit printsummary="${junitsummary}" fork="yes">
<classpath>
<pathelement location="${classes}"/>
<pathelement location="${shared.jar}"/>
<pathelement location="${tccache.jar}"/>
<pathelement location="${testclasses}"/>
<pathelement location="${resources}"/>
<pathelement location="${jars.dir}/axis.jar"/>
<pathelement location="${external.jars.dir}/log4j-1.2.13.jar"/>
<pathelement location="${external.jars.dir}/jboss-jaxrpc-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jboss-saaj-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jboss-common-client-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/commons-logging-1.1.jar"/>
<pathelement location="${external.jars.dir}/wsdl4j-1.6.2.jar"/>
<pathelement location="${external.jars.dir}/jbossws-client-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jbossws-spi-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jboss-jaxws-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jbossall-client-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/jbossws-common-4.2.2.jar"/>
<pathelement location="${external.jars.dir}/xalan-2.6.0.jar"/>
<pathelement location="${external.jars.dir}/xerces-2.6.2.jar"/>
<pathelement location="${external.jars.dir}/xml-apis-2.6.2.jar"/>
<pathelement location="${external.jars.dir}/activation-1.1.jar"/>
<pathelement location="${external.jars.dir}/mail-1.4.0.jar"/>
<!--
<jboss-home>\client\axis-ws4ee.jar
-->
</classpath>
<formatter type="xml"/>
<test name="com.topcoder.web.ejb.security.AuthorizationTests" todir="${testclasses}"/>
</junit>
<junitreport todir="${testclasses}">
<fileset dir="${testclasses}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${testclasses}/html"/>
</junitreport>
</target>
<!-- Below is for Security Groups -->
<target name="packageSecurityGroups" depends="build-security">
<delete file="${jars.dir}/tcs/topcoder_security_groups.jar" />
<echo message="Start to package security group" />
<jar jarfile="${jars.dir}/tcs/topcoder_security_groups.jar">
<zipfileset dir="${classes}" includes="com/topcoder/security/groups/**" />
<metainf dir="${security_groups_conf}" includes="*.xml" excludes="securityGroupsApplicationContext.xml" />
</jar>
</target>
<!-- Unit Test for SecurityGroups -->
<macrodef name="securityGroupsTestSetup">
<sequential>
<sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}" src="${test_file.dir}/sql/time_oltp_test_data.sql">
<classpath>
<pathelement location="${informix.jdbc.jar}"/>
</classpath>
</sql>
</sequential>
</macrodef>
<macrodef name="securityGroupsTestTearDown">
<sequential>
<sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}" src="${test_file.dir}/sql/time_oltp_test_data_clean_up.sql">
<classpath>
<pathelement location="${informix.jdbc.jar}"/>
</classpath>
</sql>
</sequential>
</macrodef>
<path id="junit4.8">
<fileset dir="${jars.dir}/junit4.8">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.path">
<fileset dir="${security_groups_test_lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="compileSecurityGroupsUnitTest">
<antcall target="packageSecurityGroups" />
<echo message="Compile Security Groups Unit Test"></echo>
<mkdir dir="${build}/tests"/>
<javac srcdir="${src.dir}/tests" destdir="${build}/tests">
<include name="com/topcoder/security/groups/**"/>
<classpath refid="junit4.8" />
<classpath refid="class.path" />
</javac>
</target>
<target name="runSecurityGroupsUnitTest">
<antcall target="compileSecurityGroupsUnitTest" />
<echo message="Prepare test data" />
<echo message="Cleaning possible test data" />
<securityGroupsTestTearDown/>
<echo message="Inserting sample test data" />
<securityGroupsTestSetup/>
<echo message="Test data setup successfully" />
<echo message="Run Unit Test of Security Unit Test" />
<tstamp />
<delete dir="${build}/report" />
<mkdir dir="${build}/report/data"/>
<junit printsummary="true">
<jvmarg value="-ea"/>
<jvmarg value="-esa"/>
<formatter type="xml"/>
<classpath refid="class.path" />
<classpath refid="junit4.8" />
<classpath refid="test.path" />
<classpath path="${build}/tests" />
<classpath path="${test_file.dir}/security_groups" />
<batchtest fork="true" todir="${build}/report/data">
<fileset dir="${src.dir}/tests">
<include name="com/topcoder/security/groups/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${build}/report">
<fileset dir="${build}/report/data">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${build}/report"/>
</junitreport>
<echo message="Unit test completes! Prepare to clean up test data" />
<securityGroupsTestTearDown/>
<echo message="All test data cleaned up!" />
<echo message="All is finished" />
</target>
<!-- End of Security Group -->
</project>