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

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

Line 4: Line 4:
  
 
There are several ways to run the tests.
 
There are several ways to run the tests.
* ant
+
* Ant
 
* Eclipse JUnit
 
* Eclipse JUnit
 
* Testing Browser
 
* Testing Browser
  
==Ant==
+
Prior to running the tests, a build.properties file must exist in your user home directory with the following properties:
  
 +
* junit.lib=<full path of junit 4 jar>
 +
* tools.lib=<full path of tools jar in your JDK installation - usually in JAVA_HOME/lib>
 +
* jdbc.driver=<full path to your JDBC driver>
 +
* db.driver=<classname of your JDBC driver>
 +
* db.url=<JDBC url of your DB>
 +
* db.user=<db username>
 +
* db.pwd=<db password>
 +
* (optional) db.platform=<EclipseLink Database Platform to use> - this is only necessary if EclipseLink does not properly dectect you DB with its database detection
  
 +
==Ant==
  
The tests can be run from two build scripts
+
The tests can be run from two ant build scripts
  
 
1. The base build.xml (in trunk)
 
1. The base build.xml (in trunk)
 +
 +
You can run the following targets:
 +
* test-core - run the Core LRG
 +
* test-core-srg - run the Core SRG
  
 
2. The build.xml script in foundation/eclipselink.core.test
 
2. The build.xml script in foundation/eclipselink.core.test
 +
* test-lrg - run the Core LRG
 +
* test-core-srg - run the Core SRG
  
The eclipselink.core.test/build.xml contains several ant targets for testingThe test target will run the LRG.  Ensure that the eclipselink.core.test/test.properties file has been configured for your database, you may also overwrite this file in {user.home}/test.properties.
+
Test logging will appear on Standard out and Standard ErrorTest results will appear in foundation/eclipselink.core.test/reports
  
  ant test
+
==Eclipse JUnit==
  
This will run the LRG, the results will be output into the report directory as html.
+
The eclipselink.core.test Eclipse project contains launch targets in the elipselink.core.test/run directory to run the LRG or SRG through the Eclipse JUnit integration.
 
+
The following ant test targets are defined:
+
* test.srg
+
* test.lrg
+
 
+
==Eclipse JUnit==
+
The eclipselink.core.test Eclipse project contains launch targets in the elipselink.core.test/run directory to run the LRG or SRG through the Eclipse JUnit integration.  Ensure that the eclipselink.core.test/run directory contains a test.properties file that includes configuration information for your database.
+
  
 
Note that the majority of the foundation tests are built using a legacy test framework which has been migrated to extend JUnit.  One issue is that the total number of tests are unknown before the tests are setup, so the progress bar in Eclipse will not be accurate.
 
Note that the majority of the foundation tests are built using a legacy test framework which has been migrated to extend JUnit.  One issue is that the total number of tests are unknown before the tests are setup, so the progress bar in Eclipse will not be accurate.
Line 35: Line 43:
 
Ensure the following (Java | Build Path | Classpath Variables) are set:
 
Ensure the following (Java | Build Path | Classpath Variables) are set:
 
* TOOLS_LIB variable has been mapped to your JDK tools.jar
 
* TOOLS_LIB variable has been mapped to your JDK tools.jar
* ORACLE_JDBC_LIB variable has been mapped to your database's JDBC driver (compile-time for extension project)
 
 
* JDBC_LIB variable has been mapped to your database's JDBC driver (vendor-agnostic driver)
 
* JDBC_LIB variable has been mapped to your database's JDBC driver (vendor-agnostic driver)
 
* Some JDBC drivers may require the system library path to be set, or dlls to be on the path
 
* Some JDBC drivers may require the system library path to be set, or dlls to be on the path
Line 42: Line 49:
 
Early in its existence, this product was tested with an in-house testing framework.  A large number of tests are still available through this test framework.  Testing is gradually being migrated to frameworks such as JUnit, but the GUI tool available in the legacy framework is still quite useful for testing.  The code for this test framework is stored in the eclipselink.core.test project.
 
Early in its existence, this product was tested with an in-house testing framework.  A large number of tests are still available through this test framework.  Testing is gradually being migrated to frameworks such as JUnit, but the GUI tool available in the legacy framework is still quite useful for testing.  The code for this test framework is stored in the eclipselink.core.test project.
  
The eclipselink.core.test Eclipse project contains launch targets in the elipselink.core.test/run directory to run the Testing Browser.
+
The eclipselink.core.test Eclipse project contains launch targets in the eclipselink.core.test/run directory to run the Testing Browser.  Prior to running that target, you should run the "process-resource" target in the build.xml file in eclipselink.core.test (If you have run a full build, it will have been run already).  Launching the browser is a matter of running that build target.
  
 
You could also configure your own run target:
 
You could also configure your own run target:
Line 57: Line 64:
 
### jpa.test
 
### jpa.test
 
## Oracle Extensions
 
## Oracle Extensions
### eclipselink.extension.oracle
+
### eclipselink.extension.oracle (if doing Oracle specific testing)
### eclipselink.extension.oracle.test
+
### eclipselink.extension.oracle.test (if doing Oracle specific testing)
### jars required to compile eclipselink.extension.oracle - aqapi.jar, sdoapi.jar, dms.jar, xdb.jar, xml.jar, xmlparserv2.jar
+
### jars required to compile eclipselink.extension.oracle - aqapi.jar, sdoapi.jar, dms.jar, xdb.jar, xml.jar, xmlparserv2.jar (if doing Oracle specific testing)
 
