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

From Eclipsepedia

Jump to: navigation, search
(Summary)
m (Eclipse 3.5 Galileo 64-Bit Edition)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
The EclipseLink test suites are written using JUnit. They consist of a set of jars and classes that contain various tests and resources. The tests are contained in the eclipselink.*.test projects.  This page is intended to outline the setup and execution steps required to successfully run the JUnit tests.  There are 2 ways to checkout EclipseLink and for each of these there are 2 ways to run tests.
+
The EclipseLink test suites are written using [http://sourceforge.net/projects/junit/files/junit/4.5/junit-4.5.jar/download JUnit 4.5 (latest (''at least v20090423'') version)]. They consist of a set of jars and classes that contain various tests and resources. The tests are contained in the eclipselink.*.test projects.  This page is intended to outline the setup and execution steps required to successfully run the JUnit tests. The current minimum version level is [http://sourceforge.net/projects/junit/files/junit/4.5/junit-4.5.jar/download JUnit 4.5 (latest version)] (Which ships in Galileo).  There are 2 ways to checkout EclipseLink and for each of these there are 2 ways to run tests.
 
# Checkout using [http://subclipse.tigris.org/update_1.2.x Subclipse] all projects individually into your eclipse workspace
 
# Checkout using [http://subclipse.tigris.org/update_1.2.x Subclipse] all projects individually into your eclipse workspace
 
## Build classes in eclipse and run/debug there
 
## Build classes in eclipse and run/debug there
Line 12: Line 12:
 
/url:svn+ssh://username@eclipse/svnroot/rt/org.eclipse.persistence/trunk /closeonend:1
 
/url:svn+ssh://username@eclipse/svnroot/rt/org.eclipse.persistence/trunk /closeonend:1
 
</nowiki></pre></blockquote>
 
</nowiki></pre></blockquote>
 +
 +
<font color="red">Note: '''@eclipse''' is your putty session name</font>
 +
  
 
===Recommended eclipse.ini settings for EclipseLink===
 
===Recommended eclipse.ini settings for EclipseLink===
The following eclipse.ini settings are recommended.  The -showLocation, -framework and -Dsun.lang.ClassLoader.allowArraySyntax are new, the XXMaxPermSize attribute is modified.
+
====Eclipse 3.5 Galileo 64-Bit Edition====
 +
*Note: '''-showlocation''' must be at the top before '''-product''' or '''org.eclipse.platform''' in order to work up to Eclipse 3.6.
 +
*The following eclipse.ini settings are recommended.  The -showLocation, -framework and -Dsun.lang.ClassLoader.allowArraySyntax are new, the XXMaxPermSize attribute is modified.
  
 
<pre>
 
<pre>
 +
-startup
 +
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
 +
--launcher.library
 +
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519
 
-showlocation
 
-showlocation
 
-showsplash
 
-showsplash
 
org.eclipse.platform
 
org.eclipse.platform
 
--launcher.XXMaxPermSize
 
--launcher.XXMaxPermSize
512M
+
512m
 
-framework
 
-framework
 
plugins\org.eclipse.osgi_3.4.0.v20080605-1900.jar
 
plugins\org.eclipse.osgi_3.4.0.v20080605-1900.jar
 +
-Dsun.lang.ClassLoader.allowArraySyntax=true
 +
-Dosgi.requiredJavaVersion=1.5
 +
-vmargs
 +
-Xms1024m
 +
-Xmx1024m
 +
-XX:+UseParallelGC
 +
-XX:PermSize=256M
 +
</pre>
 +
 +
====Eclipse 3.5 Galileo 32-Bit Edition====
 +
The following eclipse.ini settings are recommended.  The -showLocation, -framework and -Dsun.lang.ClassLoader.allowArraySyntax are new, the XXMaxPermSize attribute is modified.
 +
 +
<pre>
 +
-showlocation
 +
-showsplash org.eclipse.platform
 +
--launcher.XXMaxPermSize
 +
512M
 
-vmargs
 
-vmargs
 
-Dsun.lang.ClassLoader.allowArraySyntax=true
 
-Dsun.lang.ClassLoader.allowArraySyntax=true
 
-Dosgi.requiredJavaVersion=1.5
 
-Dosgi.requiredJavaVersion=1.5
-Xms40m
+
-Xms1024m
-Xmx512m
+
-Xmx1024m
 
</pre>
 
</pre>
 +
 +
====Running 32-Bit Eclipse when the default JAVA_HOME is a 64-Bit JVM====
 +
*If you are running 32-bit versions of Eclipse on a 64 bit OS where the default JVM is 64-bit like the server edition of the SUN JRE - you must launch Eclipse by specifying the 32-Bit JRE as follows
 +
<source lang="java">
 +
C:\eclipse3532-bit-home\eclipse.exe -vm c:/jdk1.6.0_32-bit/bin/java.exe
 +
</source>
 +
 
===Importing EclipseLink Projects Into Eclipse===
 
===Importing EclipseLink Projects Into Eclipse===
 
*Right click in "Package Explorer" or "Navigator" and select Import | Existing projects into workspace
 
*Right click in "Package Explorer" or "Navigator" and select Import | Existing projects into workspace
Line 35: Line 68:
 
*Select all or a subset of projects
 
*Select all or a subset of projects
  
===Prerequisites===
+
=== Prerequisites ===
* [http://tortoisesvn.tigris.org TortoiseSVN] and a saved [http://www.chiark.greenend.org.uk/~sgtatham/putty PuTTY] SSH session
+
 
* ''TortoiseSVN - network setting - SSH client'' set as '''<TortoiseSVN_HOME>\bin\TortoisePlink -l <userName> -pw <password_cleartext>'''
+
*[http://tortoisesvn.tigris.org TortoiseSVN] and a saved [http://www.chiark.greenend.org.uk/~sgtatham/putty PuTTY] SSH session  
[[Image:Explorer_right_click_svn_settings_menu.JPG|400px]]  
+
*''TortoiseSVN - network setting - SSH client'' set as '''&lt;TortoiseSVN_HOME&gt;\bin\TortoisePlink -l &lt;userName&gt; -pw &lt;password_cleartext&gt;'''
*[http://wiki.eclipse.org/EclipseLink/Building/Automate Automated SVN or command-line SVN setup]
+
 
* You will need to enable some ports or just disable your software firewall.
+
[[Image:Explorer right click svn settings menu.JPG|400px]]  
* Eclipse 3.2-3.4|1.5 installed with the subclipse plug-in for in-eclipse checkouts
+
 
* Referenced core projects '''org.eclipse.persistence.core''' and '''eclipselink.core.lib''' checked out into workspace or view
+
*[http://wiki.eclipse.org/EclipseLink/Building/Automate Automated SVN or command-line SVN setup]  
* Required projects for your specific view '''org.eclipse.persistence.sdo|moxy|jpa|dbws''', '''eclipselink.sdo|moxy|jpa|dbws.lib''' and '''eclipselink.sdo|moxy|jpa|dbws.test''' checked out into workspace or view
+
*You will need to enable some ports or just disable your software firewall.  
* If using Ant instead of Eclipse to run - edit build.properties either at this project level or better - globally override the following in your user directory on windows: ''C:/Documents and Settings/<user-dir>/build.properties''
+
*Eclipse 3.2-3.4|1.5 installed with the subclipse plug-in for in-eclipse checkouts  
<blockquote style="background: grey; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki>
+
*Referenced core projects '''org.eclipse.persistence.core''' and '''eclipselink.core.lib''' checked out into workspace or view  
javaee.lib=<jar_location>/javaee.jar - required by MOXy or core tests
+
*Required projects for your specific view '''org.eclipse.persistence.sdo|moxy|jpa|dbws''', '''eclipselink.sdo|moxy|jpa|dbws.lib''' and '''eclipselink.sdo|moxy|jpa|dbws.test''' checked out into workspace or view  
junit.lib=<JUNIT_HOME>/junit.jar  
+
*If using Ant instead of Eclipse to run - edit build.properties either at this project level or better - globally override the following in your user directory on windows: ''C:/Documents and Settings/&lt;user-dir&gt;/build.properties''
</nowiki></pre></blockquote>
+
<blockquote style="border: 1px solid rgb(153, 153, 153); padding: 1em; background: grey none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><pre>junit.lib=&lt;JUNIT_HOME&gt;/junit.jar  
*Override any project specific variables in your ''<user-dir>/build.properties'' depending on whether you are running inside an eclipse workspace or outside.
+
</pre></blockquote>  
 +
*Override any project specific variables in your ''&lt;user-dir&gt;/build.properties'' depending on whether you are running inside an eclipse workspace or outside.  
 +
*If the directory variable '''extensions.depend.dir''' is not in the standard expected location - 1 level above the trunk at '''&lt;trunk&gt;/../extension.lib.external''' then override it in your own build.properties using the following similar line
 +
**<font color="red">extensions.depend.dir=E:/view_libs/extension.lib.external</font>
 +
*Add the following javac.debug properties if you are debugging in Eclipse using code built either by Eclipse or Ant.
 +
<pre>javac.debug=true
 +
javac.debuglevel=lines,vars,source
 +
</pre>
  
 
===Classpath Variables===
 
===Classpath Variables===
Line 63: Line 103:
 
** XML_LIB variable has been mapped to xml.jar
 
** XML_LIB variable has been mapped to xml.jar
 
** XMLPARSERV2_LIB variable has been mapped to the oracle specific xmlparserv2.jar
 
** XMLPARSERV2_LIB variable has been mapped to the oracle specific xmlparserv2.jar
 +
 +
The following classpath variables are required for the example.jpa.common project
 +
*javax-persistence has been mapped to /jpa/plugins/javax.persistence*.jar (currently _2.0_preview)
 +
*eclipselink-jar variable has been mapped to eclipselink.jar at the SVN root
 +
 +
The following classpath variable is required for the util.workbench* projects
 +
*ECLIPSELINK_JAR has been mapped to eclipselink.jar at the SVN root
  
 
===Eclipse Preparation===
 
===Eclipse Preparation===

Latest revision as of 14:22, 16 May 2011

Contents

[edit] Summary

The EclipseLink test suites are written using JUnit 4.5 (latest (at least v20090423) version). They consist of a set of jars and classes that contain various tests and resources. The tests are contained in the eclipselink.*.test projects. This page is intended to outline the setup and execution steps required to successfully run the JUnit tests. The current minimum version level is JUnit 4.5 (latest version) (Which ships in Galileo). There are 2 ways to checkout EclipseLink and for each of these there are 2 ways to run 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 1.7 or greater
  2. or.. Checkout using TortoiseSVN the root trunk into a folder outside your workspace (IE: c:/view_root) 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 - but you will require some build.properties changes.
    1. Build classes in eclipse and run/debug there
    2. Build/run classes using Ant 1.7 or greater
Checkout using right-click menu | checkout, or via commandline :
view_root>tortoiseProc /command:checkout /path:"c:\view_root" 
/url:svn+ssh://username@eclipse/svnroot/rt/org.eclipse.persistence/trunk /closeonend:1

Note: @eclipse is your putty session name


[edit] Recommended eclipse.ini settings for EclipseLink

[edit] Eclipse 3.5 Galileo 64-Bit Edition

  • Note: -showlocation must be at the top before -product or org.eclipse.platform in order to work up to Eclipse 3.6.
  • The following eclipse.ini settings are recommended. The -showLocation, -framework and -Dsun.lang.ClassLoader.allowArraySyntax are new, the XXMaxPermSize attribute is modified.
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.0.200.v20090519
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
-framework
plugins\org.eclipse.osgi_3.4.0.v20080605-1900.jar
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dosgi.requiredJavaVersion=1.5
-vmargs
-Xms1024m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M

[edit] Eclipse 3.5 Galileo 32-Bit Edition

The following eclipse.ini settings are recommended. The -showLocation, -framework and -Dsun.lang.ClassLoader.allowArraySyntax are new, the XXMaxPermSize attribute is modified.

-showlocation
-showsplash org.eclipse.platform
--launcher.XXMaxPermSize
512M
-vmargs
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dosgi.requiredJavaVersion=1.5
-Xms1024m
-Xmx1024m

[edit] Running 32-Bit Eclipse when the default JAVA_HOME is a 64-Bit JVM

  • If you are running 32-bit versions of Eclipse on a 64 bit OS where the default JVM is 64-bit like the server edition of the SUN JRE - you must launch Eclipse by specifying the 32-Bit JRE as follows
C:\eclipse3532-bit-home\eclipse.exe -vm c:/jdk1.6.0_32-bit/bin/java.exe

[edit] Importing EclipseLink Projects Into Eclipse

  • Right click in "Package Explorer" or "Navigator" and select Import | Existing projects into workspace
  • Make sure the check box "copy projects into workspace" is UN-checked or you will end up with 2 copies
  • Select all or a subset of projects

[edit] Prerequisites

  • TortoiseSVN and a saved PuTTY SSH session
  • TortoiseSVN - network setting - SSH client set as <TortoiseSVN_HOME>\bin\TortoisePlink -l <userName> -pw <password_cleartext>

Explorer right click svn settings menu.JPG

  • Automated SVN or command-line SVN setup
  • You will need to enable some ports or just disable your software firewall.
  • Eclipse 3.2-3.4|1.5 installed with the subclipse plug-in for in-eclipse checkouts
  • Referenced core projects org.eclipse.persistence.core and eclipselink.core.lib checked out into workspace or view
  • Required projects for your specific view org.eclipse.persistence.sdo|moxy|jpa|dbws, eclipselink.sdo|moxy|jpa|dbws.lib and eclipselink.sdo|moxy|jpa|dbws.test checked out into workspace or view
  • If using Ant instead of Eclipse to run - edit build.properties either at this project level or better - globally override the following in your user directory on windows: C:/Documents and Settings/<user-dir>/build.properties
junit.lib=<JUNIT_HOME>/junit.jar 
  • Override any project specific variables in your <user-dir>/build.properties depending on whether you are running inside an eclipse workspace or outside.
  • If the directory variable extensions.depend.dir is not in the standard expected location - 1 level above the trunk at <trunk>/../extension.lib.external then override it in your own build.properties using the following similar line
    • extensions.depend.dir=E:/view_libs/extension.lib.external
  • Add the following javac.debug properties if you are debugging in Eclipse using code built either by Eclipse or Ant.
javac.debug=true
javac.debuglevel=lines,vars,source

[edit] Classpath Variables

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

  • 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)
  • Some JDBC drivers may require the system library path to be set, or dlls to be on the path
  • TOOLS_LIB variable has been mapped to your JDK tools.jar
  • The following jars may be placed into extension.oracle.lib.external
    • AQAPI_LIB variable has been mapped to your aqapi*.jar
    • SPATIAL_LIB variable has been mapped to sdoapi.jar
    • XDB_LIB variable has been mapped to xdb.jar
    • XML_LIB variable has been mapped to xml.jar
    • XMLPARSERV2_LIB variable has been mapped to the oracle specific xmlparserv2.jar

The following classpath variables are required for the example.jpa.common project

  • javax-persistence has been mapped to /jpa/plugins/javax.persistence*.jar (currently _2.0_preview)
  • eclipselink-jar variable has been mapped to eclipselink.jar at the SVN root

The following classpath variable is required for the util.workbench* projects

  • ECLIPSELINK_JAR has been mapped to eclipselink.jar at the SVN root

[edit] Eclipse Preparation

Note: Before testing in Eclipse using the Testing Browser - you will need to a full root build of EclipseLink in 'trunk>ant' so that the test jars eclipse*model.jar get created and placed on the root of jpa/eclipselink.jpa.test. Please refresh your eclipselink.jpa.test project to pick these up before running the Testing Browser eclipse launch target.

[edit] How To