Difference between revisions of "EclipseLink/Development/Testing/MOXy"

From Eclipsepedia

Jump to: navigation, search
(Building MOXy Source & Running MOXy Unit Tests)
(Building & Running MOXy Unit Tests)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Building & Running MOXy Unit Tests ==
 
== Building & Running MOXy Unit Tests ==
There are two scenarios discussed on this page describing how to build MOXy source code and run the related unit tests.  The first scenario dealt with is that where a user checks out the MOXy (and other required) Eclipse projects that are checked into the Eclipse repository and wishes to build the source and run the unit tests from that context.  The second scenario deals with the case where a user wishes to build the source and run the unit tests within a working copy of the Eclipse repository.
+
There are two scenarios discussed on this page describing how to run the MOXy unit tests.  The first scenario deals with the case where a user checks out the MOXy (and other required) Eclipse projects from the Eclipse repository and wishes to build the source and run the unit tests from that context.  The second scenario deals with the case where a user wishes to build the source and run the unit tests within a working copy of the Eclipse repository.
 +
Ant 1.7 or greater is recommended when using EclipseLink's Ant build files.
 
=== Building & Running within an Eclipse Workspace ===
 
=== Building & Running within an Eclipse Workspace ===
 
* '''Building & running the MOXy test suites'''
 
* '''Building & running the MOXy test suites'''
Line 9: Line 10:
 
***Deployment XML
 
***Deployment XML
 
***Document Preservation
 
***Document Preservation
 +
**The JAXB and OXM tests can be run separately:
 +
***'test.jaxb' - this target will compile and run the JAXB tests
 +
***'test.oxm' - this target will compile and run the OXM tests
 
**The results of the tests are written to two separate .html files:  the OXM test results are written to  ''eclipselink.moxy.test/reports/oxm/junit-noframes.html'' and the JAXB results are written to ''eclipselink.moxy.test/reports/jaxb/junit-noframes.html''.
 
**The results of the tests are written to two separate .html files:  the OXM test results are written to  ''eclipselink.moxy.test/reports/oxm/junit-noframes.html'' and the JAXB results are written to ''eclipselink.moxy.test/reports/jaxb/junit-noframes.html''.
 
**Required projects:
 
**Required projects:
Line 17: Line 21:
 
**Additional libraries:
 
**Additional libraries:
 
***junit.jar - the "junit.lib" property in build.properties must be set to point to a version of junit.jar
 
***junit.jar - the "junit.lib" property in build.properties must be set to point to a version of junit.jar
 +
 
=== Building & Running within a Subversion Working Copy ===
 
=== Building & Running within a Subversion Working Copy ===
 
In the root folder of your working copy (a.k.a. the Eclipse repository trunk) there is a '''build.xml''' file and a '''build.properties''' file.  This single build script will allow you to build the EclipseLink source, as well as run a number of the EclipseLink unit tests against this source.
 
In the root folder of your working copy (a.k.a. the Eclipse repository trunk) there is a '''build.xml''' file and a '''build.properties''' file.  This single build script will allow you to build the EclipseLink source, as well as run a number of the EclipseLink unit tests against this source.
Line 29: Line 34:
 
****sdoapi.jar
 
****sdoapi.jar
 
* '''Building & running the MOXy test suites'''
 
* '''Building & running the MOXy test suites'''
 +
**The MOXy tests consist of OXM and JAXB test suites. The OXM tests are run in four different modes:
 +
***DOM
 +
***SAX
 +
***Deployment XML
 +
***Document Preservation
 
**There are three different MOXy test targets in the root '''build.xml''' file:
 
**There are three different MOXy test targets in the root '''build.xml''' file:
 
***'test.moxy' - runs the MOXy test suites (both JAXB and OXM suites)
 
***'test.moxy' - runs the MOXy test suites (both JAXB and OXM suites)

Latest revision as of 16:41, 26 November 2008

[edit] Building & Running MOXy Unit Tests

There are two scenarios discussed on this page describing how to run the MOXy unit tests. The first scenario deals with the case where a user checks out the MOXy (and other required) Eclipse projects from the Eclipse repository and wishes to build the source and run the unit tests from that context. The second scenario deals with the case where a user wishes to build the source and run the unit tests within a working copy of the Eclipse repository. Ant 1.7 or greater is recommended when using EclipseLink's Ant build files.

[edit] Building & Running within an Eclipse Workspace

  • Building & running the MOXy test suites
    • There is an ANT build script and properties file in the eclipselink.moxy.test project folder, named build.xml and build.properties respectively. The default target (test) will compile all required source, then clean and compile the MOXy test source, then run the unit tests. Simply type "ant" in the eclipselink.moxy.test project folder to compile and run the MOXy unit tests.
    • The MOXy tests consist of OXM and JAXB test suites. The OXM tests are run in four different modes:
      • DOM
      • SAX
      • Deployment XML
      • Document Preservation
    • The JAXB and OXM tests can be run separately:
      • 'test.jaxb' - this target will compile and run the JAXB tests
      • 'test.oxm' - this target will compile and run the OXM tests
    • The results of the tests are written to two separate .html files: the OXM test results are written to eclipselink.moxy.test/reports/oxm/junit-noframes.html and the JAXB results are written to eclipselink.moxy.test/reports/jaxb/junit-noframes.html.
    • Required projects:
      • eclipselink.core
      • eclipselink.core.lib
      • eclipselink.moxy
      • eclipselink.moxy.lib
    • Additional libraries:
      • junit.jar - the "junit.lib" property in build.properties must be set to point to a version of junit.jar

[edit] Building & Running within a Subversion Working Copy

In the root folder of your working copy (a.k.a. the Eclipse repository trunk) there is a build.xml file and a build.properties file. This single build script will allow you to build the EclipseLink source, as well as run a number of the EclipseLink unit tests against this source.

  • Building EclipseLink source
    • The default target (all) will clean and compile all of the EclipseLink source (including MOXy), then add the compiled classes to the eclipselink.jar (which resides in the trunk as well). Simply type "ant" in the working copy root folder to compile and JAR EclipseLink. This JAR is required by the MOXy tests.
    • Additional libraries:
      • oracle.extensions.depend.dir - this property (in build.properties) should point to a folder that contains the following JAR files:
        • xdb.jar
        • aqapi.jar
        • xmlparserv2.jar
        • ojdbc14dms_10.jar
        • sdoapi.jar
  • Building & running the MOXy test suites
    • The MOXy tests consist of OXM and JAXB test suites. The OXM tests are run in four different modes:
      • DOM
      • SAX
      • Deployment XML
      • Document Preservation
    • There are three different MOXy test targets in the root build.xml file:
      • 'test.moxy' - runs the MOXy test suites (both JAXB and OXM suites)
      • 'test.jaxb' - runs only the JAXB suite
      • 'test.oxm' - runs only the OXM test suite
    • Simply type "ant test.xxxx" in the root folder of your working copy to run the tests
    • The results of the tests are written out to .html files: the OXM test results are written to <working copy root>/moxy/eclipselink.moxy.test/reports/oxm/junit-noframes.html and the JAXB results are written to <working copy root>/moxy/eclipselink.moxy.test/reports/jaxb/junit-noframes.html.
    • Additional libraries:
      • junit.jar - the "junit.lib" property in build.properties must be set to point to a version of junit.jar
      • tools.jar - the "tools.lib" property in build.properties must be set to point to a version of tools.jar