Difference between revisions of "Automated PDE JUnit Testing With Eclipse 3.3M5"

From Eclipsepedia

Jump to: navigation, search
m (Automated PDE JUnit Testing After 3.3M4 moved to Automated PDE JUnit Testing With Eclipse 3.3M5)
m (Links)
 
Line 1: Line 1:
 
 
== History ==
 
== History ==
  
Line 82: Line 81:
  
 
* [[FAQ How do I run Eclipse?]] (including starting eclipse with <code>java -cp ... org.eclipse....Main</code>)
 
* [[FAQ How do I run Eclipse?]] (including starting eclipse with <code>java -cp ... org.eclipse....Main</code>)
 +
* [[Starting Eclipse Commandline With Equinox Launcher]] (Ant, Shell, Windows Batch/Cmd)
 
* [http://www.eclipse.org/swt/launcher.html Eclipse Program Launcher] (including commandline flags)
 
* [http://www.eclipse.org/swt/launcher.html Eclipse Program Launcher] (including commandline flags)
 
* [http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Eclipse Runtime Options] (including commandline flags)
 
* [http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Eclipse Runtime Options] (including commandline flags)
 
* [[Equinox Launcher]] (history of changes including related Bugzillas)
 
* [[Equinox Launcher]] (history of changes including related Bugzillas)
 
* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co Eclipse Test Framework]
 
* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co Eclipse Test Framework]
 
  
 
== Bugs ==
 
== Bugs ==

Latest revision as of 20:20, 12 March 2007

Contents

[edit] History

After 3.3M4, Modeling builds no longer ran their JUnit tests, due to changes in the way Eclipse packages its startup jars. The fix is trivial, but requires a change to org.eclipse.test/library.xml in addition to your local releng code.

[echo] Running org.eclipse.someproject.tests.AllTests
[java] Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/launcher/Main
- or -
[echo] Running org.eclipse.emf.test.build.AllSuites
[java] Unable to access jarfile {dd}/2.3.0/N200701240200/testing/N200701240200/testing/target/eclipse/startup.jar

[edit] Migration Guide

  • These changes should apply to anyone using PDE for builds & included JUnit tests.


Filename Explanation Before After
runtests switch from startup.jar to org.eclipse.equinox.launcher_*.jar cp="eclipse/startup.jar" cp=`find eclipse/ -name "org.eclipse.equinox.launcher_*.jar" | sort | head -1`
runtests switch Main classes org.eclipse.core.launcher.Main org.eclipse.equinox.launcher.Main



Filename Explanation Before After
relengbuildgtk.sh don't pass -cp into runtests script to override value set there runtests -os linux -ws gtk -arch x86 -cp eclipse/startup.jar runtests -os linux -ws gtk -arch x86
runtests remove -noupdate flag (not supported anymore) org.eclipse.*.launcher.Main -noupdate org.eclipse.*.launcher.Main


  • These changes apply to you if you use org.eclipse.test (eg., in your map file, or if you run org.eclipse.test/library.xml).


plugin@org.eclipse.test=v20070217,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,


This is fixed by moving up to the latest version (v20070217) of org.eclipse.test/library.xml, per bug 171756.

[edit] Running Tests

To run tests, you'll need something like this:

$JAVA_HOME/bin/java $Xflags -enableassertions -cp $cp \
  org.eclipse.equinox.launcher.Main -ws $ws -os $os -arch $arch \
  -application org.eclipse.ant.core.antRunner -data $workspaceDir \
  -file test.xml $antTestTarget \
  $Dflags -Dws=$ws -Dos=$os -Darch=$arch -D$installmode=true $J2SE15flags \
  $properties -logger org.apache.tools.ant.DefaultLogger

The variables noted in the above example can be seen in detail in the runtests shell script.


[edit] Links

[edit] Bugs