Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Commit ccacf87

Browse files
Kokil Jainarindam-bandyopadhyay
authored andcommitted
NoBug: Create a new test suite in CI pipeline for web services tests (#22057)
1 parent b1a2f4b commit ccacf87

File tree

2,874 files changed

+110750
-57126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,874 files changed

+110750
-57126
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<!--
2+
3+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4+
5+
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
6+
7+
The contents of this file are subject to the terms of either the GNU
8+
General Public License Version 2 only ("GPL") or the Common Development
9+
and Distribution License("CDDL") (collectively, the "License"). You
10+
may not use this file except in compliance with the License. You can
11+
obtain a copy of the License at
12+
https://oss.oracle.com/licenses/CDDL+GPL-1.1
13+
or LICENSE.txt. See the License for the specific
14+
language governing permissions and limitations under the License.
15+
16+
When distributing the software, include this License Header Notice in each
17+
file and include the License file at LICENSE.txt.
18+
19+
GPL Classpath Exception:
20+
Oracle designates this particular file as subject to the "Classpath"
21+
exception as provided by Oracle in the GPL Version 2 section of the License
22+
file that accompanied this code.
23+
24+
Modifications:
25+
If applicable, add the following below the License Header, with the fields
26+
enclosed by brackets [] replaced by your own identifying information:
27+
"Portions Copyright [year] [name of copyright owner]"
28+
29+
Contributor(s):
30+
If you wish your version of this file to be governed by only the CDDL or
31+
only the GPL Version 2, indicate your decision by adding "[Contributor]
32+
elects to include this software in this distribution under the [CDDL or GPL
33+
Version 2] license." If you don't indicate a single choice of license, a
34+
recipient has the option to distribute your version of this file under
35+
either the CDDL, the GPL Version 2 or to extend the choice of license to
36+
its licensees as provided above. However, if you add GPL Version 2 code
37+
and therefore, elected the GPL Version 2 license, then the option applies
38+
only if the new code is made subject to such option by the copyright
39+
holder.
40+
41+
-->
42+
43+
<property environment="env"/>
44+
<property file="${env.APS_HOME}/config.properties"/>
45+
46+
<target name="all" depends="clean, compile, run, undeploy, report"/>
47+
48+
<target name="clean">
49+
<delete dir="${env.APS_HOME}/build/module/classes"/>
50+
</target>
51+
52+
<path id="classpath">
53+
<fileset dir="${env.S1AS_HOME}/modules">
54+
<include name="*.jar"/>
55+
</fileset>
56+
<fileset dir="${env.S1AS_HOME}/modules/endorsed">
57+
<include name="*.jar"/>
58+
</fileset>
59+
<fileset dir="${env.APS_HOME}/lib">
60+
<include name="*.jar"/>
61+
</fileset>
62+
</path>
63+
64+
65+
<target name="compile">
66+
<mkdir dir="${env.APS_HOME}/build/module/classes"/>
67+
<basename file="${src-name}" property="server" suffix=".java"/>
68+
<dirname file="${src-name}" property="directory"/>
69+
<basename file="${directory}" property="pkg-name"/>
70+
<property name="class-name" value="${pkg-name}/${server}.class"/>
71+
<echo message="Compiling into ${pkg-name}/${server}.class"/>
72+
<javac srcdir="." destdir="${env.S1AS_HOME}/domains/domain1/autodeploy"
73+
includes="${src-name}">
74+
<classpath refid="classpath"/>
75+
</javac>
76+
</target>
77+
78+
<target name="compile-client">
79+
<javac srcdir="." destdir="${env.APS_HOME}/build/module/classes"
80+
classpath="${env.APS_HOME}/lib/reporter.jar:${env.S1AS_HOME}/lib/j2ee.jar:${env.S1AS_HOME}/lib/webservices-rt.jar:${env.S1AS_HOME}/lib/webservices-tools.jar"
81+
includes="${client-src-name}"/>
82+
</target>
83+
84+
<target name="deploy">
85+
<antcall target="compile"/>
86+
</target>
87+
88+
<target name="undeploy">
89+
<basename file="${src-name}" property="server" suffix=".java"/>
90+
<dirname file="${src-name}" property="directory"/>
91+
<basename file="${directory}" property="pkg-name"/>
92+
<property name="class-name" value="${pkg-name}/${server}.class"/>
93+
<echo message="Removing file ${class-name} from autodeploy directory"/>
94+
<delete file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}"/>
95+
<waitfor maxwait="100" maxwaitunit="second">
96+
<or>
97+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_undeployed"/>
98+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_undeployFailed"/>
99+
</or>
100+
</waitfor>
101+
<condition property="undeploy_succeeded">
102+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_undeployed"/>
103+
</condition>
104+
<condition property="undeploy_failed">
105+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_undeployFailed"/>
106+
</condition>
107+
</target>
108+
109+
<target name="report" depends="internal-report-success, internal-report-failure">
110+
<delete file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_*"/>
111+
</target>
112+
113+
<target name="run">
114+
<waitfor maxwait="100" maxwaitunit="second">
115+
<or>
116+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_deployed"/>
117+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_deployFailed"/>
118+
</or>
119+
</waitfor>
120+
<condition property="deploy_succeeded">
121+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_deployed"/>
122+
</condition>
123+
<condition property="deploy_failed">
124+
<available file="${env.S1AS_HOME}/domains/domain1/autodeploy/${class-name}_deployFailed"/>
125+
</condition>
126+
<antcall target="internal-run"/>
127+
<antcall target="internal-report-failure"/>
128+
</target>
129+
130+
131+
132+
<target name="internal-run" if="deploy_succeeded">
133+
<basename file="${client-src-name}" property="client" suffix=".java"/>
134+
<dirname file="${client-src-name}" property="client-directory"/>
135+
<basename file="${client-directory}" property="client-pkg-name"/>
136+
<property name="client-class-name" value="${client-pkg-name}/${client}.class"/>
137+
<echo message="wsimporting http://${http.host}:${http.port}/${server}/${server}Service?WSDL"/>
138+
<exec executable="${env.S1AS_HOME}/bin/wsimport">
139+
<arg line="-keep -d ${env.APS_HOME}/build/module/classes http://${http.host}:${http.port}/${server}/${server}Service?WSDL"/>
140+
</exec>
141+
<antcall target="compile-client"/>
142+
<echo message="Running appclient with ${client-pkg-name}.${client}"/>
143+
<unjar src="${env.APS_HOME}/lib/reporter.jar" dest="${env.APS_HOME}/build/module/classes"/>
144+
<exec executable="${env.S1AS_HOME}/bin/appclient" dir="${env.APS_HOME}/build/module/classes">
145+
<arg value="${client-pkg-name}.${client}"/>
146+
</exec>
147+
</target>
148+
149+
<target name="internal-report-success" if="undeploy_succeeded">
150+
<antcall target="report-success"/>
151+
</target>
152+
153+
<target name="internal-report-failure" if="undeploy_failed, deploy_failed">
154+
<antcall target="report-failure"/>
155+
</target>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
5+
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
6+
7+
Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
8+
9+
The contents of this file are subject to the terms of either the GNU
10+
General Public License Version 2 only ("GPL") or the Common Development
11+
and Distribution License("CDDL") (collectively, the "License"). You
12+
may not use this file except in compliance with the License. You can
13+
obtain a copy of the License at
14+
https://oss.oracle.com/licenses/CDDL+GPL-1.1
15+
or LICENSE.txt. See the License for the specific
16+
language governing permissions and limitations under the License.
17+
18+
When distributing the software, include this License Header Notice in each
19+
file and include the License file at LICENSE.txt.
20+
21+
GPL Classpath Exception:
22+
Oracle designates this particular file as subject to the "Classpath"
23+
exception as provided by Oracle in the GPL Version 2 section of the License
24+
file that accompanied this code.
25+
26+
Modifications:
27+
If applicable, add the following below the License Header, with the fields
28+
enclosed by brackets [] replaced by your own identifying information:
29+
"Portions Copyright [year] [name of copyright owner]"
30+
31+
Contributor(s):
32+
If you wish your version of this file to be governed by only the CDDL or
33+
only the GPL Version 2, indicate your decision by adding "[Contributor]
34+
elects to include this software in this distribution under the [CDDL or GPL
35+
Version 2] license." If you don't indicate a single choice of license, a
36+
recipient has the option to distribute your version of this file under
37+
either the CDDL, the GPL Version 2 or to extend the choice of license to
38+
its licensees as provided above. However, if you add GPL Version 2 code
39+
and therefore, elected the GPL Version 2 license, then the option applies
40+
only if the new code is made subject to such option by the copyright
41+
holder.
42+
43+
-->
44+
<!DOCTYPE project [
45+
<!ENTITY commonSetup SYSTEM "file:./../../../../config/properties.xml">
46+
<!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml">
47+
<!ENTITY commonRun SYSTEM "file:./../../../../config/run.xml">
48+
<!ENTITY jaxwsTools SYSTEM "file:./../jaxwstools.xml">
49+
<!ENTITY testproperties SYSTEM "file:./build.properties">
50+
]>
51+
52+
<project name="asyncservice" default="all" basedir=".">
53+
54+
&commonSetup;
55+
&commonBuild;
56+
&commonRun;
57+
&testproperties;
58+
&jaxwsTools;
59+
60+
<target name="all" depends="clean, setup, runclient, undeploy"/>
61+
62+
<target name="clean" depends="init-common">
63+
<antcall target="clean-common"/>
64+
</target>
65+
66+
<target name="setup" depends="assemble-web, deploy-app, assemble-client"/>
67+
68+
<target name="compile" depends="init-common">
69+
<antcall target="compile-common">
70+
<param name="src" value="endpoint"/>
71+
</antcall>
72+
</target>
73+
74+
<target name="assemble-web" depends="init-common, compile">
75+
<antcall target="pkg-war">
76+
<param name="war.classes" value="${build.classes.dir}"/>
77+
<param name="war.file" value="${assemble.dir}/${appname}-web.war"/>
78+
</antcall>
79+
</target>
80+
81+
<target name="assemble-client" depends="init-common">
82+
<mkdir dir="${build.classes.dir}/client"/>
83+
<echo message="wsimporting http://${http.host}:${http.port}/${appname}/webservice/AsyncService?WSDL"/>
84+
<replace file="custom-client.xml" value="${http.host}" token="HTTP_HOST"/>
85+
<replace file="custom-client.xml" value="${http.port}" token="HTTP_PORT"/>
86+
<antcall target="wsimport">
87+
<param name="wsimport.args"
88+
value="-keep -b custom-client.xml -d ${build.classes.dir}/client http://${http.host}:${http.port}/${appname}/webservice/AsyncService?WSDL"/>
89+
</antcall>
90+
<javac srcdir="." destdir="${build.classes.dir}/client"
91+
classpath="${env.APS_HOME}/lib/reporter.jar:${env.S1AS_HOME}/lib/j2ee.jar:${env.S1AS_HOME}/lib/webservices-rt.jar:${env.S1AS_HOME}/lib/webservices-tools.jar"
92+
includes="client/**"/>
93+
</target>
94+
95+
<target name="deploy-app">
96+
<antcall target="deploy-war-common">
97+
<param name="contextroot" value="${appname}"/>
98+
</antcall>
99+
</target>
100+
101+
<target name="undeploy" depends="init-common">
102+
<antcall target="undeploy-war-common"/>
103+
</target>
104+
105+
<target name="runclient">
106+
<antcall target="run-client">
107+
<param name="client-class" value="client.Client"/>
108+
<param name="other-args" value="async-web-svc-test"/>
109+
</antcall>
110+
111+
112+
<!--restore the tokens back in file-->
113+
<replace file="custom-client.xml" token="${http.host}" value="HTTP_HOST"/>
114+
<replace file="custom-client.xml" token="${http.port}" value="HTTP_PORT"/>
115+
</target>
116+
</project>
117+

0 commit comments

Comments
 (0)