Jump to: navigation, search

EclipseLink/Development/Testing/CacheCoordination

CacheCoordination Testing

How to run EclipseLink JMS CacheCoordination Testing on WebLogic 10.3

Testing With Single Machine (or localhost) Configuration

  • This test configuration assumes you're running following steps from EclipseLink's trunk/jpa/eclipselink.jpa.test directory
  • Instructions are for Linux/Unix, but with minor changes in scripts/commands can be run on Windows.

1) Modify setEnv.sh as follow:

setenv WL_HOME /yourMiddleware_home/wlserver_10.3
setenv JAVA_HOME /yourMiddleware_home/jrockit_160_05_R27.6.2-20
setenv ANT_HOME /yourMiddleware_home/modules/org.apache.ant_1.7.0
setenv PATH ${PATH}:${WL_HOME}/server/native/linux/i686

2) Modify test.properties with serverName and DBconfig:

server.name=weblogic
jdbc.driver.jar=../../../extension.oracle.lib.external/ojdbc6_11.jar
db.driver=oracle.jdbc.OracleDriver
db.url=jdbc:oracle:thin:@localhost:1521:toplink
db.user=username
db.pwd=password
db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform

3) Modify weblogic.properties with following:

server.url=t3://myhostName:7001/
server.lib=/yourMiddleware_home/wlserver_10.3/server/lib
weblogic.home=/yourMiddleware_home/wlserver_10.3/server/
weblogic.domain=/yourMiddleware_home/wlserver_10.3/samples/domains/eclipselink
weblogic.port=7001
weblogic.host=myhostName
domain.name=eclipselink
rcm.wls.server1.httphost=${weblogic.host}
rcm.wls.server2.httphost=${weblogic.host}
rcm.wls.server3.httphost=${weblogic.host}
rcm.wls.server1.name=myserver
rcm.wls.server2.name=server2
rcm.wls.server3.name=server3
rcm.wls.server1.port=7001
rcm.wls.server2.port=7021
rcm.wls.server3.port=7031
cachecoordination.protocol=jms

4) Modify weblogic.xml to replace "localhost" with your HostName:

    <target name="weblogic-start-nosleep">
        <wlserver fork="true" spawn="true" weblogichome="${weblogic.home}"
            dir="${weblogic.domain}" host="myhostName" generateConfig="true" verbose="true"
            username="${server.user}" password="${server.pwd}" action="start">

	    ............
    <target name="weblogic-stop">
        <wlserver fork="true" failonerror="false" weblogichome="${weblogic.home}"
            dir="${weblogic.domain}" host="myhostName"
            username="${server.user}" password="${server.pwd}" action="shutdown">
        </wlserver>
    </target>

5) Configure domain and start AdminServer: Run setEnv.sh, then run targets server-install and server-start:

source setEnv.sh
ant -l wl_install.log server-install
ant -l wl_start.log server-start

6) Configure JDBC datasource: while AdminServer(server1) is running, in separate terminal run server-setup target, then server-stop:

ant  -l wl_setup.log server-setup
ant  -l wl_stop.log server-stop

7) Prepare for JMS configuration: Remove "lok" files, if any:

rm /yourMiddleware_home/wlserver_10.3/samples/domains/eclipselink/edit.lok
rm /yourMiddleware_home/wlserver_10.3/samples/domains/eclipselink/config/config.lok

8) Configure WL for JMS Cachecoordination: copy following into an xml file (namely, interop-jms.xml) and place it in /yourMiddleware_home/wlserver_10.3/samples/domains/eclipselink/config/jms/

<weblogic-jms xmlns=...>

<connection-factory name="EclipseLink Topic Factory">
     <jndi-name>jms/EclipseLinkTopicConnectionFactory</jndi-name>
     <transaction-params>
     <xa-connection-factory-enabled>false</xa-connection-factory-enabled>
     </transaction-params>
 </connection-factory>

  <topic name="EclipseLink Topic">
     <sub-deployment-name>EclipseLink JMSServer</sub-deployment-name>
     <delivery-params-overrides>
     <delivery-mode>Non-Persistent</delivery-mode>
     </delivery-params-overrides>
     <jndi-name>jms/EclipseLinkTopic</jndi-name>
 </topic>
</weblogic-jms>

9) Make changes to /yourMiddleware_home/wlserver_10.3/samples/domains/eclipselink/config/config.xml as shown below:

<server>
<name>myserver</name>
<listen-port>7001</listen-port>
<listen-address>myhostName</listen-address>
</server>
<server>
<name>server2</name>
<native-io-enabled>true</native-io-enabled>
<listen-port>7021</listen-port>
<listen-address>myhostName</listen-address>
</server>
<server>
<name>server3</name>
<native-io-enabled>true</native-io-enabled>
<listen-port>7031</listen-port>
<listen-address>myhostName</listen-address>
</server>
...
<jms-server>
<name>EclipseLink JMSServer</name>
<target>myserver</target>
<store-enabled>false</store-enabled>
<allows-persistent-downgrade>true</allows-persistent-downgrade>
<hosting-temporary-destinations>false</hosting-temporary-destinations>
</jms-server>
<jms-interop-module>
<name>interop-jms</name>
<sub-deployment>
<name>EclipseLink Topic Factory</name>
<target>myserver</target>
</sub-deployment>
<sub-deployment>
<name>EclipseLink JMSServer</name>
<target>EclipseLink JMSServer</target>
</sub-deployment>
<descriptor-file-name>jms/interop-jms.xml</descriptor-file-name>
</jms-interop-module>

10) Also add all servers to JDBC-system-resource target element:

<jdbc-system-resource>
<name>CP-ejbPool</name>
<target>myserver,server2,server3</target>
<deployment-order>1</deployment-order>
<descriptor-file-name>jdbc/CP-ejbPool-1657-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
<jdbc-system-resource>
<name>TxDS-EclipseLinkDS</name>
<target>myserver,server2,server3</target>
<deployment-order>4</deployment-order>
<descriptor-file-name>jdbc/TxDS-EclipseLinkDS-6646-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>

11) Start all servers using following target from trunk/jpa/eclipselink.jpa.test:

ant -f build.xml -l rcm_start.log server-start-cachecoordination

12) Run CacheCoordination tests using following target from trunk/jpa/eclipselink.jpa.test:

ant -f build.xml -l rcm_test.log server-run-test-cachecoordination

13) (lucky13!) Results are in report dir:

  • trunk/jpa/eclipselink.jpa.test/report/junit-noframes.html
  • FEB-26-2009: all 6 tests should pass


Testing With Multiple Machines (i.e remote managed servers) Configuration

    This configuration assumes:
         o AdminServer(server1) and one managedServer(server3) will be on Machine1(localhost)
         o managedServer2(server2) will be hosted on Machine2(remote)

1) Follow steps 1 thru 4 from "Testing with Single Machine Configuration" above

2) Install WL on all machines(Machine1, Machine2) that going to be included as part of Cluster (need to confirm if this is really necessary)

3) On Machine1, create a cluster as follow:

   * create two managed servers (server3 with Machine1's ListenAddress, and server2 with Machine2's ListenAddress)
   * create two machines (machine1, machine2)
   * create a cluster (mycluster with default listenAddress and optionally change portNumber to 7011)
   * add two managed servers (server2, server3) to the cluster(mycluster)
   * name the domain (eclipselink) and set location (i.e yourWL_ROOT_DIR/wlserver_10.3/samples/domains)

4) On Machine1, from yourWL_ROOT_DIR/wlserver_10.3/common/bin/ dir, you could "pack" template of your domain: see http://edocs.bea.com/common/docs103/pack/tasks.html

./pack.sh -managed=true -domain=yourDomain_DIR -template=mydomain_managed.jar -template_name="MyManagedServerDomain"

5) Copy template jar generated in step 4 above to Machine2. Then to create managedServer from the template, go to Machine2/yourWL_ROOT_DIR/wlserver_10.3/common/bin/ dir, you could "unpack" template of your domain: see http://edocs.bea.com/common/docs103/pack/tasks.html

./unpack.sh -managed=true -domain=yourDomain_DIR -template=mydomain_managed.jar"

6) Configure JDBC datasource and JMS server on adminServer either using AdminConsole or following steps 7 thru 10 from "Testing with Single Machine Configuration" above

7) start adminServer(myserver) from Machine1's yourDomain directory:

   bin/startWebLogic.sh

8) start remote managedServer(server2) from Machine2's yourDomain directory:

   bin/startserver2.sh

9) start local managedServer(server3) from Machine1's yourDomain directory:

   bin/startManagedWebLogic.sh server3 http://adminServerHost:adminServerPort

10) Run tests following step #12 from "Testing with Single Machine Configuration" above