View | Details | Raw Unified | Return to bug 301295 | Differences between
and this patch

Collapse All | Expand All

(-)build.xml (+1 lines)
Lines 99-104 Link Here
99
    <echo message="user.home            = '${user.home}'"/>
99
    <echo message="user.home            = '${user.home}'"/>
100
    <echo message="Loading user properties from: '${user.home}/build.properties'"/>
100
    <echo message="Loading user properties from: '${user.home}/build.properties'"/>
101
    <property file="${user.home}/build.properties"/>
101
    <property file="${user.home}/build.properties"/>
102
    <property file="${user.home}/test.properties"/>
102
    <!-- Sets default junit.lib and all extensions.depend dir locations to static paths -->
103
    <!-- Sets default junit.lib and all extensions.depend dir locations to static paths -->
103
    <!-- temporary until all build files reworked -->
104
    <!-- temporary until all build files reworked -->
104
    <property name="oracle.extensions.depend.dir" value="${trunk.build.location}/../extension.oracle.lib.external"/>
105
    <property name="oracle.extensions.depend.dir" value="${trunk.build.location}/../extension.oracle.lib.external"/>
(-)jpa/eclipselink.jpa.test/jboss.properties (-1 / +4 lines)
Lines 17-22 Link Here
17
#persistence10.jar=${jboss.server}/lib/ejb3-persistence.jar
17
#persistence10.jar=${jboss.server}/lib/ejb3-persistence.jar
18
18
19
## JBoss 5.1.x specific properties.
19
## JBoss 5.1.x specific properties.
20
jboss.home=../../../jboss-5.1.0.GA
20
jboss.home=C:/jboss-5.1.0.GA
21
server.testrunner=TestRunner/remote-org.eclipse.persistence.testing.framework.server.TestRunner
21
server.testrunner=TestRunner/remote-org.eclipse.persistence.testing.framework.server.TestRunner
22
server.testrunner.wdf=ServerTestRunnerImpl/remote-org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner
22
persistence10.jar=${jboss.home}/common/lib/ejb3-persistence.jar
23
persistence10.jar=${jboss.home}/common/lib/ejb3-persistence.jar
24
25
(-)jpa/eclipselink.jpa.test/netweaver.properties (-1 / +2 lines)
Lines 10-16 Link Here
10
10
11
# user and password defined during installation
11
# user and password defined during installation
12
server.user=Administrator
12
server.user=Administrator
13
server.pwd=abcd1234
13
server.pwd=Osigfm.0
14
14
15
# host and port for the NetWeaver server; defined during installation
15
# host and port for the NetWeaver server; defined during installation
16
netweaver.host=localhost
16
netweaver.host=localhost
Lines 44-49 Link Here
44
# DO NOT CHANGE
44
# DO NOT CHANGE
45
####################################
45
####################################
46
server.testrunner=JavaEE/servertest/REMOTE/TestRunner/org.eclipse.persistence.testing.framework.server.TestRunner
46
server.testrunner=JavaEE/servertest/REMOTE/TestRunner/org.eclipse.persistence.testing.framework.server.TestRunner
47
server.testrunner.wdf=JavaEE/servertest/REMOTE/ServerTestRunnerImpl/org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner
47
server.lib=${netweaver.instance.dir}/j2ee/j2eeclient
48
server.lib=${netweaver.instance.dir}/j2ee/j2eeclient
48
#server.platform=NetWeaver_7_1
49
#server.platform=NetWeaver_7_1
49
server.platform=org.eclipse.persistence.platform.server.sap.SAPNetWeaver_7_1_Platform
50
server.platform=org.eclipse.persistence.platform.server.sap.SAPNetWeaver_7_1_Platform
(-)jpa/eclipselink.jpa.test/netweaver.xml (-2 / +3 lines)
Lines 35-41 Link Here
35
35
36
    <!-- Allows a user to overide certain user specific properties. -->
36
    <!-- Allows a user to overide certain user specific properties. -->
37
    <property file="${user.home}/netweaver.properties"/>
37
    <property file="${user.home}/netweaver.properties"/>
38
    <property file="./netweaver.properties"/>
38
    <property file="${eclipselink.jpa.test}/netweaver.properties"/>
39
    
39
    
40
    <property name="cpath" value="${netweaver.deployment.ant.dir}/tc~je~dc_ant.jar: 
40
    <property name="cpath" value="${netweaver.deployment.ant.dir}/tc~je~dc_ant.jar: 
41
                                  ${netweaver.clientlib.dir}/sap.com~tc~exception~impl.jar:
41
                                  ${netweaver.clientlib.dir}/sap.com~tc~exception~impl.jar:
Lines 52-57 Link Here
52
            <available file="${netweaver.deployment.dir}/scripts/make_SDA.csh"/>
52
            <available file="${netweaver.deployment.dir}/scripts/make_SDA.csh"/>
53
        </and>
53
        </and>
54
    </condition>
54
    </condition>
55
        <echo message="suffix=${suffix}"/>
55
56
56
    <macrodef name="make_sda">
57
    <macrodef name="make_sda">
57
        <attribute name="source" />
58
        <attribute name="source" />
Lines 143-149 Link Here
143
        </copy>
144
        </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='%%eclipselinklib%%' value="${netweaver.eclipselink.app}"/>
145
        <replace dir="${eclipselink.jpa.test}/resource/${server.name}/META-INF" token='%%datasourcename%%' value="${netweaver.datasource.name}"/>
146
        <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
    	<ear destfile="${basedir}/${ear.name}" update="true">
147
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}" includes="META-INF/*.*"/>
148
    	    <fileset dir="${eclipselink.jpa.test}/resource/${server.name}" includes="META-INF/*.*"/>
148
        </ear>
149
        </ear>
149
        <dirname property="basedir" file="${eclipselink.jpa.test}"/>
150
        <dirname property="basedir" file="${eclipselink.jpa.test}"/>
(-)jpa/eclipselink.jpa.wdf.test/build.xml (-16 / +205 lines)
Lines 34-40 Link Here
34
#******************************************************************************/-->
34
#******************************************************************************/-->
35
35
36
<!-- This ant project includes the following tasks:
36
<!-- This ant project includes the following tasks:
37
        - all (default) : compiles all JPA tests, packages test jars
37
        - build (default) : compiles all JPA tests, packages test jars
38
        - compile : compiles all JPA tests
38
        - compile : compiles all JPA tests
39
        - package : jars JPA persistent units and tests jars
39
        - package : jars JPA persistent units and tests jars
40
        - test : runs als JPA WDF tests
40
        - test : runs als JPA WDF tests
Lines 63-68 Link Here
63
    <property name="wdf_test.2.moxy.dir"           value="${wdf_test.2.trunk.dir}/moxy/org.eclipse.persistence.moxy"/>
63
    <property name="wdf_test.2.moxy.dir"           value="${wdf_test.2.trunk.dir}/moxy/org.eclipse.persistence.moxy"/>
64
    <property name="wdf_test.2.core.test.dir"      value="${wdf_test.2.trunk.dir}/foundation/eclipselink.core.test"/>
64
    <property name="wdf_test.2.core.test.dir"      value="${wdf_test.2.trunk.dir}/foundation/eclipselink.core.test"/>
65
    <property name="env" environment="env"         value="env"/>
65
    <property name="env" environment="env"         value="env"/>
66
    <property name="eclipselink.jpa.test"          value="../eclipselink.jpa.test"/>
66
67
67
    <!-- Allows a user to overide certain user specific properties. -->
68
    <!-- Allows a user to overide certain user specific properties. -->
68
    <property file="${user.home}/build.properties"/>
69
    <property file="${user.home}/build.properties"/>
Lines 76-82 Link Here
76
    <target name="build-against-jar"     depends="clean, init_against_jar, compile, package"                description="build JPA WDF testing jars"/>
77
    <target name="build-against-jar"     depends="clean, init_against_jar, compile, package"                description="build JPA WDF testing jars"/>
77
    <target name="build-against-classes" depends="clean, init_against_classes, compile, package"            description="build JPA WDF testing jars"/>
78
    <target name="build-against-classes" depends="clean, init_against_classes, compile, package"            description="build JPA WDF testing jars"/>
78
    <target name="build-against-bundles" depends="clean, init_against_bundles, compile, package"            description="build JPA WDF testing jars"/>
79
    <target name="build-against-bundles" depends="clean, init_against_bundles, compile, package"            description="build JPA WDF testing jars"/>
79
    <target name="test-against-jar"      depends="clean-test, init_against_jar, init_runtime, test-lrg"     description="run JPA WDF tests"/>
80
    <target name="test-against-jar"      depends="clean-test, init_against_jar, init_runtime,  test-lrg"     description="run JPA WDF tests"/>
80
    <target name="test-against-classes"  depends="clean-test, init_against_classes, init_runtime, test-lrg" description="run JPA WDF tests"/>
81
    <target name="test-against-classes"  depends="clean-test, init_against_classes, init_runtime, test-lrg" description="run JPA WDF tests"/>
81
    <target name="test-against-bundles"  depends="clean-test, init_against_bundles, init_runtime, test-lrg" description="run JPA WDF tests"/>
82
    <target name="test-against-bundles"  depends="clean-test, init_against_bundles, init_runtime, test-lrg" description="run JPA WDF tests"/>
82
    <!-- convienience targets -->
83
    <!-- convienience targets -->
Lines 100-110 Link Here
100
            <pathelement path="${wdf_test.2.core.test.dir}/${classes.dir}"/>
101
            <pathelement path="${wdf_test.2.core.test.dir}/${classes.dir}"/>
101
            <pathelement path="${wdf_test.2.core.test.dir}/${eclipselink.tests.jar}"/>
102
            <pathelement path="${wdf_test.2.core.test.dir}/${eclipselink.tests.jar}"/>
102
            <pathelement path="${wdf_test.2.jpa.plugins.dir}/${persistence20.jar}"/>
103
            <pathelement path="${wdf_test.2.jpa.plugins.dir}/${persistence20.jar}"/>
104
            <pathelement path="${wdf_test.2.common.plugins.dir}/${ejb.jar}"/>
103
            <!-- These paths are unneeded for compile or run (from core.depend) may be needed in future -->
105
            <!-- These paths are unneeded for compile or run (from core.depend) may be needed in future -->
