Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Junit not working with latest headless?!
Junit not working with latest headless?! [message #549067] Fri, 23 July 2010 23:48 Go to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
I have let my buckminster reinstall the buckminster-3.6 headless using automatic install.

Now I'm getting:
Quote:
INFO: junit '-l' 'net.sf.logsaw.tests/junit.launch' '-o' '/D:/hudson/jobs/LogSaw_Build/workspace//buckminster.output/ junit-results.xml'
Required plug-in 'org.junit4' could not be found.


during build.

I have checked the plugin dirs and indeed the old bucky had a org.junit4 bundle while the new one does not.

Maybe some dependency was missed when removing the org.junit4 bundle?
Re: Junit not working with latest headless?! [message #549164 is a reply to message #549067] Sun, 25 July 2010 15:31 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Philipp,

AFAIK, the org.junit4 bundle is just an empty bundle that reexports the
org.junit 4.8.1. Try changing your launch configuration to appoint
org.junit instead and see if that helps.

Regards,
Thomas Hallgren


On 07/24/2010 01:48 AM, Philipp Nanz wrote:
> I have let my buckminster reinstall the buckminster-3.6 headless using
> automatic install.
>
> Now I'm getting:
> Quote:
>> INFO: junit '-l' 'net.sf.logsaw.tests/junit.launch' '-o'
>> '/D:/hudson/jobs/LogSaw_Build/workspace//buckminster.output/
>> junit-results.xml'
>> Required plug-in 'org.junit4' could not be found.
>
> during build.
>
> I have checked the plugin dirs and indeed the old bucky had a org.junit4
> bundle while the new one does not.
>
> Maybe some dependency was missed when removing the org.junit4 bundle?
Re: Junit not working with latest headless?! [message #549181 is a reply to message #549067] Sun, 25 July 2010 22:31 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
Hi Thomas,

as far as I understand my launch config doesn't contain any specific references to the org.junit4 bundle but maybe i am overlooking something Shocked

I have also tried recreating the launch config in 3.6, but that results in the same XML being generated (see below).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<booleanAttribute key="append.args" value="true"/>
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
<booleanAttribute key="askclear" value="false"/>
<booleanAttribute key="automaticAdd" value="true"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/net.sf.logsaw.tests"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=net.sf.logsaw.tests"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="net.sf.logsaw.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useProduct" value="false"/>
</launchConfiguration>
Re: Junit not working with latest headless?! [message #549182 is a reply to message #549067] Sun, 25 July 2010 22:34 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
Assuming that the org.eclipse.buckminster.junit plugin is the main entry point for the Junit command, I've digged into its MANIFEST.MF

Taken from org.eclipse.buckminster.junit_1.0.0.r11240.jar
Require-Bundle: org.eclipse.buckminster.cmdline;bundle-version="1.0.35
 0",org.eclipse.buckminster.core;bundle-version="1.1.350",org.eclipse.
 buckminster.runtime;bundle-version="1.1.0",org.eclipse.jdt.junit.core
 ;bundle-version="3.6.0",org.eclipse.debug.core;bundle-version="3.5.0"
 ,org.eclipse.core.runtime;bundle-version="3.5.0"



I find that require bundle stuff rather fishy, seems to be a mixture of 3.5 and 3.6 which could explain the dangling org.junit4 dependency.
Re: Junit not working with latest headless?! [message #549222 is a reply to message #549182] Mon, 26 July 2010 07:38 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Philipp,

I run junit tests successfully with the current buckminster headless so I know for sure there isn't any bundle missing
in order to do that. Do you use a fresh install or do you have some older bundles lingering?

The versions in the junit bundle indicates the minimum version that this bundle can use in order to run. The versions
that are then used are the ones listed in the o.e.buckminster.core.headless feature. There should be no dangling
reference in any of the Buckminster bundles or features.

- thomas

On 07/26/2010 12:34 AM, Philipp Nanz wrote:
> Assuming that the org.eclipse.buckminster.junit plugin is the main entry
> point for the Junit command, I've digged into its MANIFEST.MF
>
> Taken from org.eclipse.buckminster.junit_1.0.0.r11240.jar
>
> Require-Bundle: org.eclipse.buckminster.cmdline;bundle-version="1.0.35
> 0",org.eclipse.buckminster.core;bundle-version="1.1.350",org.eclipse.
> buckminster.runtime;bundle-version="1.1.0",org.eclipse.jdt.junit.core
> ;bundle-version="3.6.0",org.eclipse.debug.core;bundle-version= "3.5.0"
> ,org.eclipse.core.runtime;bundle-version="3.5.0"
>
>
>
> I find that require bundle stuff rather fishy, seems to be a mixture of
> 3.5 and 3.6 which could explain the dangling org.junit4 dependency.
>
Re: Junit not working with latest headless?! [message #549272 is a reply to message #549067] Mon, 26 July 2010 10:58 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
Hi Thomas,

it's a fresh install made by the hudson plugin -- to be sure I even did another fresh install manually, which gives the same results.
I also deleted the hudson workspace completely so caching should be not the issue here.

I'm puzzled... Is there some way to get more info from the exception (i.e. which bundle caused it)?

[Updated on: Mon, 26 July 2010 10:58]

Report message to a moderator

Re: Junit not working with latest headless?! [message #549408 is a reply to message #549164] Mon, 26 July 2010 15:11 Go to previous messageGo to next message
Achim Demelt is currently offline Achim DemeltFriend
Messages: 160
Registered: July 2009
Senior Member
Philipp,

Do you have an explicit target platform? And does that TP include the
org.junit4 bundle? If not, please try adding that to your TP.

Thomas,

It seems the PDE JUnit launcher explicitly tries to add the org.junit4
bundle to the Equinox runtime when running JUnit4 tests. If your original
bundles are coded against org.junit [4.x, 5), and your TP thus does not
contain org.junit4, the build will fail. We may want to add that bundle to
our feature again.


Cheers,
Achim

Thomas Hallgren wrote:

> Hi Philipp,
>
> AFAIK, the org.junit4 bundle is just an empty bundle that reexports the
> org.junit 4.8.1. Try changing your launch configuration to appoint
> org.junit instead and see if that helps.
>
> Regards,
> Thomas Hallgren
>
>
> On 07/24/2010 01:48 AM, Philipp Nanz wrote:
>> I have let my buckminster reinstall the buckminster-3.6 headless using
>> automatic install.
>>
>> Now I'm getting:
>> Quote:
>>> INFO: junit '-l' 'net.sf.logsaw.tests/junit.launch' '-o'
>>> '/D:/hudson/jobs/LogSaw_Build/workspace//buckminster.output/
>>> junit-results.xml'
>>> Required plug-in 'org.junit4' could not be found.
>>
>> during build.
>>
>> I have checked the plugin dirs and indeed the old bucky had a org.junit4
>> bundle while the new one does not.
>>
>> Maybe some dependency was missed when removing the org.junit4 bundle?
Re: Junit not working with latest headless?! [message #549442 is a reply to message #549408] Mon, 26 July 2010 15:47 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
On 07/26/2010 05:11 PM, Achim Demelt wrote:
> Thomas,
>
> It seems the PDE JUnit launcher explicitly tries to add the org.junit4
> bundle to the Equinox runtime when running JUnit4 tests. If your original
> bundles are coded against org.junit [4.x, 5), and your TP thus does not
> contain org.junit4, the build will fail. We may want to add that bundle to
> our feature again.
>
Ouch! That sounds like it deserves a bugzilla. The org.junit4 doesn't contain anything but a reexport so any reference
to it is probably an oversight from the PDE team. And after all, there's no declared dependency left so adding it
"behind the scenes" sounds kind of dirty. Do you have a pointer to that code (or perhaps you'd like to enter the bugzilla)?

In any case, I'll add the org.junit4 bundle back in.

- thomas
Re: Junit not working with latest headless?! [message #549459 is a reply to message #549067] Mon, 26 July 2010 17:01 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
Ah, it begins to make sense now Smile

@Achim: Yes, a target platform exists that is being generated by materializing various features. It's a bit messy to change that, so I would like to avoid that unless you would really like me to test that for some reason.

So I will just wait for the bucky that contains org.junit4 again and/or for the PDE fix

Btw: The culprit seems to be org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate

line 431 contains a reference to org.junit4

	private String[] getRequiredPlugins(ILaunchConfiguration configuration) {
		// if we are using JUnit4, we need to include the junit4 specific bundles
		ITestKind testKind = JUnitLaunchConfigurationConstants.getTestRunnerKind(configuration);
		if (TestKindRegistry.JUNIT4_TEST_KIND_ID.equals(testKind.getId()))
			return new String[] {"org.junit", "org.eclipse.jdt.junit.runtime", "org.eclipse.pde.junit.runtime", "org.junit4", "org.eclipse.jdt.junit4.runtime"}; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
		return new String[] {"org.junit", "org.eclipse.jdt.junit.runtime", "org.eclipse.pde.junit.runtime"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
	}

Note: Thats taken from org.eclipse.pde.launching_3.6.0.v20100601 (Helios final Eclipse IDE distro)

[Updated on: Mon, 26 July 2010 17:04]

Report message to a moderator

Re: Junit not working with latest headless?! [message #549465 is a reply to message #549067] Mon, 26 July 2010 17:29 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
Just checkout with a new Bucky, now I'm getting the same error with

org.eclipse.jdt.junit4.runtime

Thomas, seems you need to add that one too :-/
Re: Junit not working with latest headless?! [message #549501 is a reply to message #549465] Mon, 26 July 2010 21:33 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Sorry, don't understand how I could miss that one. It's back in now.

- thomas

On 07/26/2010 07:29 PM, Philipp Nanz wrote:
> Just checkout with a new Bucky, now I'm getting the same error with
>
> org.eclipse.jdt.junit4.runtime
>
> Thomas, seems you need to add that one too :-/
Re: Junit not working with latest headless?! [message #549543 is a reply to message #549067] Tue, 27 July 2010 07:07 Go to previous message
Philipp Nanz is currently offline Philipp NanzFriend
Messages: 46
Registered: February 2010
Member
I have filed a bug with the PDE team: https://bugs.eclipse.org/bugs/show_bug.cgi?id=320981
Previous Topic:How to deal properly with referenced plugins/features
Next Topic:Exporting Binary Plugins with site.p2
Goto Forum:
  


Current Time: Thu Mar 28 23:48:38 GMT 2024

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

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

Back to the top