Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Running JUnit Plug-in Test Issue
Running JUnit Plug-in Test Issue [message #263589] Fri, 23 July 2004 20:37 Go to next message
Eclipse UserFriend
Originally posted by: rgould.refractions.net

running into dificulties understand the plug-in dependency isses
involved in getting junit test for plug-in development to work.

We have two plug-ins:
net.refractions.udig.registry
net.refractions.udig.registry.test

Where net.refractions.udig.registry.test depends on:
- net.refractions.udig.registry
- net.refractions.udig.libs (this depends on org.junit)
- org.eclipse.core.resources
- org.eclipse.pde.junit.runtime
- org.eclipse.ui

We constructed this list based on
http://today.java.net/today/2004/02/02/ch12Eclipse.pdf in particular:

Run a test from this plugin using "Run" / "JUnit Plug-in Test" results in:

Launch Error: Could not launch the configuration. Details are in the
log. Would you like to open it?

And then the actual log:

> !SESSION Jul 23, 2004 17:28:45.187
---------------------------------------------
> eclipse.buildId=unknown
> java.version=1.4.2_05
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Command-line arguments: -version 3 -application
org.eclipse.pde.junit.runtime.uitestapplication -port 2799
-testpluginname net.refractions.udig.registry.test -classnames
net.refractions.udig.internal.registry.LocalRegistryTest
>
> !ENTRY org.eclipse.osgi Jul 23, 2004 17:28:45.187
> !MESSAGE Application error
> !STACK 1
> junit.framework.AssertionFailedError
> at junit.framework.Assert.fail(Assert.java:47)
> at junit.framework.Assert.assertTrue(Assert.java:20)
> at junit.framework.Assert.assertNotNull(Assert.java:220)
> at junit.framework.Assert.assertNotNull(Assert.java:213)
> at
org.eclipse.pde.internal.junit.runtime.UITestApplication.get Application(UITestApplication.java:52)
> at
org.eclipse.pde.internal.junit.runtime.UITestApplication.run (UITestApplication.java:27)
> at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
> at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
> at org.eclipse.core.launcher.Main.run(Main.java:644)
> at org.eclipse.core.launcher.Main.main(Main.java:628)
Re: Running JUnit Plug-in Test Issue [message #263635 is a reply to message #263589] Sat, 24 July 2004 01:41 Go to previous message
Eclipse UserFriend
Originally posted by: wassimm.ibm.canada

It looks like the application that you specified in the launch
configuration as the application to test was not found when you ran the
tests. I'll tell you why.

On the arguments tab of the launch configuration, you must have left the
name of the application to run as the default (i.e.
org.eclipse.ui.ide.workbench - the application that brings up the
workbench).
But when you hand-picked the plug-ins to run, org.eclipse.ui.ide (i.e. the
plug-in that contributes said application) was not one of the plug-ins
that you selected because your plug-in does not require it.
So now you run the tests and PDE complains that it can't find the
application because org.eclipse.ui.ide was not in the list of plug-ins.

When you run tests for a UI plug-in and you are not testing an RCP
application, then I recommend you use the first option on the 'Plugins'
tab of the launch configuration (i.e. the 'launch will all workspace and
enabled external plug-ins' option).
Alternatively, if you want to cherry-pick the plug-ins to run, always make
sure that org.eclipse.ui.ide (and its pre-reqs) are among the ones picked.


Wassim.


Richard Gould wrote:

> running into dificulties understand the plug-in dependency isses
> involved in getting junit test for plug-in development to work.

> We have two plug-ins:
> net.refractions.udig.registry
> net.refractions.udig.registry.test

> Where net.refractions.udig.registry.test depends on:
> - net.refractions.udig.registry
> - net.refractions.udig.libs (this depends on org.junit)
> - org.eclipse.core.resources
> - org.eclipse.pde.junit.runtime
> - org.eclipse.ui

> We constructed this list based on
> http://today.java.net/today/2004/02/02/ch12Eclipse.pdf in particular:

> Run a test from this plugin using "Run" / "JUnit Plug-in Test" results in:

> Launch Error: Could not launch the configuration. Details are in the
> log. Would you like to open it?

> And then the actual log:

> > !SESSION Jul 23, 2004 17:28:45.187
> ---------------------------------------------
> > eclipse.buildId=unknown
> > java.version=1.4.2_05
> > java.vendor=Sun Microsystems Inc.
> > BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> > Command-line arguments: -version 3 -application
> org.eclipse.pde.junit.runtime.uitestapplication -port 2799
> -testpluginname net.refractions.udig.registry.test -classnames
> net.refractions.udig.internal.registry.LocalRegistryTest
> >
> > !ENTRY org.eclipse.osgi Jul 23, 2004 17:28:45.187
> > !MESSAGE Application error
> > !STACK 1
> > junit.framework.AssertionFailedError
> > at junit.framework.Assert.fail(Assert.java:47)
> > at junit.framework.Assert.assertTrue(Assert.java:20)
> > at junit.framework.Assert.assertNotNull(Assert.java:220)
> > at junit.framework.Assert.assertNotNull(Assert.java:213)
> > at
>
org.eclipse.pde.internal.junit.runtime.UITestApplication.get Application(UITestApplication.java:52)
> > at
>
org.eclipse.pde.internal.junit.runtime.UITestApplication.run (UITestApplication.java:27)
> > at
>
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
> > at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
> > at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> > at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:324)
> > at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
> > at org.eclipse.core.launcher.Main.run(Main.java:644)
> > at org.eclipse.core.launcher.Main.main(Main.java:628)
Previous Topic:DLL file placement
Next Topic:Eclipse 3.0 & Suse Linux 9
Goto Forum:
  


Current Time: Thu May 08 09:35:44 EDT 2025

Powered by FUDForum. Page generated in 0.06800 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top