View | Details | Raw Unified | Return to bug 294174
Collapse All | Expand All

(-)jpa/eclipselink.jpa.test/netweaver.properties (+60 lines)
Line 0 Link Here
1
# NetWeaver Server Testing Environment Properties.
2
3
4
###############################################
5
# User must adapt these properties 
6
###############################################
7
8
# installation directory of the NetWeaver Java instance
9
netweaver.instance.dir=c:/usr/sap/L36/J36
10
11
# user and password defined during installation
12
server.user=Administrator
13
server.pwd=abcd1234
14
15
# host and port for the NetWeaver server; defined during installation
16
netweaver.host=localhost
17
netweaver.port=53604
18
19
# JDBC driver to use for testing
20
# note that the driver must already be deployed on the system, e.g. via telnet
21
# > add dbpool
22
# > deploy_jdbc_driver <driver-name> <driver_archive>
23
netweaver.datasource.driver.deployname=mysql_driver
24
25
# configure the data source to use for testing
26
netweaver.datasource.name=LOCAL_MYSQL_DS
27
netweaver.datasource.driver.class=com.mysql.jdbc.Driver
28
netweaver.datasource.url=jdbc:mysql://localhost/el
29
netweaver.datasource.user=me
30
netweaver.datasource.password=abcd1234
31
32
###############################################
33
# User may change these properties
34
###############################################
35
36
# name of the SDA file (without .sda extension) containing required libraries (e.g. eclipselink.jar)
37
netweaver.eclipselink.app=servertest_eclipselink
38
39
# name of the SDA file (without .sda extension) containing the test datasource
40
netweaver.datasource.app=servertest_datasource
41
42
43
####################################
44
# DO NOT CHANGE
45
####################################
46
server.testrunner=JavaEE/servertest/REMOTE/TestRunner/org.eclipse.persistence.testing.framework.server.TestRunner
47
server.lib=${netweaver.instance.dir}/j2ee/j2eeclient
48
#server.platform=NetWeaver_7_1
49
server.platform=org.eclipse.persistence.platform.server.sap.SAPNetWeaver_7_1_Platform
50
server.platform.class=netweaver-71-platform
51
server.factory=com.sap.engine.services.jndi.InitialContextFactoryImpl
52
server.url=${netweaver.host}:${netweaver.port}/
53
server.depend=sap.com~tc~je~clientlib~impl.jar,sap.com~tc~logging~java~impl.jar,sap.com~tc~exception~impl.jar
54
55
# NetWeaver specific properties.
56
netweaver.clientlib.dir=${server.lib}
57
netweaver.deployment.dir=${netweaver.instance.dir}/j2ee/deployment
58
netweaver.deployment.ant.dir=${netweaver.deployment.dir}/ant/lib
59
eclipselink.home=../..
60
extensions.home=../../../incubator/extensions/trunk
(-)jpa/eclipselink.jpa.test/netweaver.xml (+174 lines)
Line 0 Link Here
1
<!--/*******************************************************************************
2
* This program and the accompanying materials are made available under the 
3
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
* which accompanies this distribution. 
5
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
6
* and the Eclipse Distribution License is available at 
7
* http://www.eclipse.org/org/documents/edl-v10.php.
8
*
9
*   Ant naming conventions:
10
*   - regardless of the actual OS platform,'/' is the directory separator
11
*     (Ant will convert as appropriate).
12
*   - multi-word properties use periods '.'
13
*   - multi-word targets use hyphens '-' 
14
*   - multi-word macros use underscores '_'
15
*   - multi-word macro attributes are concatinated
16
*     e.g. 'runpathref'  
17
*   - multi-word tasks (taskdef) names are concatinated
18
*     e.g. 'validateconnection'
19
*   - OS environment variables are in ALLCAPS and have 'env' as a prefix
20
*     e.g. ${env.XXX}.
21
*   - Ant properties are lower case.
22
*
23
* Contributors:
24
*     ??? - initial implementation
25
#******************************************************************************/-->
26
27
<!-- This ant project includes the following tasks:
28
        - netweaver-setup    : packs an application containing eclipselink.jar and other required libraries and deploys it to the server
29
        - netweaver-reset    : undeploys the application containing eclipselink.jar
30
        - netweaver-deploy   : adds NetWeaver specific resources and deploys ear
31
        - netweaver-undeploy : undeploys ear
32
-->
33
34
<project name="Eclipse Persistence Services JPA NetWeaver Testing" basedir=".">
35
36
    <!-- Allows a user to overide certain user specific properties. -->
37
    <property file="${user.home}/netweaver.properties"/>
38
    <property file="./netweaver.properties"/>
39
    
40
    <property name="cpath" value="${netweaver.deployment.ant.dir}/tc~je~dc_ant.jar: 
41
                                  ${netweaver.clientlib.dir}/sap.com~tc~exception~impl.jar:
42
                                  ${netweaver.clientlib.dir}/sap.com~tc~je~clientlib~impl.jar:
43
                                  ${netweaver.clientlib.dir}/sap.com~tc~logging~java~impl.jar:
44
                                  ${netweaver.deployment.dir}/lib/sap.com~tc~je~deployment14~impl.jar"/>
45
	
46
    <taskdef name="sapdeploy" classname="com.sap.engine.services.dc.ant.deploy.SAPDeploy" classpath="${cpath}"/>
47
    <taskdef name="sapundeploy" classname="com.sap.engine.services.dc.ant.undeploy.SAPUndeploy" classpath="${cpath}"/>
48
 
49
    <condition property="netweaver.deployment.script.suffix" value="csh" else="${suffix}">
50
        <and>
51
            <isset property="is.unix"/>
52
            <available file="${netweaver.deployment.dir}/scripts/make_SDA.csh"/>
53
        </and>
54
    </condition>
55
56
    <macrodef name="make_sda">
57
        <attribute name="source" />
58
        <attribute name="target" />
59
        <sequential>
60
            <exec executable="${netweaver.deployment.dir}/scripts/make_SDA.${netweaver.deployment.script.suffix}" dir="${netweaver.deployment.dir}/scripts" failonerror="true">
61
                <arg value="@{source}"/>
62
                <arg value="-d"/>
63
                <arg value="@{target}"/>
64
            </exec>
65
        </sequential>
66
    </macrodef>
67
68
69
70
    <target name="netweaver-install">
71
       <echo message="*** build target netweaver-install - nothing done ***"/>
72
    </target>
73
74
75
    <target name="netweaver-start">
76
       <echo message="*** build target netweaver-start - nothing done ***"/>
77
    </target>
78
79
80
    <target name="netweaver-setup">
81
        <mkdir dir="${eclipselink.jpa.test}/${build.dir}"/>
82
        <dirname property="basedir" file="${eclipselink.jpa.test}"/>
83
84
        <!-- pack EAR file containing eclipselink.jar and other required libraries and convert it to SDA -->
85
        <zip destfile="${eclipselink.jpa.test}/${build.dir}/${netweaver.eclipselink.app}.ear">
86
            <fileset dir="${eclipselink.home}" includes="eclipselink.jar"/>
87
            <fileset dir="${extensions.home}/org.eclipse.persistence.platform.server.netweaver" includes="*.jar"/>
88
            <fileset file="${junit.lib}"/>
89
        </zip>
90
        <make_sda source="${basedir}/${build.dir}/${netweaver.eclipselink.app}.ear" target="${basedir}/${build.dir}/${netweaver.eclipselink.app}.sda" />        
91
92
        <!-- pack EAR file containing the test datasource and convert it to SDA -->
93
        <copy overwrite="true" todir="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF">
94
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}/templates/setup/META-INF" includes="*.*"/>
95
        </copy>
96
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%data-source-name%%' value="${netweaver.datasource.name}"/>
97
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%driver-name%%' value="${netweaver.datasource.driver.deployname}"/>
98
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%driver-class-name%%' value="${netweaver.datasource.driver.class}"/>
99
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%url%%' value="${netweaver.datasource.url}"/>
100
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%user-name%%' value="${netweaver.datasource.user}"/>
101
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/setup/META-INF/data-sources.xml" token='%%password%%' value="${netweaver.datasource.password}"/>
102
        <zip destfile="${eclipselink.jpa.test}/${build.dir}/${netweaver.datasource.app}.ear">
103
            <fileset dir="${eclipselink.jpa.test}/resource/${server.name}/setup"/>
104
        </zip>
105
        <make_sda source="${basedir}/${build.dir}/${netweaver.datasource.app}.ear" target="${basedir}/${build.dir}/${netweaver.datasource.app}.sda" />
106
        
107
        <!-- deploy the SDA -->
108
        <sapdeploy versionrule="all">
109
            <saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
110
            <saperrorhandling erroraction="deploy" errorstrategy="stop"/>
111
            <fileset dir="${build.dir}" includes="${netweaver.eclipselink.app}.sda,${netweaver.datasource.app}.sda"/>
112
            <sapj2eeengine serverhost="${netweaver.host}" serverport="${netweaver.port}" username="${server.user}" userpassword="${server.pwd}"/>
113
        </sapdeploy>
114
    </target>
115
116
117
    <target name="netweaver-reset">
118
        <!-- undeploy the application containing eclipselink.jar -->
119
        <copy overwrite="true" todir="${eclipselink.jpa.test}/resource/${server.name}">
120
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}/templates/" includes="undeploy_eclipselink.txt"/>
121
        </copy>
122
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/undeploy_eclipselink.txt" token='%%eclipselink_app%%' value="${netweaver.eclipselink.app}"/>
123
        <replace file="${eclipselink.jpa.test}/resource/${server.name}/undeploy_eclipselink.txt" token='%%datasource_app%%' value="${netweaver.datasource.app}"/>
124
        <sapundeploy undeploystrategy="IfDependingStop">
