Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/Testing/SDO

< EclipseLink‎ | Development‎ | Testing
Revision as of 23:33, 27 October 2007 by Michael.obrien.oracle.com (Talk | contribs) (Running the SDO Junit tests)

Summary

The SDO test suite is written using JUnit. It consists of a set of jars that contain various tests and resources. The SDO tests are contained in the eclipselink.sdo.test project. This page is intended to outline the setup and execution steps required to successfully run the SDO JUnit tests. There are 2 ways to checkout EclipseLink and 2 ways to run the tests.

  1. Checkout using subclipse all projects individually into your eclipse workspace
    1. Build classes in eclipse and run/debug there
    2. Build/run classes using Ant
  2. Checkout using tortoiseSVN the root trunk into a folder outside your workspace and either use ant to build an eclipselink.jar or create proxy projects using link to source from eclipse - Recommended if you would like to build the eclipselink.jar
    1. Build classes in eclipse and run/debug there
    2. Build/run classes using Ant

Building & Running the SDO Junit tests

Prerequisites

  1. Eclipse installed with the subclipse pluggin or TortoiseSVN for out of eclipse checkouts
  2. Required projects eclipselink.core and eclipselink.lib checked out into workspace/view
  3. eclipselink.sdo, eclipselink.sdo.lib and eclipselink.sdo.test checked out into workspace/view
  4. Edit build.properties either at this project level or globally in your user directory.
  • Windows: C:\Documents and Settings\<user-dir> Linux:
    • javaee.lib=<jar_location>/javaee.jar - required by MOXy or core tests
    • junit.lib=<JUNIT_HOME>/junit.jar - required by eclipselink.sdo.test
    • tools.lib=<JAVA_HOME/lib/tools.jar - required by eclipselink.sdo.test
  1. Currently an integrated test suite that will run all EclipseLink projects including SDO is being developed. You can run the SDO test suite by overriding some variables in your <user-dir>/build.properties depending on whether you are running inside an eclipse workspace (2) or not (1). The eclipselink.core.lib variable already set on the local build.properties will resolve a dependency on org.eclipse.persistence.internal.libraries.asm in eclipselink-asm.jar
    1. Running ant outside an eclipse workspace
      1. Leave eclipselink.* variables as-is on the local build.properties
    2. Running ant inside an eclipse workspace
      1. Modify the following variables to account for the different directory structure...
        1. eclipselink.core=../../foundation/eclipselink.core
        2. eclipselink.core.lib=../../foundation/eclipselink.core.lib

Configuration options

  • The tests run by default using a non-static customContext=true which is the mode that will normally be used in a multithreaded container.
    • customContext = true (run test using an thread-safe instantiable instance of SDOHelperContext) - default
    • customContext = false (run test using static HelperContext Singleton)

Building & Running within an Eclipse Workspace via subclipse checkout

Running using Ant

  1. Navigate to the <workspace>/eclipselink.sdo.test directory
  2. Run the sdo.test/build.xml by typing "ant". This will compile in order eclipselink.core, eclipselink.sdo and eclipselink.sdo.test and should take around 2-4 min.
  3. View results in the reports subdirectory

Running using Eclipse

  1. Setting up Eclipse
    1. Checkout 5 of 11 new projects (projects will be created inside the workspace) (core,core.lib,sdo,sdo.lib,sdo.test) using SVN (turn off automatic build temporarily)

Eclipselink sdo java projects workspace ide cap.jpg

  1. Goto "Running a suite"

Building & Running within a Subversion checkout (outside an eclipse workspace)

  1. Create your own view directory - for example "c:/view_el/"
  2. Check out the SVN project for SDO into this directory using the format svn+ssh://<username>@<svn_session>/svnroot/technology/org.eclipse.persistence/trunk
  3. Either build all 4 core, jpa, moxy and sdo projects into an eclipselink.jar by following the instructions in Building EclipseLink Source - specifically the section on setting up the extension jars not included in eclipselink.core.lib like (aqapi.jar, sdoapi.jar(spatial), ojdb14dms_10.jar(or other jdbc lib), xdb.jar, xml.jar, xmlparserv2.jar), or allow the sdo test script to run off classes by doing the following...

Running using Ant

  1. Edit your local or global build.properties file
  2. Navigate to the eclipselink.sdo.test directory
  3. Run sdo.test/build.xml by typing "ant"
  4. View results in the reports subdirectory under true|false

Running using Eclipse

  1. Setting up Eclipse
    1. Create 5 of 11 new projects (core,core.lib,sdo,sdo.lib,sdo.test) from existing source = "c:/view_el/eclipselink.* (turn off automatic build temporarily)
    2. Eclipselink sdo java projects ide cap.jpg
    3. At this point you should get 2 errors if the TOOLS_LIB variable is not set for sdo.test. Set this variable globally using Window | Preferences | Java | Build Path | Classpath Variables - new -> name=TOOLS_LIB, path==<JAVA_HOME/lib/tools.jar
    4. Goto "Running a suite"

Running the SDO Junit tests

Running a suite

  1. Turn "build automatically" back on to build classes
  2. Pick a suite - we will use org.eclipse.persistence.testing.sdo.model.sequence.SDOSequenceTestCS as it is small and utilizes resources as well as core xsd/xml define/load functions.
  3. Create a new java application run/debug target
  4. Modify the arguments tab|working directory to point to ${workspace_loc:eclipselink.sdo.test/resource} or create a resource variable to reuse in other targets - this is where all tests will execute.
  5. Eclipselink sdo test working directory.jpg
  6. Setup sdo variables, in particular those used by class generation
    1. Window | Preferences | Java | Installed JRE's | <your JDK> | Edit | Default VM Arguments
      1. -Djaxb.test.contextpath=oracle.toplink.testing.ox.jaxb.dom
      2. -Dtoplink.xml.platform=oracle.toplink.platform.xml.jaxp.JAXPPlatform
      3. -DuseLogging=true
      4. -DuseSAXParsing=true
      5. -DuseDeploymentXML=false
      6. -DignoreCRLF=true
      7. -DcustomContext=true
      8. -Xloggc:c:\wse\gc.log -DXprof (profiling log - optional)
      9. -DXmx512m (increase memory size - may be required for some larger suites like loadandsave)
      10. -Dparser=org.eclipse.persistence.platform.xml.jaxp.JAXPParser
      11. (Set the classpath used by the class generation test suite - relative to ${resource.dir}) - here for projects checked out to your workspace
      12. -Dsdo.classgen.compile.path=../eclipselink.sdo/classes;../eclipselink.sdo.lib;../classes;../eclipselink.core.lib/mail.jar;../eclipselink.core.lib/activation.jar;../%JAVA_HOME%/lib/tools.jar;../
      13. Above classgen.compile.path to be verified 20071026
  7. Run the test and observe results in the Console

Debugging

Interpreting Ant Test Results

Back to the top