## External Extensions
 
## External Extensions
 
### <trunk>/extension.lib.external (user created)
 
### <trunk>/extension.lib.external (user created)

Revision as of 09:42, 1 August 2008

Running the foundation LRG

The foundation tests consist of an LRG (long regression), SRG (short regression), and various non-classified tests (non-LRG). If any code was changed in org.eclipse.persistence.core it is recommended to run the LRG. If minimal changes were made the SRG is sufficient. Depending on what was changed, running some of the non-LRG tests may also be desirable.

There are several ways to run the tests.

  • Ant
  • Eclipse JUnit
  • Testing Browser

Prior to running the tests, a build.properties file must exist in your user home directory with the following properties:

  • junit.lib=<full path of junit 4 jar>
  • tools.lib=<full path of tools jar in your JDK installation - usually in JAVA_HOME/lib>
  • jdbc.driver=<full path to your JDBC driver>
  • db.driver=<classname of your JDBC driver>
  • db.url=<JDBC url of your DB>
  • db.user=<db username>
  • db.pwd=<db password>
  • (optional) db.platform=<EclipseLink Database Platform to use> - this is only necessary if EclipseLink does not properly dectect you DB with its database detection

Ant

The tests can be run from two ant build scripts

1. The base build.xml (in trunk)

You can run the following targets:

  • test-core - run the Core LRG
  • test-core-srg - run the Core SRG

2. The build.xml script in foundation/eclipselink.core.test

  • test-lrg - run the Core LRG
  • test-core-srg - run the Core SRG

Test logging will appear on Standard out and Standard Error. Test results will appear in foundation/eclipselink.core.test/reports

Eclipse JUnit

The eclipselink.core.test Eclipse project contains launch targets in the elipselink.core.test/run directory to run the LRG or SRG through the Eclipse JUnit integration.

Note that the majority of the foundation tests are built using a legacy test framework which has been migrated to extend JUnit. One issue is that the total number of tests are unknown before the tests are setup, so the progress bar in Eclipse will not be accurate.

Ensure the following (Java | Build Path | Classpath Variables) are set:

  • TOOLS_LIB variable has been mapped to your JDK tools.jar
  • JDBC_LIB variable has been mapped to your database's JDBC driver (vendor-agnostic driver)
  • Some JDBC drivers may require the system library path to be set, or dlls to be on the path

Testing Browser

Early in its existence, this product was tested with an in-house testing framework. A large number of tests are still available through this test framework. Testing is gradually being migrated to frameworks such as JUnit, but the GUI tool available in the legacy framework is still quite useful for testing. The code for this test framework is stored in the eclipselink.core.test project.

The eclipselink.core.test Eclipse project contains launch targets in the eclipselink.core.test/run directory to run the Testing Browser. Prior to running that target, you should run the "process-resource" target in the build.xml file in eclipselink.core.test (If you have run a full build, it will have been run already). Launching the browser is a matter of running that build target.

You could also configure your own run target:

  1. Run the process.resource target of the build.xml in the base directory of the eclipselink.core.test project as an ant script. This will copy some xml files to your eclipselink.core.test/run directory.
  2. Create a Java Application run target on the eclipselink.core.test project - I'll call it Testing Browser
  3. Use org.eclipse.persistence.testing.framework.ui.TestingBrowserFrame as the main class
  4. Add "-Xmx256m -Djava.security.manager -Djava.security.policy==${workspace_loc:eclipselink.core.test}/resource/java.policy.allpermissions" to the VM arguments section of the Arguments tab
  5. Add the following to the classpath: (note these are listed by category and you may be able to run subsets of the tests without certain categories)
    1. JDBC
      1. your JDBC driver of choice
    2. JPA
      1. jpa.core
      2. jpa.test
    3. Oracle Extensions
      1. eclipselink.extension.oracle (if doing Oracle specific testing)
      2. eclipselink.extension.oracle.test (if doing Oracle specific testing)
      3. jars required to compile eclipselink.extension.oracle - aqapi.jar, sdoapi.jar, dms.jar, xdb.jar, xml.jar, xmlparserv2.jar (if doing Oracle specific testing)
    4. External Extensions
      1. <trunk>/extension.lib.external (user created)
      2. jars required run included (Testing Browser.launch) configuration
      3. Add an empty library project called extension.lib.external (user created) and put any and the following launch required jars into this folder - point the project to this folder and any dependencies in the classpath of the included eclipse launch targets will resolve.
      4. postgresql_jdbc3_82.jar, db2java_9.zip, jconn3.jar, mysql-connector-java-5.0.7-bin.jar
    5. Java
      1. a TOOLS_LIB variable that points to the tools jar in your java installation
    6. Generated classes
      1. Add the run directory of the eclipselink.core.test project. This is where all java output goes. We output some java files and then compile them. They will go there.
  6. Run the "Testing Browser" run target
  7. Input your DB login information. You can do this by selecting a value from the "Quick Login" drop box and then edit the form on the right side of the GUI with any information that is different from what is already populated
  8. Run either the SRGTestModel or the LRGTestModel listed on the right side of the GUI by selecting it and then clicking the "Run Test" button.

Back to the top