125
            <saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
126
            <saperrorhandling erroraction="undeploy" errorstrategy="stop"/>
127
            <sapundeploylist listfilepath="${eclipselink.jpa.test}/resource/${server.name}/undeploy_eclipselink.txt"/>
128
            <sapj2eeengine serverhost="${netweaver.host}" serverport="${netweaver.port}" username="${server.user}" userpassword="${server.pwd}"/>
129
        </sapundeploy>        
130
    </target>
131
132
133
    <target name="netweaver-stop">
134
       <echo message="*** build target netweaver-stop - nothing done ***"/>
135
    </target>
136
137
138
    <!-- add NetWeaver specific resources to the test application ear and deploy it to the server -->
139
    <target name="netweaver-deploy">
140
        <!-- add NetWeaver specific resources to the application EAR and convert it to SDA -->
141
        <copy overwrite="true" todir="${eclipselink.jpa.test}/resource/${server.name}/META-INF">
142
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}/templates/META-INF" includes="*.*"/>
143
        </copy>
144
        <replace dir="${eclipselink.jpa.test}/resource/${server.name}/META-INF" token='%%eclipselinklib%%' value="${netweaver.eclipselink.app}"/>
145
        <replace dir="${eclipselink.jpa.test}/resource/${server.name}/META-INF" token='%%datasourcename%%' value="${netweaver.datasource.name}"/>
146
    	<ear destfile="${eclipselink.jpa.test}/${ear.name}" update="true">
147
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}" includes="META-INF/*.*"/>
148
        </ear>
149
        <dirname property="basedir" file="${eclipselink.jpa.test}"/>
150
        <echo message="ear.name=${ear.name}"/>
151
        <echo message="application.name=${application.name}"/>
152
        <make_sda source="${basedir}/${ear.name}" target="${basedir}/${build.dir}/${application.name}.sda"/>        
153
154
        <!-- deploy the SDA -->
155
        <sapdeploy versionrule="all">
156
            <saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
157
            <saperrorhandling erroraction="deploy" errorstrategy="stop"/>
158
            <fileset dir="${build.dir}" includes ="${application.name}.sda"/>
159
            <sapj2eeengine serverhost="${netweaver.host}" serverport="${netweaver.port}" username="${server.user}" userpassword="${server.pwd}"/>
160
        </sapdeploy>
161
    </target>
162
163
164
    <!-- undeploy the test application from the server -->
165
    <target name="netweaver-undeploy">
166
        <sapundeploy undeploystrategy="IfDependingStop">
167
            <saperrorhandling erroraction="prerequisites" errorstrategy="stop"/>
168
            <saperrorhandling erroraction="undeploy" errorstrategy="stop"/>
169
            <sapundeploylist listfilepath="${eclipselink.jpa.test}/resource/${server.name}/undeploy.txt"/>
170
            <sapj2eeengine serverhost="${netweaver.host}" serverport="${netweaver.port}" username="${server.user}" userpassword="${server.pwd}"/>
171
        </sapundeploy>        
172
    </target>
173
174
</project>
(-)jpa/eclipselink.jpa.test/resource/netweaver/templates/META-INF/application-j2ee-engine.xml (+6 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd">
3
    <reference reference-type="hard">
4
        <reference-target provider-name="JavaEE" target-type="application">%%eclipselinklib%%</reference-target>
5
    </reference>
6
</application-j2ee-engine>
(-)jpa/eclipselink.jpa.test/resource/netweaver/templates/META-INF/data-source-aliases.xml (+7 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<data-source-aliases xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="data-source-aliases.xsd">
3
  <aliases>
4
    <data-source-name>%%datasourcename%%</data-source-name>
5
    <alias>jdbc/EclipseLinkDS</alias>
6
  </aliases>
7
</data-source-aliases>
(-)jpa/eclipselink.jpa.test/resource/netweaver/templates/setup/META-INF/data-sources.xml (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE data-sources SYSTEM "data-sources.dtd" >
3
<data-sources>
4
  <data-source>
5
    <data-source-name>%%data-source-name%%</data-source-name>
6
    <driver-name>%%driver-name%%</driver-name>
7
    <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
8
    <sql-engine>native_sql</sql-engine>
9
    <jdbc-1.x>
10
      <driver-class-name>%%driver-class-name%%</driver-class-name>
11
      <url>%%url%%</url>
12
      <user-name>%%user-name%%</user-name>
13
      <password>%%password%%</password>
14
    </jdbc-1.x>
15
  </data-source>
16
</data-sources>
(-)jpa/eclipselink.jpa.test/resource/netweaver/templates/undeploy_eclipselink.txt (+2 lines)
Line 0 Link Here
1
JavaEE/%%eclipselink_app%%
2
JavaEE/%%datasource_app%%
(-)jpa/eclipselink.jpa.test/resource/netweaver/undeploy.txt (+1 lines)
Line 0 Link Here
1
JavaEE/servertest

Return to bug 294174