104
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${unsigned.persistence10.jar}"/ -->
106
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${unsigned.persistence10.jar}"/ -->
105
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${activation.jar}"/ -->
107
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${activation.jar}"/ -->
106
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${resource.jar}"/ -->
108
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${resource.jar}"/ -->
107
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${ejb.jar}"/ -->
108
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${jms.jar}"/ -->
109
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${jms.jar}"/ -->
109
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${stax_api.jar}"/ -->
110
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${stax_api.jar}"/ -->
110
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${mail.jar}"/ -->
111
            <!-- pathelement path="${wdf_test.2.common.plugins.dir}/${mail.jar}"/ -->
Lines 178-210 Link Here
178
                <path refid="compile.path"/>
179
                <path refid="compile.path"/>
179
            </classpath>
180
            </classpath>
180
        </javac>
181
        </javac>
182
        <javac
183
            srcdir="${wdf_test.2.core.test.dir}/${src.dir}"
184
               destdir="${classes.dir}"
185
               debug="${javac.debug}"
186
               debuglevel="${javac.debuglevel}"
187
               optimize="${javac.optimize}"
188
               source="${javac.version}"
189
               target="${javac.version}"
190
               deprecation="${javac.deprecation}"
191
               failonerror="true"
192
            includes="org/eclipse/persistence/testing/framework/junit/**,
193
                org/eclipse/persistence/testing/framework/AutoVerifyTestCase.java,
194
                org/eclipse/persistence/testing/framework/TestCase.java,
195
                org/eclipse/persistence/testing/framework/TestEntity.java,
196
                org/eclipse/persistence/testing/framework/TestModel.java,
197
                org/eclipse/persistence/testing/framework/*TestHelper.java,
198
                org/eclipse/persistence/testing/framework/QuerySQLTracker.java,
199
                org/eclipse/persistence/testing/framework/TestWarningException.java,
200
                org/eclipse/persistence/testing/framework/TestException.java,
201
                org/eclipse/persistence/testing/framework/TestErrorException.java,
202
                org/eclipse/persistence/testing/framework/TestProblemException.java,
203
                org/eclipse/persistence/testing/framework/ResultInterface.java,
204
                org/eclipse/persistence/testing/framework/TestCollection.java,
205
                org/eclipse/persistence/testing/framework/PerformanceComparisonTest.java,
206
                org/eclipse/persistence/testing/framework/PerformanceComparisonTestCase.java,
207
                org/eclipse/persistence/testing/framework/TestResult.java,
208
                org/eclipse/persistence/testing/framework/PerformanceComparisonTestResult.java,
209
                org/eclipse/persistence/testing/framework/PerformanceRegressionTest.java,
210
                org/eclipse/persistence/testing/framework/PerformanceRegressionTestCase.java,
211
                org/eclipse/persistence/testing/framework/ConcurrencyTestAdapter.java,
212
                org/eclipse/persistence/testing/framework/ConcurrentPerformanceComparisonTest.java,
213
                org/eclipse/persistence/testing/framework/ConcurrentPerformanceRegressionTest.java">
214
            <classpath refid="compile.path"/>
215
        </javac>
181
    </target>
216
    </target>
217
    
218
    <target name="get-server-properties">
219
        <property file="${eclipselink.jpa.test}/${server.name}.properties"/>
220
        <echo message="server.lib=${server.lib}"/>
221
        <echo message="server.depend=${server.depend}"/>
222
        <echo message="server.name=${server.name}"/>
223
        <echo message="server.platform=${server.platform}"/>
224
    </target>
182
225
183
    <!-- Packages JPA persistent unit test jars. -->
226
    <!-- Packages JPA persistent unit test jars. -->
184
    <target name="package" depends="package-wdf-jpa2-model, package-wdf-jpa1-model" description="build EclipseLink jar">
227
    <target name="package" depends="package-tests, package-wdf-jpa2-model, package-wdf-jpa1-model" description="build EclipseLink jar"/>
228
    
229
230
    <target name="package-tests" depends="get-server-properties">
231
        <mkdir dir="${wdf_test.build.location}/stage"/>
232
        <filter token="server.user" value="${server.user}"/>
233
        <filter token="server.pwd" value="${server.pwd}"/>
234
        <filter token="server.factory" value="${server.factory}"/>
235
        <echo message="eclipselink.jpa.test=${eclipselink.jpa.test}"/>
236
        
237
        <copy file="${wdf_test.build.location}/../eclipselink.jpa.test/resource/server/jndi.properties" todir="stage" filtering="true"/> 
238
185
        <jar jarfile="${wdf_test.build.location}/${eclipselink.tests.jar}">
239
        <jar jarfile="${wdf_test.build.location}/${eclipselink.tests.jar}">
240
           <zipfileset dir="${wdf_test.build.location}/resource/ejb" includes="*.xml" prefix="META-INF"/>
186
           <fileset dir="${wdf_test.build.location}/${classes.dir}"
241
           <fileset dir="${wdf_test.build.location}/${classes.dir}"
187
                    includes="org/eclipse/persistence/testing/framework/**/*.class,
242
                    includes="org/eclipse/persistence/testing/framework/**/*.class,
188
                        org/eclipse/persistence/testing/tests/**/*.class"/>
243
                        org/eclipse/persistence/testing/tests/**/*.class"/>
244
           <fileset dir="${wdf_test.build.location}/stage"
245
                    includes="jndi.properties"/>
189
        </jar>
246
        </jar>
247
        <delete dir="stage"/> 
190
    </target>
248
    </target>
191
249
192
    <target name="package-wdf-jpa2-model">
250
    <target name="package-model" depends="get-server-properties,set-app-name">
193
        <jar jarfile="${wdf_test.build.location}/${eclipselink.wdf.jpa2.model}.jar">
251
        <copy overwrite="true" file="${wdf_test.build.location}/resource/${MODEL}/persistence.xml" todir="${build.dir}/META-INF"/>
194
            <zipfileset dir="${wdf_test.build.location}/resource/${eclipselink.wdf.jpa2.model}" includes="*.xml" prefix="META-INF"/>
252
        <replace dir="${build.dir}/META-INF" token='%%database-platform%%' value="${db.platform}">
253
            <include name="persistence.xml"/>
254
        </replace>
255
        <replace dir="${build.dir}/META-INF" token='%%data-source-name%%' value="${DS_NAME}">
256
            <include name="persistence.xml"/>
257
        </replace>
258
        <replace dir="${build.dir}/META-INF" token='%%server-platform%%' value="${server.platform}">
259
            <include name="persistence.xml"/>
260
        </replace>
261
        <jar jarfile="${wdf_test.build.location}/${MODEL}.jar">
262
            <zipfileset dir="${build.dir}/META-INF" includes="*.xml" prefix="META-INF"/>
195
            <fileset dir="${wdf_test.build.location}/${classes.dir}"
263
            <fileset dir="${wdf_test.build.location}/${classes.dir}"
196
                     includes="org/eclipse/persistence/testing/models/wdf/jpa2/**"/>
264
                     includes="${PACKAGE}"/>
197
        </jar>
265
        </jar>
266
        <delete dir="${build.dir}/META-INF"/> 
198
    </target>
267
    </target>
199
268
200
    <target name="package-wdf-jpa1-model">
269
    <target name="package-wdf-jpa1-model">
201
        <jar jarfile="${wdf_test.build.location}/${eclipselink.wdf.jpa1.model}.jar">
270
        <antcall target="package-model">
202
            <zipfileset dir="${wdf_test.build.location}/resource/${eclipselink.wdf.jpa1.model}" includes="*.xml" prefix="META-INF"/>
271
            <param name="MODEL"   value="${eclipselink.wdf.jpa1.model}"/>
203
            <fileset dir="${wdf_test.build.location}/${classes.dir}"
272
            <param name="PACKAGE" value="org/eclipse/persistence/testing/models/wdf/jpa1/**"/>
204
                     includes="org/eclipse/persistence/testing/models/wdf/jpa1/**"/>
273
        </antcall>
205
        </jar>
206
    </target>
274
    </target>
207
275
276
    <target name="package-wdf-jpa2-model">
277
        <antcall target="package-model">
278
            <param name="MODEL"   value="${eclipselink.wdf.jpa2.model}"/>
279
            <param name="PACKAGE" value="org/eclipse/persistence/testing/models/wdf/jpa2/**"/>
280
        </antcall>
281
    </target>
282
208
    <!-- Testing -->
283
    <!-- Testing -->
209
284
210
    <!-- Clean all build generated content. -->
285
    <!-- Clean all build generated content. -->
Lines 227-240 Link Here
227
    </target>
302
    </target>
228
303
229
    <!-- Default test target, run the LRG -->
304
    <!-- Default test target, run the LRG -->
230
    <target name="test-lrg" depends="clean-test">
305
    <target name="test-lrg">
231
        <antcall target="run-test" inheritRefs="true">
306
        <antcall target="run-test" inheritRefs="true">
232
            <param name="TEST_CLASS" value="${test.class}"/>
307
            <param name="TEST_CLASS" value="${test.class}"/>
233
            <param name="TEST_AGENT" value="${test.agent}"/>
308
            <param name="TEST_AGENT" value="${test.agent}"/> 
234
            <param name="TEST_WEAVING" value="${test.weaving}"/>
309
            <param name="TEST_WEAVING" value="${test.weaving}"/> 
235
            <param name="ORM_TESTING" value="-Dorm.testing=jpa"/>
310
            <param name="ORM_TESTING" value="-Dorm.testing=jpa"/>
236
            <param name="RUN_PATH" value="run.path"/>
311
            <param name="RUN_PATH" value="run.path"/>
237
            <param name="DB_URL" value="${db.url}"/>
312
            <param name="DB_URL" value="${db.url}"/>
313
            <param name="SERVER" value="false"/>
238
        </antcall>
314
        </antcall>
239
        <antcall target="generate-report" inheritRefs="true"/>
315
        <antcall target="generate-report" inheritRefs="true"/>
240
    </target>
316
    </target>
Lines 260-265 Link Here
260
            <jvmarg value="-Ddb.user=${db.user}"/>
336
            <jvmarg value="-Ddb.user=${db.user}"/>
261
            <jvmarg value="-Ddb.pwd=${db.pwd}"/>
337
            <jvmarg value="-Ddb.pwd=${db.pwd}"/>
262
            <jvmarg value="${jvmarg.db.platform}"/>
338
            <jvmarg value="${jvmarg.db.platform}"/>
339
            <jvmarg value="-Dservertest=${SERVER}"/>
