/
build.xml
179 lines (147 loc) · 6.29 KB
/
build.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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!DOCTYPE project [
<!ENTITY commonSetup SYSTEM "./../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "./../../../../config/common.xml">
<!ENTITY commonRun SYSTEM "./../../../../config/run.xml">
<!ENTITY reporting SYSTEM "./../../../../config/report.xml">
<!ENTITY eeCommon SYSTEM "file:./../ee.xml">
<!ENTITY testproperties SYSTEM "file:./build.properties">
]>
<project name="tx-ee-timer-with-autorecovery" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&commonRun;
&eeCommon;
&testproperties;
&reporting;
<target name="all" depends="build,setup,run,unsetup,dev-report"/>
<target name="test" depends="build,setup-test,run,unsetup-test"/>
<target name="setup" depends="init-common">
<antcall target="clean-results"/>
<antcall target="start-derby"/>
<ant target="start-domain"/>
<ant target="setup-test"/>
</target>
<target name="setup-test" depends="init-common">
<antcall target="setup-database"/>
<antcall target="setup-cluster"/>
</target>
<target name="setup-database" depends="init-common">
<antcall target="setup-xa-database-common">
<param name="pool.name" value="jdbc-xa-pool"/>
<param name="resource.name" value="jdbc/xa"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
value="configs.config.default-config.ejb-container.ejb-timer-service.timer-datasource=jdbc/xa"/>
</antcall>
<antcall target="execute-ejb-sql-common">
<param name="sql.file" value="sql/create.sql"/>
</antcall>
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/create.sql"/>
<param name="db.url" value="jdbc:derby://localhost:${db.port}/${db.name};create=true;"/>
</antcall>
</target>
<target name="setup-cluster" depends="init-common">
<echo message="Starting cluster"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/target/report-builder.jar:${build.classes.dir}:${mvn.lib.dir}/reporter.jar"
classname="${se.client}">
<arg line="prepare"/>
<arg line="${assemble.dir}/${appname}-web.war"/>
<sysproperty key="enableShoalLogger" value="${enableShoalLogger}"/>
</java>
</target>
<target name="unsetup-test" depends="init-common">
<antcall target="save-logs"/>
<antcall target="unsetup-cluster"/>
<antcall target="unsetup-database"/>
</target>
<target name="unsetup" depends="init-common">
<antcall target="unsetup-test"/>
<antcall target="stop-derby"/>
<ant target="stop-domain"/>
</target>
<target name="unsetup-database" depends="init-common">
<antcall target="execute-ejb-sql-common">
<param name="sql.file" value="sql/drop.sql"/>
</antcall>
<antcall target="execute-sql-common">
<param name="sql.file" value="sql/drop.sql"/>
<param name="db.url" value="jdbc:derby://localhost:${db.port}/${db.name};create=true;"/>
</antcall>
<antcall target="delete-jdbc-resource-common">
<param name="jdbc.resource.name" value="jdbc/xa"/>
</antcall>
<antcall target="delete-jdbc-connpool-common">
<param name="jdbc.conpool.name" value="jdbc-xa-pool"/>
</antcall>
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
value="configs.config.default-config.ejb-container.ejb-timer-service.timer-datasource="/>
</antcall>
</target>
<target name="run" depends="init-common">
<antcall target="run-recover"/>
</target>
<target name="run-recover" depends="init-common">
<antcall target="insert-data">
<param name="operation" value="create_timer"/>
</antcall>
<parallel>
<antcall target="insert-data">
<param name="operation" value="insert_xa_data"/>
</antcall>
<antcall target="kill-instance"/>
</parallel>
<!-- Let GMS do the work -->
<sleep seconds="135"/>
<echo message="Verifying results"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/target/report-builder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="verify_xa"/>
<arg line="${appname}-web"/>
<arg line="in2"/>
<arg line="recover"/>
</java>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="start-local-instance"/>
<arg line="in1"/>
</exec>
</target>
<target name="kill-instance">
<sleep seconds="20"/>
<exec executable="./kill_instance.sh" failonerror="true">
<arg line="in1"/>
</exec>
</target>
<target name="insert-data">
<echo message="Executing test on in1"/>
<java fork="on"
failonerror="true"
classpath="${env.S1AS_HOME}/lib/jakartaee.jar:${env.S1AS_HOME}/lib/gf-client.jar:${env.APS_HOME}/lib/target/report-builder.jar:${build.classes.dir}"
classname="${se.client}">
<arg line="${operation}"/>
<arg line="${appname}-web"/>
<arg line="in1"/>
</java>
</target>
</project>