340
            <sysproperty key="server.url" value="${server.url}${APP_NAME}"/>
341
            <sysproperty key="server.testrunner.wdf" value="${server.testrunner.wdf}"/>
342
            <sysproperty key="datasource.name" value="${DS_LOOKUP_NAME}"/>
263
            <classpath>
343
            <classpath>
264
                <path refid="${RUN_PATH}"/>
344
                <path refid="${RUN_PATH}"/>
265
            </classpath>
345
            </classpath>
Lines 281-284 Link Here
281
        </junitreport>
361
        </junitreport>
282
    </target>
362
    </target>
283
363
364
365
    <!-- Build server test ear. -->
366
    <target name="server-build-ear" depends="build-against-jar" >
367
        <copy overwrite="true" file="./resource/ear/application.xml" todir="${build.dir}/META-INF"/>
368
        <ear destfile="${wdf_test.build.location}/${build.dir}/servertest.ear" appxml="${build.dir}/META-INF/application.xml">
369
            <fileset file="${wdf_test.build.location}/${eclipselink.tests.jar}"/>
370
            <zipfileset dir="${wdf_test.build.location}" includes="${eclipselink.wdf.jpa1.model}.jar" prefix="${LIB_PREFIX}"/> 
371
        </ear>
372
        <copy file="${wdf_test.build.location}/${build.dir}/servertest.ear" todir="${basedir}"/>  
373
    </target>
374
    
375
    <target name="server-deploy">
376
        <ant antfile="${eclipselink.jpa.test}/${server.name}.xml" target="${server.name}-deploy" inheritRefs="true">
377
            <property name="ear.name" value="${ear.name}"/>
378
            <property name="application.name" value="${application.name}"/>
379
        </ant>
380
    </target>
381
    
382
    <target name="server-undeploy">
383
        <ant antfile="${eclipselink.jpa.test}/${server.name}.xml" target="${server.name}-undeploy" inheritRefs="true">
384
            <property name="application.name" value="${application.name}"/>
385
        </ant>
386
    </target>
387
388
    <!-- Allows we run websphere tests from Windows & Linux both. -->
389
    <target name="detect-os">
390
        <condition property="is.windows" value="true">
391
            <os family="windows"/>
392
        </condition>
393
        <condition property="is.unix" value="true">
394
            <os family="unix"/>
395
        </condition>
396
        <condition property="suffix" value="bat">
397
            <isset property="is.windows"/>
398
        </condition>
399
        <condition property="suffix" value="sh">
400
            <isset property="is.unix"/>
401
        </condition>
402
         <echo message="suffix=${suffix}"/>
403
    </target>
404
405
406
    <target name="set-app-name" depends="detect-os">
407
        <condition property="APP_NAME" value="">
408
            <contains string="${server.name}" substring="websphere"/>
409
        </condition>
410
        <condition property="APP_NAME" value="servertest">
411
            <not>
412
                <isset property="is.websphere"/>
413
            </not>
414
        </condition>
415
416
        <condition property="DS_NAME" value="java:/EclipseLinkDS">
417
            <contains string="${server.name}" substring="jboss"/>
418
        </condition>
419
        <condition property="DS_NAME" value="jdbc/EclipseLinkDS">
420
            <not>
421
                <isset property="is.jboss"/>
422
            </not>
423
        </condition>
424
425
        <condition property="DS_LOOKUP_NAME" value="jdbc/${DS_NAME}">
426
            <contains string="${server.name}" substring="netweaver"/>
427
        </condition>
428
        <condition property="DS_LOOKUP_NAME" value="${DS_NAME}">
429
            <not>
430
                <isset property="is.netweaver"/>
431
            </not>
432
        </condition>
433
434
435
        <condition property="LIB_PREFIX" value="">
436
            <contains string="${server.name}" substring="netweaver"/>
437
        </condition>
438
        <condition property="LIB_PREFIX" value="lib">
439
            <not>
440
                <isset property="is.netweaver"/>
441
            </not>
442
        </condition>
443
    </target>
444
445
    <!-- Build, deploy and run a test suite on the server. -->
446
    <target name="server-test" depends="get-server-properties, detect-os, set-app-name, server-build-ear, init_runtime">
447
        <antcall target="server-deploy" inheritRefs="true">
448
            <param name="ear.name" value="servertest.ear"/>
449
            <param name="application.name" value="servertest"/>
450
        </antcall>
451
        <path id="run.path.server">
452
            <fileset dir="${server.lib}" includes="${server.depend}"/>
453
            <path refid="run.path"/>
454
        </path>
455
        <antcall target="run-test" inheritRefs="true">
456
            <param name="TEST_CLASS" value="${test.class}"/>
457
            <param name="TEST_AGENT" value="${test.agent}"/> 
458
            <param name="TEST_WEAVING" value="${test.weaving}"/> 
459
            <param name="ORM_TESTING" value="-Dorm.testing=jpa"/>
460
            <param name="RUN_PATH" value="run.path.server"/>
461
            <param name="DB_URL" value="${db.url}"/>
462
            <param name="SERVER" value="true"/>
463
        </antcall>
464
        <antcall target="generate-report" inheritRefs="true"/>
465
        <antcall target="server-undeploy" inheritRefs="true">
466
            <param name="application.name" value="servertest"/>
467
        </antcall>
468
    </target>
469
470
284
</project>
471
</project>
472
473
(-)jpa/eclipselink.jpa.wdf.test/resource/ear/application.xml (+13 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<application xmlns="http://java.sun.com/xml/ns/javaee"
4
	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
	      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
6
		http://java.sun.com/xml/ns/javaee/application_5.xsd"
7
	      version="5">
8
    <description>servertest</description>
9
    <display-name>servertest</display-name>
10
    <module>
11
        <ejb>eclipselink-tests.jar</ejb>
12
    </module>
13
</application>
(-)jpa/eclipselink.jpa.wdf.test/resource/eclipselink-wdf-jpa1-model/persistence.xml (-6 / +24 lines)
Lines 2-10 Link Here
2
<persistence version="1.0"
2
<persistence version="1.0"
3
	xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
4
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
5
	<persistence-unit name="jpa1testmodel">
5
	<persistence-unit name="jpa1testmodel" transaction-type="RESOURCE_LOCAL">
6
		<description>ATS Test Persistence Unit</description>
6
		<description>ATS Test Persistence Unit</description>
7
		<jta-data-source>JPA2_TEST</jta-data-source>
7
	        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
8
		<non-jta-data-source>%%data-source-name%%</non-jta-data-source>
8
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.Component</class>
9
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.Component</class>
9
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.Metric</class>
10
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.Metric</class>
10
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.MetricFloat</class>
11
		<class>org.eclipse.persistence.testing.models.wdf.jpa1.component.MetricFloat</class>
Lines 83-93 Link Here
83
84
84
		<exclude-unlisted-classes>true</exclude-unlisted-classes>
85
		<exclude-unlisted-classes>true</exclude-unlisted-classes>
85
		<properties>
86
		<properties>
86
            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
87
                   <property name="eclipselink.target-server" value="%%server-platform%%"/>
87
            <property name="eclipselink.cache.shared.default" value="false"/>
88
                   <property name="eclipselink.target-database" value="%%database-platform%%"/>
88
            <property name="eclipselink.temporal.mutable" value="true"/> 
89
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
89
            <property name="eclipselink.weaving" value="false"/>
90
                   <property name="eclipselink.cache.shared.default" value="false"/>
91
                   <property name="eclipselink.temporal.mutable" value="true"/> 
92
                   <property name="eclipselink.weaving" value="false"/>
90
		</properties>
93
		</properties>
91
	</persistence-unit>
94
	</persistence-unit>
95
	<!--
96
	<persistence-unit name="jpa1testmodel_jta">
97
		<description>ATS Test Persistence Unit</description>
98
	        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
99
		<jta-data-source>jdbc/EclipseLinkDS</jta-data-source>
100
		<properties>
101
                   <property name="eclipselink.target-server" value="%%server-platform%%"/>
102
                   <property name="eclipselink.target-database" value="%%database-platform%%"/>
103
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
104
                   <property name="eclipselink.cache.shared.default" value="false"/>
105
                   <property name="eclipselink.temporal.mutable" value="true"/> 
106
                   <property name="eclipselink.weaving" value="false"/>
107
		</properties>
108
	</persistence-unit>
109
	-->
92
</persistence>
110
</persistence>
93
111
(-)jpa/eclipselink.jpa.wdf.test/resource/eclipselink-wdf-jpa2-model/persistence.xml (-4 / +9 lines)
Lines 2-10 Link Here
2
<persistence version="2.0"
2
<persistence version="2.0"
3
	xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
4
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
5
	<persistence-unit name="jpa2testmodel">
5
	<persistence-unit name="jpa2testmodel" transaction-type="RESOURCE_LOCAL">
6
		<description>ATS Test Persistence Unit</description>
6
		<description>ATS Test Persistence Unit</description>
7
		<jta-data-source>JPA2_TEST</jta-data-source>
7
	        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
8
		<jta-data-source>jdbc/EclipseLinkDS</jta-data-source>
8
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.Address</class>
9
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.Address</class>
9
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.ContactInfo</class>
10
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.ContactInfo</class>
10
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.Department</class>
11
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.employee.Department</class>
Lines 22-29 Link Here
22
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddingPropertyAccess</class>
23
		<class>org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddingPropertyAccess</class>
23
		<exclude-unlisted-classes>true</exclude-unlisted-classes>
24
		<exclude-unlisted-classes>true</exclude-unlisted-classes>
24
		<properties>
25
		<properties>
25
            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
26
                   <property name="eclipselink.target-server" value="org.eclipse.persistence.platform.server.sap.SAPNetWeaver_7_1_Platform"/> 
26
            <property name="eclipselink.cache.shared.default" value="false"/>
27
                   <property name="eclipselink.target-database" value="%%database-platform%%"/>
28
                   <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
29
                   <property name="eclipselink.cache.shared.default" value="false"/>
30
                   <property name="eclipselink.temporal.mutable" value="true"/> 
31
                   <property name="eclipselink.weaving" value="false"/>
27
		</properties>
32
		</properties>
28
	</persistence-unit>
33
	</persistence-unit>
29
</persistence>
34
</persistence>
(-)jpa/eclipselink.jpa.wdf.test/resource/ejb/ejb-jar.xml (+38 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
3
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5
          http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
6
          version="3.0">
7
    <enterprise-beans>
8
        <session>
9
            <ejb-name>ServerTestRunnerImpl</ejb-name>
10
            <persistence-unit-ref>
11
                <persistence-unit-ref-name>persistence/jpa1testmodel_rl/factory</persistence-unit-ref-name>
12
                <persistence-unit-name>jpa1testmodel</persistence-unit-name>
13
            </persistence-unit-ref>
14
            <!--
15
            <persistence-unit-ref>
16
                <persistence-unit-ref-name>persistence/jpa1testmodel_jta/factory</persistence-unit-ref-name>
17
                <persistence-unit-name>../lib/eclipselink-wdf-jpa1-model.jar#jpa1testmodel_jta</persistence-unit-name>
18
            </persistence-unit-ref>
19
            <persistence-unit-ref>
20
                <persistence-unit-ref-name>persistence/jpa2testmodel_rl/factory</persistence-unit-ref-name>
21
                <persistence-unit-name>../lib/eclipselink-wdf-jpa2-model.jar#jpa2testmodel</persistence-unit-name>
22
            </persistence-unit-ref>
23
            <persistence-context-ref>
24
                <persistence-context-ref-name>persistence/jpa2testmodel_rl/entity-manager</persistence-context-ref-name>
25
                <persistence-unit-name>../lib/eclipselink-wdf-jpa2-model.jar#jpa2testmodel</persistence-unit-name>
26
            </persistence-context-ref>
27
            <persistence-context-ref>
28
                <persistence-context-ref-name>persistence/jpa1testmodel_rl/entity-manager</persistence-context-ref-name>
29
                <persistence-unit-name>../lib/eclipselink-wdf-jpa1-model.jar#jpa1testmodel</persistence-unit-name>
30
            </persistence-context-ref>
31
            <persistence-context-ref>
32
                <persistence-context-ref-name>persistence/jpa1testmodel_jta/entity-manager</persistence-context-ref-name>
33
                <persistence-unit-name>../lib/eclipselink-wdf-jpa1-model.jar#jpa1testmodel_jta</persistence-unit-name>
34
            </persistence-context-ref>
35
            -->
36
        </session>
37
    </enterprise-beans>
38
</ejb-jar>
(-)jpa/eclipselink.jpa.wdf.test/SAPJPATests.launch (-7 / +13 lines)
Lines 1-25 Link Here
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
2
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
3
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
3
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4
<listEntry value="/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/simple/TestBasicPropertyTypes.java"/>
4
<listEntry value="/eclipselink.jpa.wdf.test"/>
5
</listAttribute>
5
</listAttribute>
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7
<listEntry value="1"/>
7
<listEntry value="4"/>
8
</listAttribute>
8
</listAttribute>
9
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
9
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
10
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
10
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=eclipselink.jpa.wdf.test"/>
11
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
11
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
12
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
12
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
13
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
13
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
14
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
14
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
15
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;eclipselink.jpa.wdf.test&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
15
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;eclipselink.jpa.wdf.test&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
16
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;eclipselink.jpa.wdf.test&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
16
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/eclipselink.jpa.wdf.test/eclipselink-wdf-jpa1-model.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
17
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/eclipselink.jpa.wdf.test/eclipselink-wdf-jpa1-model.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
17
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;eclipselink.jpa.wdf.test&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
18
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;W:/SVN/extension.lib.external/mysql-connector-java-5.1.8-bin.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
19
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/eclipselink.jpa.wdf.test/eclipselink-wdf-jpa2-model.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
18
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/eclipselink.jpa.wdf.test/eclipselink-wdf-jpa2-model.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
19
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;W:/SVNS/extension.lib.external/ojdbc14.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
20
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/usr/sap/L36/J36/j2ee/j2eeclient/sap.com~tc~exception~impl.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
21
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/usr/sap/L36/J36/j2ee/j2eeclient/sap.com~tc~je~clientlib~impl.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
22
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/usr/sap/L36/J36/j2ee/j2eeclient/sap.com~tc~logging~java~impl.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
23
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;W:/SVNS/extension.lib.external/mysql-connector-java-5.1.8-bin.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
24
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/eclipselink.jpa.wdf.test/eclipselink-tests.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
25
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;C:/jboss-5.1.0.GA/client/jbossall-client.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
20
</listAttribute>
26
</listAttribute>
21
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
27
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
22
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.persistence.testing.tests.wdf.jpa1.simple.TestBasicPropertyTypes"/>
28
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
23
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="eclipselink.jpa.wdf.test"/>
29
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="eclipselink.jpa.wdf.test"/>
24
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512M&#13;&#10;-Djava.security.manager&#13;&#10;-Djava.security.policy==${workspace_loc:eclipselink.core.test}/resource/java.policy.allpermissions&#13;&#10;-Dtest.properties=${workspace_loc:eclipselink.jpa.wdf.test}/test.properties&#13;&#10;-javaagent:${workspace_loc:eclipselink.core.test}/../../eclipselink.jar"/>
30
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512M&#13;&#10;-Djava.security.manager&#13;&#10;-Djava.security.policy==${workspace_loc:eclipselink.core.test}/resource/java.policy.allpermissions&#13;&#10;-Dtest.properties=${workspace_loc:eclipselink.jpa.wdf.test}/test.properties&#13;&#10;-Declipselink.logging.level=finest&#13;&#10;-Dserver.url=jnp://localhost:1099/&#13;&#10;-Dserver.testrunner.wdf=JavaEE/servertest/REMOTE/ServerTestRunnerImpl/org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner&#13;&#10;-Dservertest=false&#13;&#10;-Ddatasource.name=java:/EclipseLinkDS"/>
25
</launchConfiguration>
31
</launchConfiguration>
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/server/JEEPlatform.java (-2 / +2 lines)
Lines 91-97 Link Here
91
91
92
    public UserTransaction getUserTransaction() {
92
    public UserTransaction getUserTransaction() {
93
        try {
93
        try {
94
            return (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
94
            return (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");  
95
        } catch (NamingException exception) {
95
        } catch (NamingException exception) {
96
            throw new RuntimeException(exception);
96
            throw new RuntimeException(exception);
97
        }
97
        }
Lines 158-164 Link Here
158
        if (entityManagerFactory != null) {
158
        if (entityManagerFactory != null) {
159
            return entityManagerFactory;
159
            return entityManagerFactory;
160
        }
160
        }
161
        String contextName = "java:comp/env/persistence/" + persistenceUnit + "/factory";
161
        String contextName = "java:comp/env/persistence/" + persistenceUnit + "_rl/factory";
162
        try {
162
        try {
163
            return (EntityManagerFactory) new InitialContext().lookup(contextName);
163
            return (EntityManagerFactory) new InitialContext().lookup(contextName);
164
        } catch (NamingException exception) {
164
        } catch (NamingException exception) {
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/AbstractBaseTest.java (-26 / +283 lines)
Lines 26-45 Link Here
26
import java.sql.Statement;
26
import java.sql.Statement;
27
import java.util.HashMap;
27
import java.util.HashMap;
28
import java.util.HashSet;
28
import java.util.HashSet;
29
import java.util.Hashtable;
29
import java.util.Locale;
30
import java.util.Locale;
30
import java.util.Map;
31
import java.util.Map;
31
import java.util.Properties;
32
import java.util.Properties;
32
import java.util.Set;
33
import java.util.Set;
33
34
35
import javax.naming.Context;
36
import javax.naming.InitialContext;
34
import javax.naming.NamingException;
37
import javax.naming.NamingException;
35
import javax.persistence.EntityManager;
38
import javax.persistence.EntityManager;
36
import javax.persistence.EntityManagerFactory;
39
import javax.persistence.EntityManagerFactory;
40
import javax.persistence.LockModeType;
37
import javax.persistence.Persistence;
41
import javax.persistence.Persistence;
38
import javax.sql.DataSource;
42
import javax.sql.DataSource;
39
43
40
import org.eclipse.persistence.config.PersistenceUnitProperties;
44
import org.eclipse.persistence.config.PersistenceUnitProperties;
41
import org.eclipse.persistence.testing.framework.junit.JUnitTestCase;
42
import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper;
45
import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper;
46
import org.eclipse.persistence.testing.framework.server.JEEPlatform;
47
import org.eclipse.persistence.testing.framework.server.ServerPlatform;
43
import org.eclipse.persistence.testing.tests.feature.TestDataSource;
48
import org.eclipse.persistence.testing.tests.feature.TestDataSource;
44
import org.junit.Assert;
49
import org.junit.Assert;
45
import org.junit.Before;
50
import org.junit.Before;
Lines 48-80 Link Here
48
53
49
@SuppressWarnings("unchecked")
54
@SuppressWarnings("unchecked")
50
@RunWith(SkipBugzillaTestRunner.class)
55
@RunWith(SkipBugzillaTestRunner.class)
51
public abstract class AbstractBaseTest extends JUnitTestCase {
56
public abstract class AbstractBaseTest {
52
57
58
    // /** System variable to set the tests to run on the server. */
59
    // public static final String RUN_ON_SERVER = "server.run";
60
    //
61
    private static Map<String, EntityManagerFactory> emfNamedPersistenceUnits = new Hashtable<String, EntityManagerFactory>();
62
63
    /** Determine if the test is running on a JEE server, or in JSE. */
64
65
    private static ServerPlatform serverPlatform;
66
53
    private final JPAEnvironment environment;
67
    private final JPAEnvironment environment;
54
    private final String puName;
68
    private final String puName;
55
    private final static DataSource dataSource;
69
    private final static DataSource dataSource;
56
    private final static Map EMF_PROPERTIES;
70
    private final static Map EMF_PROPERTIES;
57
71
72
    private static boolean seesJPA2 = (LockModeType.values().length > 2);
73
58
    static {
74
    static {
59
        Map<String, String> properties = JUnitTestCaseHelper.getDatabaseProperties();
75
        final DataSource aDataSource;
60
        String driver = properties.get(PersistenceUnitProperties.JDBC_DRIVER);
61
        String url = properties.get(PersistenceUnitProperties.JDBC_URL);
62
        String user = properties.get(PersistenceUnitProperties.JDBC_USER);
63
        String password = properties.get(PersistenceUnitProperties.JDBC_PASSWORD);
64
76
65
        Properties userPasswd = new Properties();
77
        if (!ServerInfoHolder.isOnServer) {
66
        userPasswd.put("user", user);
78
            Map<String, String> properties = JUnitTestCaseHelper.getDatabaseProperties();
67
        userPasswd.put("password", password);
79
            String driver = properties.get(PersistenceUnitProperties.JDBC_DRIVER);
80
            String url = properties.get(PersistenceUnitProperties.JDBC_URL);
81
            String user = properties.get(PersistenceUnitProperties.JDBC_USER);
82
            String password = properties.get(PersistenceUnitProperties.JDBC_PASSWORD);
68
83
69
        DataSource ds = new TestDataSource(driver, url, userPasswd);
84
            Properties userPasswd = new Properties();
70
        dataSource = new PooledDataSource(ds);
85
            userPasswd.put("user", user);
86
            userPasswd.put("password", password);
87
88
            DataSource ds = new TestDataSource(driver, url, userPasswd);
89
            aDataSource = new PooledDataSource(ds);
90
91
        } else {
92
            Context context;
93
            try {
94
                context = new InitialContext();
95
                aDataSource = (DataSource) context.lookup(ServerInfoHolder.dataSourceName); 
96
            } catch (NamingException e) {
97
                throw new RuntimeException(e);
98
            }
99
        }
100
        dataSource = aDataSource;
71
        EMF_PROPERTIES = new HashMap();
101
        EMF_PROPERTIES = new HashMap();
72
        EMF_PROPERTIES.put("delimited-identifiers", "true");
102
        EMF_PROPERTIES.put("delimited-identifiers", "true");
73
        EMF_PROPERTIES.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, dataSource);
103
        EMF_PROPERTIES.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, dataSource);
74
    }
104
    }
75
105
76
    public AbstractBaseTest(String name) {
106
    public AbstractBaseTest(String name) {
77
        environment = new EnvironmentAdapter();
107
        environment = new ResourceLocalEnvironment();
78
        puName = name;
108
        puName = name;
79
    }
109
    }
80
110
Lines 87-96 Link Here
87
117
88
    }
118
    }
89
119
90
    final class EnvironmentAdapter implements JPAEnvironment {
120
    final class ResourceLocalEnvironment implements JPAEnvironment {
91
121
92
        @Override
122
        @Override
93
        public void beginTransaction(EntityManager em) {
123
        public void beginTransaction(EntityManager em) {
124
            em.getTransaction().begin();
125
        }
126
127
        @Override
128
        public void commitTransaction(EntityManager em) {
129
            em.getTransaction().commit();
130
        }
131
132
        @Override
133
        public void commitTransactionAndClear(EntityManager em) {
134
            try {
135
                commitTransaction(em);
136
            } finally {
137
                em.clear();
138
            }
139
        }
140
141
        @Override
142
        public EntityManagerFactory createNewEntityManagerFactory() throws NamingException {
143
            AbstractBaseTest.closeEntityManagerFactory(puName);
144
            return Persistence.createEntityManagerFactory(puName, EMF_PROPERTIES);
145
        }
146
147
        @Override
148
        public EntityManager getEntityManager() {
149
            return getEntityManagerFactory().createEntityManager();
150
            // return AbstractBaseTest.createEntityManager(puName,
151
            // EMF_PROPERTIES);
152
        }
153
154
        @Override
155
        public EntityManagerFactory getEntityManagerFactory() {
156
            return AbstractBaseTest.getEntityManagerFactory(puName, EMF_PROPERTIES);
157
        }
158
159
        @Override
160
        public boolean isTransactionActive(EntityManager em) {
161
            return em.getTransaction().isActive();
162
        }
163
164
        @Override
165
        public boolean isTransactionMarkedForRollback(EntityManager em) {
166
            return em.getTransaction().getRollbackOnly();
167
        }
168
169
        @Override
170
        public void markTransactionForRollback(EntityManager em) {
171
            throw new UnsupportedOperationException();
172
        }
173
174
        @Override
175
        public void rollbackTransaction(EntityManager em) {
176
            em.getTransaction().rollback();
177
        }
178
179
        @Override
180
        public void rollbackTransactionAndClear(EntityManager em) {
181
            try {
182
                rollbackTransaction(em);
183
            } finally {
184
                em.clear();
185
            }
186
        }
187
188
        @Override
189
        public boolean usesExtendedPC() {
190
            return true;
191
        }
192
193
        @Override
194
        public DataSource getDataSource() {
195
            return AbstractBaseTest.this.getDataSource();
196
        }
197
198
    }
199
200
    final class JTATxScopedEnvironment implements JPAEnvironment {
201
202
        @Override
203
        public void beginTransaction(EntityManager em) {
94
            AbstractBaseTest.this.beginTransaction(em);
204
            AbstractBaseTest.this.beginTransaction(em);
95
        }
205
        }
96
206
Lines 110-127 Link Here
110
220
111
        @Override
221
        @Override
112
        public EntityManagerFactory createNewEntityManagerFactory() throws NamingException {
222
        public EntityManagerFactory createNewEntityManagerFactory() throws NamingException {
113
            JUnitTestCase.closeEntityManagerFactory(puName);
223
            AbstractBaseTest.closeEntityManagerFactory(puName);
114
            return Persistence.createEntityManagerFactory(puName, EMF_PROPERTIES);
224
            return Persistence.createEntityManagerFactory(puName, EMF_PROPERTIES);
115
        }
225
        }
116
226
117
        @Override
227
        @Override
118
        public EntityManager getEntityManager() {
228
        public EntityManager getEntityManager() {
119
            return JUnitTestCase.createEntityManager(puName, EMF_PROPERTIES);
229
            return AbstractBaseTest.createEntityManager(puName, EMF_PROPERTIES);
120
        }
230
        }
121
231
122
        @Override
232
        @Override
123
        public EntityManagerFactory getEntityManagerFactory() {
233
        public EntityManagerFactory getEntityManagerFactory() {
124
            return JUnitTestCase.getEntityManagerFactory(puName, EMF_PROPERTIES);
234
            return AbstractBaseTest.getEntityManagerFactory(puName, EMF_PROPERTIES);
125
        }
235
        }
126
236
127
        @Override
237
        @Override
Lines 169-181 Link Here
169
        return dataSource;
279
        return dataSource;
170
    }
280
    }
171
281
172
    @Override
173
    final public void closeEntityManager(EntityManager em) {
282
    final public void closeEntityManager(EntityManager em) {
174
        if (!em.isOpen()) {
283
        if (!em.isOpen()) {
175
            return;
284
            return;
176
        }
285
        }
177
        if (environment.isTransactionActive(em)/*
286
        if (environment.isTransactionActive(em)/*
178
                                                * ||environment. isTransactionMarkedForRollback (em)
287
                                                * ||environment.
288
                                                * isTransactionMarkedForRollback
289
                                                * (em)
179
                                                */) { // FIXME discuss if tx is
290
                                                */) { // FIXME discuss if tx is
180
            // active if marked for
291
            // active if marked for
181
            // rollback
292
            // rollback
Lines 255-262 Link Here
255
366
256
    }
367
    }
257
368
258
    public static final <T extends Serializable> T serializeDeserialize(T serializable) throws IOException,
369
    public static final <T extends Serializable> T serializeDeserialize(T serializable) throws IOException, ClassNotFoundException {
259
            ClassNotFoundException {
260
        ByteArrayOutputStream out = new ByteArrayOutputStream();
370
        ByteArrayOutputStream out = new ByteArrayOutputStream();
261
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(out);
371
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(out);
262
        try {
372
        try {
Lines 273-284 Link Here
273
    }
383
    }
274
384
275
    /**
385
    /**
276
     * Checks whether the given throwable is of type java.lang.IllegalStateException, or otherwise if the throwable contains a
386
     * Checks whether the given throwable is of type
387
     * java.lang.IllegalStateException, or otherwise if the throwable contains a
277
     * java.lang.IllegalStateException somewhere in the cause stack.
388
     * java.lang.IllegalStateException somewhere in the cause stack.
278
     * 
389
     * 
279
     * @param e
390
     * @param e
280
     *            The throwable to check
391
     *            The throwable to check
281
     * @return <code>true</code> if the throwable is instance of or caused by java.lang.IllegalStateException
392
     * @return <code>true</code> if the throwable is instance of or caused by
393
     *         java.lang.IllegalStateException
282
     */
394
     */
283
    protected final boolean checkForIllegalStateException(Throwable e) {
395
    protected final boolean checkForIllegalStateException(Throwable e) {
284
        boolean contained = false;
396
        boolean contained = false;
Lines 293-304 Link Here
293
    }
405
    }
294
406
295
    /**
407
    /**
296
     * Checks whether the given throwable is of type java.sql.SQLException, or otherwise if the throwable contains a
408
     * Checks whether the given throwable is of type java.sql.SQLException, or
297
     * java.sql.SQLException somewhere in the cause stack.
409
     * otherwise if the throwable contains a java.sql.SQLException somewhere in
410
     * the cause stack.
298
     * 
411
     * 
299
     * @param e
412
     * @param e
300
     *            The throwable to check
413
     *            The throwable to check
301
     * @return <code>true</code> if the throwable is instance of or caused by java.sql.SQLException
414
     * @return <code>true</code> if the throwable is instance of or caused by
415
     *         java.sql.SQLException
302
     */
416
     */
303
    protected final boolean checkForSQLException(Throwable e) {
417
    protected final boolean checkForSQLException(Throwable e) {
304
        boolean contained = false;
418
        boolean contained = false;
Lines 312-315 Link Here
312
        return contained;
426
        return contained;
313
    }
427
    }
314
428
429
    /**
430
     * Return if the transaction is active. This allows the same code to be used
431
     * on the server where JTA is used.
432
     */
433
    public boolean isTransactionActive(EntityManager entityManager) {
434
        if (ServerInfoHolder.isOnServer()) {
435
            return getServerPlatform().isTransactionActive();
436
        } else {
437
            return entityManager.getTransaction().isActive();
438
        }
439
    }
440
441
    /**
442
     * Return if the transaction is roll back only. This allows the same code to
443
     * be used on the server where JTA is used.
444
     */
445
    public boolean getRollbackOnly(EntityManager entityManager) {
446
        if (ServerInfoHolder.isOnServer()) {
447
            return getServerPlatform().getRollbackOnly();
448
        } else {
449
            return entityManager.getTransaction().getRollbackOnly();
450
        }
451
    }
452
453
    /**
454
     * Begin a transaction on the entity manager. This allows the same code to
455
     * be used on the server where JTA is used.
456
     */
457
    public void beginTransaction(EntityManager entityManager) {
458
        if (ServerInfoHolder.isOnServer()) {
459
            getServerPlatform().beginTransaction();
460
        } else {
461
            entityManager.getTransaction().begin();
462
        }
463
    }
464
465
    /**
466
     * Commit a transaction on the entity manager. This allows the same code to
467
     * be used on the server where JTA is used.
468
     */
469
    public void commitTransaction(EntityManager entityManager) {
470
        if (ServerInfoHolder.isOnServer()) {
471
            getServerPlatform().commitTransaction();
472
        } else {
473
            entityManager.getTransaction().commit();
474
        }
475
    }
476
477
    /**
478
     * Rollback a transaction on the entity manager. This allows the same code
479
     * to be used on the server where JTA is used.
480
     */
481
    public void rollbackTransaction(EntityManager entityManager) {
482
        if (ServerInfoHolder.isOnServer()) {
483
            getServerPlatform().rollbackTransaction();
484
        } else {
485
            entityManager.getTransaction().rollback();
486
        }
487
    }
488
489
    /**
490
     * Return the server platform if running in JEE.
491
     */
492
    public static ServerPlatform getServerPlatform() {
493
        if (serverPlatform == null) {
494
            serverPlatform = new JEEPlatform();
495
        }
496
        return serverPlatform;
497
    }
498
499
    /**
500
     * Create a new entity manager for the "default" persistence unit. If in JEE
501
     * this will create or return the active managed entity manager.
502
     */
503
    public static EntityManager createEntityManager() {
504
        if (ServerInfoHolder.isOnServer()) {
505
            return getServerPlatform().getEntityManager("default");
506
        } else {
507
            return getEntityManagerFactory().createEntityManager();
508
        }
509
    }
510
511
    /**
512
     * Create a new entity manager for the persistence unit using the
513
     * properties. The properties will only be used the first time this entity
514
     * manager is accessed. If in JEE this will create or return the active
515
     * managed entity manager.
516
     */
517
    public static EntityManager createEntityManager(String persistenceUnitName, Map<String, String> properties) {
518
        if (ServerInfoHolder.isOnServer()) {
519
            return getServerPlatform().getEntityManager(persistenceUnitName);
520
        } else {
521
            return getEntityManagerFactory(persistenceUnitName, properties).createEntityManager();
522
        }
523
    }
524
525
    public static EntityManagerFactory getEntityManagerFactory(String persistenceUnitName) {
526
        return getEntityManagerFactory(persistenceUnitName, JUnitTestCaseHelper.getDatabaseProperties());
527
    }
528
529
    public static EntityManagerFactory getEntityManagerFactory(String persistenceUnitName, Map<String, String> properties) {
530
        if (ServerInfoHolder.isOnServer()) {
531
            return getServerPlatform().getEntityManagerFactory(persistenceUnitName);
532
        } else {
533
            EntityManagerFactory emfNamedPersistenceUnit = (EntityManagerFactory) emfNamedPersistenceUnits.get(persistenceUnitName);
534
            if (emfNamedPersistenceUnit == null) {
535
                emfNamedPersistenceUnit = Persistence.createEntityManagerFactory(persistenceUnitName, properties);
536
                emfNamedPersistenceUnits.put(persistenceUnitName, emfNamedPersistenceUnit);
537
            }
538
            return emfNamedPersistenceUnit;
539
        }
540
    }
541
542
    public static EntityManagerFactory getEntityManagerFactory() {
543
        return getEntityManagerFactory("default");
544
    }
545
546
    public static void closeEntityManagerFactory() {
547
        closeEntityManagerFactory("default");
548
    }
549
550
    public static void closeEntityManagerFactory(String persistenceUnitName) {
551
        EntityManagerFactory emfNamedPersistenceUnit = (EntityManagerFactory) emfNamedPersistenceUnits.get(persistenceUnitName);
552
        if (emfNamedPersistenceUnit != null) {
553
            if (emfNamedPersistenceUnit.isOpen()) {
554
                emfNamedPersistenceUnit.close();
555
            }
556
            emfNamedPersistenceUnits.remove(persistenceUnitName);
557
        }
558
    }
559
560
    public static boolean seesJPA2() {
561
        return seesJPA2;
562
    }
563
564
    public static Map<String, String> getTestProperties() {
565
        if (ServerInfoHolder.isOnServer) {
566
            return ServerInfoHolder.testProperties;
567
        } else {
568
            return JUnitTestCaseHelper.getDatabaseProperties();
569
        }
570
571
    }
315
}
572
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/CollectNotificationsListener.java (+58 lines)
Line 0 Link Here
1
/**
2
 * 
3
 */
4
package org.eclipse.persistence.testing.framework.wdf.server;
5
6
import java.util.ArrayList;
7
import java.util.List;
8
9
import org.junit.runner.Description;
10
import org.junit.runner.Result;
11
import org.junit.runner.notification.Failure;
12
import org.junit.runner.notification.RunListener;
13
14
final class CollectNotificationsListener extends RunListener {
15
    private final List<Notification> notifications = new ArrayList<Notification>();
16
    
17
    CollectNotificationsListener() {
18
    }
19
20
    public List<Notification> getNotifications() {
21
        return notifications;
22
    }
23
24
    @Override
25
    public void testAssumptionFailure(Failure failure) {
26
        notifications.add(new TestAssumptionFailed(failure));
27
    }
28
29
    @Override
30
    public void testFailure(Failure failure) throws Exception {
31
        notifications.add(new TestFailed(failure));
32
    }
33
34
    @Override
35
    public void testFinished(Description description) throws Exception {
36
        notifications.add(new TestFinished(description));
37
    }
38
39
    @Override
40
    public void testIgnored(Description description) throws Exception {
41
        notifications.add(new TestIgnored(description));
42
    }
43
44
    @Override
45
    public void testRunFinished(Result result) throws Exception {
46
        notifications.add(new TestRunFinished(result));
47
    }
48
49
    @Override
50
    public void testRunStarted(Description description) throws Exception {
51
        notifications.add(new TestRunStarted(description));
52
    }
53
54
    @Override
55
    public void testStarted(Description description) throws Exception {
56
        notifications.add(new TestStarted(description));
57
    }
58
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/Notification.java (+11 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.io.Serializable;
4
5
import org.junit.runner.notification.RunNotifier;
6
7
public interface Notification extends Serializable {
8
    
9
    public void notify(RunNotifier notifier);
10
11
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/SerializableDescription.java (+48 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.io.Serializable;
4
import java.util.ArrayList;
5
import java.util.Collections;
6
import java.util.List;
7
8
import org.junit.runner.Description;
9
10
public class SerializableDescription implements Serializable {
11
12
    private static final long serialVersionUID = 1L;
13
    private final String displayName;
14
    private final List<SerializableDescription> children;
15
16
    private SerializableDescription(String theDisplayName, List<SerializableDescription> theChildren) {
17
        displayName = theDisplayName;
18
        children = theChildren;
19
    }
20
21
    @SuppressWarnings("unchecked")
22
    public static SerializableDescription create(Description description) {
23
        final List<SerializableDescription> children;
24
        if (description.getChildren() != null) {
25
            children = new ArrayList<SerializableDescription>();
26
            for (Description child : description.getChildren()) {
27
                children.add(create(child));
28
            }
29
        } else {
30
            children = Collections.EMPTY_LIST;
31
        }
32
        return new SerializableDescription(description.getDisplayName(), children);
33
34
    }
35
36
    public Description restore() {
37
        Description restored = Description.createSuiteDescription(displayName);
38
39
        if (children != null) {
40
            for (SerializableDescription child : children) {
41
                restored.addChild(child.restore());
42
            }
43
        }
44
45
        return restored;
46
    }
47
48
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/SerializableFailure.java (+26 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.io.Serializable;
4
5
import org.junit.runner.notification.Failure;
6
7
public class SerializableFailure implements Serializable {
8
    
9
    private static final long serialVersionUID = 1L;
10
    private final SerializableDescription description;
11
    private final Throwable thrownException;
12
    
13
    private SerializableFailure(SerializableDescription theDescription, Throwable throwable) {
14
        description = theDescription;
15
        thrownException = throwable;
16
    }
17
    
18
    public static SerializableFailure create(Failure failure) {
19
        return new SerializableFailure(SerializableDescription.create(failure.getDescription()),failure.getException());
20
    }
21
    
22
    public Failure restore() {
23
        return new Failure(description.restore(), thrownException);
24
    }
25
26
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/SerializableResult.java (+53 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.io.Serializable;
4
import java.util.ArrayList;
5
import java.util.Collections;
6
import java.util.List;
7
8
import org.junit.runner.Result;
9
import org.junit.runner.notification.Failure;
10
11
public class SerializableResult implements Serializable {
12
    
13
    private static final long serialVersionUID = 1L;
14
    @SuppressWarnings("unused")
15
    private final int count;
16
    @SuppressWarnings("unused")
17
    private final int ignoreCount;
18
    @SuppressWarnings("unused")
19
    private final List<SerializableFailure> failures;
20
    @SuppressWarnings("unused")
21
    private final long runTime;
22
    
23
    private SerializableResult(int cnt, int ign, List<SerializableFailure> fls, long rt) {
24
        count = cnt;
25
        ignoreCount = ign;
26
        failures = fls;
27
        runTime = rt;
28
    }
29
    
30
    @SuppressWarnings("unchecked")
31
    public static SerializableResult create(Result other) {
32
        final List<SerializableFailure> failures;
33
        
34
        if (other.getFailures() != null) {
35
            failures = new ArrayList<SerializableFailure>();
36
            for(Failure failure : other.getFailures()) {
37
                failures.add(SerializableFailure.create(failure));
38
            }
39
        } else {
40
            failures = Collections.EMPTY_LIST;
41
        }
42
        
43
        return new SerializableResult(other.getFailureCount(), other.getIgnoreCount(), failures, other.getRunTime());
44
        
45
    }
46
    
47
    public Result restore() {
48
        return new Result(); // FIXME
49
        
50
    }
51
    
52
53
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/ServerTestRunner.java (+13 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.util.List;
4
import java.util.Map;
5
6
import javax.ejb.Remote;
7
8
@Remote
9
public interface ServerTestRunner {
10
    
11
    public List<Notification> runTestClass(String className, String dsName, String environmentName, Map<String, String> testProperties);
12
13
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/ServerTestRunnerImpl.java (+40 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import java.util.List;
4
import java.util.Map;
5
6
import javax.ejb.Stateless;
7
import javax.ejb.TransactionManagement;
8
import javax.ejb.TransactionManagementType;
9
10
import org.eclipse.persistence.testing.framework.wdf.ServerInfoHolder;
11
import org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner;
12
import org.junit.runner.JUnitCore;
13
14
15
@Stateless
16
@TransactionManagement(TransactionManagementType.BEAN)
17
public class ServerTestRunnerImpl implements ServerTestRunner {
18
    
19
    @Override
20
    public List<Notification> runTestClass(String className, String dsName, String environmentName, Map<String, String> testProperties) {
21
        
22
        Class<?> clazz;
23
        try {
24
            ServerInfoHolder.isOnServer = true;
25
            ServerInfoHolder.testProperties = testProperties;
26
            ServerInfoHolder.dataSourceName = dsName;
27
            clazz = Class.forName(className);
28
        } catch (ClassNotFoundException e) {
29
            throw new RuntimeException(e);
30
        }
31
32
        JUnitCore core = new JUnitCore();
33
        CollectNotificationsListener listener = new CollectNotificationsListener();
34
        core.addListener(listener);
35
        core.run(clazz);
36
        
37
        return listener.getNotifications();
38
    }
39
40
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestAssumptionFailed.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.notification.Failure;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestAssumptionFailed implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableFailure failure;
10
    
11
    public TestAssumptionFailed(Failure aFailure) {
12
        failure = SerializableFailure.create(aFailure);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestAssumptionFailed(failure.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestFailed.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.notification.Failure;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestFailed implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableFailure failure;
10
    
11
    public TestFailed(Failure aFailure) {
12
        failure = SerializableFailure.create(aFailure);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestFailure(failure.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestFinished.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.Description;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestFinished implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableDescription description;
10
    
11
    public TestFinished(Description aDescription) {
12
        description = SerializableDescription.create(aDescription);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestFinished(description.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestIgnored.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.Description;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestIgnored implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableDescription description;
10
    
11
    public TestIgnored(Description aDescription) {
12
        description = SerializableDescription.create(aDescription);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestIgnored(description.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestRunFinished.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.Result;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestRunFinished implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableResult result;
10
    
11
    public TestRunFinished(Result aResult) {
12
        result = SerializableResult.create(aResult);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestRunFinished(result.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestRunStarted.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.Description;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestRunStarted implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableDescription description;
10
    
11
    public TestRunStarted(Description aDescription) {
12
        description = SerializableDescription.create(aDescription);
13
        }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestRunStarted(description.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/server/TestStarted.java (+20 lines)
Line 0 Link Here
1
package org.eclipse.persistence.testing.framework.wdf.server;
2
3
import org.junit.runner.Description;
4
import org.junit.runner.notification.RunNotifier;
5
6
public class TestStarted implements Notification {
7
    
8
    private static final long serialVersionUID = 1L;
9
    private final SerializableDescription description;
10
    
11
    public TestStarted(Description aDescription) {
12
        description = SerializableDescription.create(aDescription);
13
    }
14
15
    @Override
16
    public void notify(RunNotifier notifier) {
17
        notifier.fireTestStarted(description.restore());
18
    }
19
20
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/Skip.java (+5 lines)
Lines 28-31 Link Here
28
     * The databases on which this test should be skipped. Default: skip on all databases
28
     * The databases on which this test should be skipped. Default: skip on all databases
29
     */
29
     */
30
    Class<? extends DatabasePlatform>[] databases() default {};
30
    Class<? extends DatabasePlatform>[] databases() default {};
31
    
32
    /**
33
     * Indicates if this test should be skipped on server. 
34
     */
35
    boolean server() default false;
31
}
36
}
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/SkipBugzillaTestRunner.java (-10 / +74 lines)
Lines 15-25 Link Here
15
15
16
import java.lang.annotation.Annotation;
16
import java.lang.annotation.Annotation;
17
import java.lang.reflect.Method;
17
import java.lang.reflect.Method;
18
import java.util.List;
18
import java.util.Map;
19
import java.util.Map;
20
import java.util.Properties;
19
21
22
import javax.naming.Context;
23
import javax.naming.InitialContext;
24
import javax.naming.NamingException;
25
import javax.rmi.PortableRemoteObject;
26
20
import org.eclipse.persistence.config.PersistenceUnitProperties;
27
import org.eclipse.persistence.config.PersistenceUnitProperties;
21
import org.eclipse.persistence.platform.database.DatabasePlatform;
28
import org.eclipse.persistence.platform.database.DatabasePlatform;
22
import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper;
29
import org.eclipse.persistence.testing.framework.wdf.server.Notification;
30
import org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner;
31
import org.junit.Assert;
23
import org.junit.runner.Description;
32
import org.junit.runner.Description;
24
import org.junit.runner.notification.RunNotifier;
33
import org.junit.runner.notification.RunNotifier;
25
import org.junit.runners.BlockJUnit4ClassRunner;
34
import org.junit.runners.BlockJUnit4ClassRunner;
Lines 27-50 Link Here
27
36
28
public class SkipBugzillaTestRunner extends BlockJUnit4ClassRunner {
37
public class SkipBugzillaTestRunner extends BlockJUnit4ClassRunner {
29
38
39
    @Override
40
    public void run(RunNotifier notifier) {
41
        if (Boolean.valueOf(System.getProperty("servertest"))) {
42
            runOnServer(notifier);
43
        } else {
44
            super.run(notifier);
45
        }
46
    }
47
48
    private void runOnServer(RunNotifier notifier) {
49
        Properties properties = new Properties();
50
        String url = getMandatorySystemProperty("server.url");
51
        properties.put("java.naming.provider.url", url);
52
        Context context;
53
        try {
54
            context = new InitialContext(properties);
55
            String testrunner = getMandatorySystemProperty("server.testrunner.wdf");
56
            String dataSourceName = getMandatorySystemProperty("datasource.name");
57
58
            Object object = context.lookup(testrunner);
59
            ServerTestRunner runner = (ServerTestRunner) PortableRemoteObject.narrow(object, ServerTestRunner.class);
60
            String testClassName = getTestClass().getJavaClass().getName();
61
            List<Notification> notifications = runner.runTestClass(testClassName, dataSourceName, "", testProperties);
62
            
63
            for (Notification notification : notifications) {
64
                notification.notify(notifier);
65
            }
66
        } catch (NamingException e) {
67
            throw new RuntimeException(e);
68
        }
69
    }
70
71
    private String getMandatorySystemProperty(final String propertyName) {
72
        String url = System.getProperty(propertyName);
73
        if (url == null) {
74
            Assert.fail("System property '" + propertyName + "' must be set.");
75
        }
76
        return url;
77
    }
78
30
    final long bugid;
79
    final long bugid;
31
    final long issueid;
80
    final long issueid;
32
    final boolean runAllBugzilla;
81
    final boolean runAllBugzilla;
33
    final boolean runAllIssues;
82
    final boolean runAllIssues;
34
    final boolean runAllUnknown;
83
    final boolean runAllUnknown;
35
    final Class<? extends DatabasePlatform> databasePlatformClass;
84
    final Class<? extends DatabasePlatform> databasePlatformClass;
85
    private final Map<String, String> testProperties;
36
    
86
    
87
    
37
    @SuppressWarnings("unchecked")
88
    @SuppressWarnings("unchecked")
38
    public SkipBugzillaTestRunner(Class<?> klass) throws Throwable {
89
    public SkipBugzillaTestRunner(Class<?> klass) throws Throwable {
39
        super(klass);
90
        super(klass);
40
        
91
        
41
        Map<String, String> properties = JUnitTestCaseHelper.getDatabaseProperties();
92
        testProperties = AbstractBaseTest.getTestProperties();
42
93
43
        String databasePlatformClassName = properties.get(PersistenceUnitProperties.TARGET_DATABASE);
94
        String databasePlatformClassName = testProperties.get(PersistenceUnitProperties.TARGET_DATABASE); 
95
        
44
96
97
        if (databasePlatformClassName != null) {
45
        databasePlatformClass = (Class<? extends DatabasePlatform>) Class.forName(databasePlatformClassName);
98
        databasePlatformClass = (Class<? extends DatabasePlatform>) Class.forName(databasePlatformClassName);
99
        } else {
100
            databasePlatformClass = null; // FIXME
101
        }
46
102
47
        String testBugzillaRun = (String) properties.get("test.bugzilla.run");
103
        String testBugzillaRun = (String) testProperties.get("test.bugzilla.run");
48
        if ("all".equals(testBugzillaRun)) {
104
        if ("all".equals(testBugzillaRun)) {
49
            runAllBugzilla = true;
105
            runAllBugzilla = true;
50
            bugid = -1;
106
            bugid = -1;
Lines 57-63 Link Here
57
            }
113
            }
58
        }
114
        }
59
115
60
        String testIssueRun = (String) properties.get("test.issue.run");
116
        String testIssueRun = (String) testProperties.get("test.issue.run");
61
        if ("all".equals(testIssueRun)) {
117
        if ("all".equals(testIssueRun)) {
62
            runAllIssues = true;
118
            runAllIssues = true;
63
            issueid = -1;
119
            issueid = -1;
Lines 70-81 Link Here
70
            }
126
            }
71
        }
127
        }
72
128
73
        String testToBeInvestigatedRun = (String) properties.get("test.to-be-investigated.run");
129
        String testToBeInvestigatedRun = (String) testProperties.get("test.to-be-investigated.run");
74
        if ("all".equals(testToBeInvestigatedRun)) {
130
        if ("all".equals(testToBeInvestigatedRun)) {
75
            runAllUnknown = true;
131
            runAllUnknown = true;
76
        } else {
132
        } else {
77
            runAllUnknown = false;
133
            runAllUnknown = false;
78
        }
134
        }
135
        
79
136
80
    }
137
    }
81
138
Lines 115-124 Link Here
115
            throw new SkipException();
172
            throw new SkipException();
116
        }
173
        }
117
174
118
        for (Class<? extends DatabasePlatform> clazz : databases) {
175
        if (databasePlatformClass != null) {
119
            if (clazz.isAssignableFrom(databasePlatformClass)) {
176
            for (Class<? extends DatabasePlatform> clazz : databases) {
120
                // the current database platform is not supported
177
                if (clazz.isAssignableFrom(databasePlatformClass)) {
121
                throw new SkipException();
178
                    // the current database platform is not supported
179
                    throw new SkipException();
180
                }
122
            }
181
            }
123
        }
182
        }
124
183
Lines 148-153 Link Here
148
207
149
        @Override
208
        @Override
150
        public boolean runThis(Skip skip) {
209
        public boolean runThis(Skip skip) {
210
            
211
            if(skip.server()) {
212
                return !ServerInfoHolder.isOnServer();
213
            }
214
            
151
            return false;
215
            return false;
152
        }
216
        }
153
217
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/entitymanager/TestEntityManagerFactory.java (+2 lines)
Lines 23-28 Link Here
23
import org.eclipse.persistence.testing.tests.wdf.jpa1.JPA1Base;
23
import org.eclipse.persistence.testing.tests.wdf.jpa1.JPA1Base;
24
import org.eclipse.persistence.testing.framework.wdf.AbstractBaseTest;
24
import org.eclipse.persistence.testing.framework.wdf.AbstractBaseTest;
25
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
25
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
26
import org.eclipse.persistence.testing.framework.wdf.Skip;
26
import org.eclipse.persistence.testing.framework.wdf.ToBeInvestigated;
27
import org.eclipse.persistence.testing.framework.wdf.ToBeInvestigated;
27
import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Department;
28
import org.eclipse.persistence.testing.models.wdf.jpa1.employee.Department;
28
29
Lines 38-43 Link Here
38
    }
39
    }
39
40
40
    @Test()
41
    @Test()
42
    @Skip(server=true)
41
    public void testEntityManagerFactoryClose() throws NamingException {
43
    public void testEntityManagerFactoryClose() throws NamingException {
42
        final boolean closingEmfThrowsException = AbstractBaseTest.isInsideEngine();
44
        final boolean closingEmfThrowsException = AbstractBaseTest.isInsideEngine();
43
        final JPAEnvironment env = getEnvironment();
45
        final JPAEnvironment env = getEnvironment();
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/lock/TestOptimistic.java (-1 / +1 lines)
Lines 242-249 Link Here
242
            caughtException = true;
242
            caughtException = true;
243
        } finally {
243
        } finally {
244
            closeEntityManager(em);
244
            closeEntityManager(em);
245
            verify(caughtException, "PersistenceException not thrown for versionModification");
246
        }
245
        }
246
        verify(caughtException, "PersistenceException not thrown for versionModification");
247
    }
247
    }
248
248
249
    @Test
249
    @Test
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/query/TestSimpleQuery.java (-8 / +23 lines)
Lines 558-580 Link Here
558
            closeEntityManager(em);
558
            closeEntityManager(em);
559
        }
559
        }
560
    }
560
    }
561
    
562
    private static boolean hasGetmaxRowsMethod() {
563
        try {
564
            return Query.class.getMethod("getMaxResults") != null;
565
        } catch (NoSuchMethodException e) {
566
            return false;
567
        }
568
    }
561
569
562
    private void verifyRowCount(Query query, int maxRows, int startPos, int expected) {
570
    private void verifyRowCount(Query query, int maxRows, int startPos, int expected) throws SecurityException, NoSuchMethodException {
563
        query.setMaxResults(maxRows);
571
        query.setMaxResults(maxRows);
564
        query.setFirstResult(startPos);
572
        query.setFirstResult(startPos);
565
573
566
        assertEquals(query.getMaxResults(), maxRows);
574
        if (hasGetmaxRowsMethod()) {
567
        assertEquals(query.getFirstResult(), startPos);
575
            assertEquals(query.getMaxResults(), maxRows);
576
            assertEquals(query.getFirstResult(), startPos);
577
        }
568
578
569
        int count = query.getResultList().size();
579
        int count = query.getResultList().size();
570
        verify(count == expected, "wrong row count: " + count);
580
        verify(count == expected, "wrong row count: " + count);
571
        
581
572
        assertEquals(query.getMaxResults(), maxRows);
582
        if (hasGetmaxRowsMethod()) {
573
        assertEquals(query.getFirstResult(), startPos);
583
            assertEquals(query.getMaxResults(), maxRows);
584
            assertEquals(query.getFirstResult(), startPos);
585
        }
574
    }
586
    }
575
587
576
    @Test
588
    @Test
577
    public void testMaxResult() throws SQLException {
589
    public void testMaxResult() throws SQLException, SecurityException, NoSuchMethodException {
578
        clearAllTables();
590
        clearAllTables();
579
        JPAEnvironment env = getEnvironment();
591
        JPAEnvironment env = getEnvironment();
580
        EntityManager em = env.getEntityManager();
592
        EntityManager em = env.getEntityManager();
Lines 601-607 Link Here
601
    }
613
    }
602
614
603
    @Test
615
    @Test
604
    public void testMaxResultUnlimited() throws SQLException {
616
    public void testMaxResultUnlimited() throws SQLException, SecurityException, NoSuchMethodException {
605
        clearAllTables();
617
        clearAllTables();
606
        JPAEnvironment env = getEnvironment();
618
        JPAEnvironment env = getEnvironment();
607
        EntityManager em = env.getEntityManager();
619
        EntityManager em = env.getEntityManager();
Lines 623-628 Link Here
623
    
635
    
624
    @Test
636
    @Test
625
    public void testPagingDefaults() throws SQLException {
637
    public void testPagingDefaults() throws SQLException {
638
        if (!hasGetmaxRowsMethod()) {
639
            return;
640
        }
626
        JPAEnvironment env = getEnvironment();
641
        JPAEnvironment env = getEnvironment();
627
        EntityManager em = env.getEntityManager();
642
        EntityManager em = env.getEntityManager();
628
        try {
643
        try {
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa1/simple/BufferReadTest.java (-1 lines)
Lines 312-318 Link Here
312
                    public void run() {
312
                    public void run() {
313
                        try {
313
                        try {
314
                            ResultSet rs = preparedStatement.executeQuery();
314
                            ResultSet rs = preparedStatement.executeQuery();
315
                            connection.commit();
316
                            try {
315
                            try {
317
                                rs.next();
316
                                rs.next();
318
                                new Department(rs.getInt(1), rs.getString(2));
317
                                new Department(rs.getInt(1), rs.getString(2));
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa2/embeddable/TestEmbeddingWithMixedAccess.java (+3 lines)
Lines 16-21 Link Here
16
import javax.persistence.EntityManager;
16
import javax.persistence.EntityManager;
17
17
18
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
18
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
19
import org.eclipse.persistence.testing.framework.wdf.Skip;
19
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddedFieldAccess;
20
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddedFieldAccess;
20
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddedPropertyAccess;
21
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddedPropertyAccess;
21
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddingFieldAccess;
22
import org.eclipse.persistence.testing.models.wdf.jpa2.embedded.EmbeddingFieldAccess;
Lines 25-30 Link Here
25
public class TestEmbeddingWithMixedAccess extends JPA2Base {
26
public class TestEmbeddingWithMixedAccess extends JPA2Base {
26
27
27
    @Test
28
    @Test
29
    @Skip(server=true)
28
    public void testFieldAccess() {
30
    public void testFieldAccess() {
29
        JPAEnvironment env = getEnvironment();
31
        JPAEnvironment env = getEnvironment();
30
        EntityManager em = env.getEntityManager();
32
        EntityManager em = env.getEntityManager();
Lines 45-50 Link Here
45
    }
47
    }
46
48
47
    @Test
49
    @Test
50
    @Skip(server=true)
48
    public void testPropertyAccess() {
51
    public void testPropertyAccess() {
49
        JPAEnvironment env = getEnvironment();
52
        JPAEnvironment env = getEnvironment();
50
        EntityManager em = env.getEntityManager();
53
        EntityManager em = env.getEntityManager();
(-)jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/tests/wdf/jpa2/embeddable/TestNestedEmbeddables.java (+6 lines)
Lines 23-28 Link Here
23
import javax.persistence.Query;
23
import javax.persistence.Query;
24
24
25
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
25
import org.eclipse.persistence.testing.framework.wdf.JPAEnvironment;
26
import org.eclipse.persistence.testing.framework.wdf.Skip;
26
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.Address;
27
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.Address;
27
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.ContactInfo;
28
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.ContactInfo;
28
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.Employee;
29
import org.eclipse.persistence.testing.models.wdf.jpa2.employee.Employee;
Lines 43-48 Link Here
43
    private static final String ORANGE = "Orange";
44
    private static final String ORANGE = "Orange";
44
45
45
    @Test
46
    @Test
47
    @Skip(server=true)
46
    public void testNonNested() {
48
    public void testNonNested() {
47
        JPAEnvironment env = getEnvironment();
49
        JPAEnvironment env = getEnvironment();
48
        EntityManager em = env.getEntityManager();
50
        EntityManager em = env.getEntityManager();
Lines 62-67 Link Here
62
    }
64
    }
63
65
64
    @Test
66
    @Test
67
    @Skip(server=true)
65
    public void testNested() {
68
    public void testNested() {
66
        JPAEnvironment env = getEnvironment();
69
        JPAEnvironment env = getEnvironment();
67
        EntityManager em = env.getEntityManager();
70
        EntityManager em = env.getEntityManager();
Lines 115-120 Link Here
115
    }
118
    }
116
119
117
    @Test
120
    @Test
121
    @Skip(server=true)
118
    public void testNestedOuterNull() {
122
    public void testNestedOuterNull() {
119
        JPAEnvironment env = getEnvironment();
123
        JPAEnvironment env = getEnvironment();
120
        EntityManager em = env.getEntityManager();
124
        EntityManager em = env.getEntityManager();
Lines 148-153 Link Here
148
    }
152
    }
149
153
150
    @Test
154
    @Test
155
    @Skip(server=true)
151
    public void testNestedInnerNull() {
156
    public void testNestedInnerNull() {
152
        JPAEnvironment env = getEnvironment();
157
        JPAEnvironment env = getEnvironment();
153
        EntityManager em = env.getEntityManager();
158
        EntityManager em = env.getEntityManager();
Lines 184-189 Link Here
184
    }
189
    }
185
190
186
    @Test
191
    @Test
192
    @Skip(server=true)
187
    public void testNestedQuery() {
193
    public void testNestedQuery() {
188
        JPAEnvironment env = getEnvironment();
194
        JPAEnvironment env = getEnvironment();
189
        EntityManager em = env.getEntityManager();
195
        EntityManager em = env.getEntityManager();

Return to bug 301295