Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 404124 - e4 RCP Accessor does not start in Kepler M6 AUT
Summary: e4 RCP Accessor does not start in Kepler M6 AUT
Status: CLOSED FIXED
Alias: None
Product: Jubula
Classification: Technology
Component: RC (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 blocker with 1 vote (vote)
Target Milestone: Kepler   Edit
Assignee: Project Inbox CLA
QA Contact: Oliver Goetz CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-22 06:25 EDT by Raimar Bühmann CLA
Modified: 2013-05-17 13:06 EDT (History)
4 users (show)

See Also:


Attachments
E4 Jar Patches for Jubula RCP Aut (4.12 KB, application/octet-stream)
2013-04-09 14:26 EDT, Jon Boley CLA
no flags Details
2nd Patch file (4.89 KB, patch)
2013-04-09 14:27 EDT, Jon Boley CLA
no flags Details | Diff
Source bundles for the previously attached jar files (5.76 KB, application/x-zip-compressed)
2013-04-09 17:38 EDT, Jon Boley CLA
no flags Details
Script to create an updated rcp-support zip file (1.52 KB, application/octet-stream)
2013-05-17 13:04 EDT, Brian Watt CLA
no flags Details
The updated rcp-support zip file containing Job Boley's two updated jar files (2.62 MB, application/zip)
2013-05-17 13:05 EDT, Brian Watt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raimar Bühmann CLA 2013-03-22 06:25:14 EDT
A Kepler M6 AUT containing the RCP accessor throws the following exception:

Unable to create class 'org.eclipse.jubula.rc.rcp.e4.swt.starter.SwtProcessor':
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: org/eclipse/e4/ui/model/application/ui/MUIElement
Caused by: java.lang.NoClassDefFoundError: org/eclipse/e4/ui/model/application/ui/MUIElement
	at org.eclipse.jubula.rc.rcp.e4.swt.starter.SwtProcessor.<init>(SwtProcessor.java:27)

This is caused by a change in the internal API from Juno to Kepler. We are using this internal API (org.eclipse.e4.ui.model.application.ui) for component naming in e4 (E4SwtComponentNamer).
Comment 1 Jon Boley CLA 2013-04-09 14:26:23 EDT
Created attachment 229526 [details]
E4 Jar Patches for Jubula RCP Aut

Attempt to use a fragment patch had issues with DI using the old code, so I did a complete rewrite of these two plugins (very easy) and replaced them in their respective bundle locations.
Comment 2 Jon Boley CLA 2013-04-09 14:27:19 EDT
Created attachment 229527 [details]
2nd Patch file

Swt implementation component of the patch
Comment 3 Jon Boley CLA 2013-04-09 14:32:06 EDT
Notes on my attachments:  These are simple builds using the export feature from Eclipse so they are not complete rebuilds of the code from Jubula.  Initial attempt to use Fragments to fix the issue was foiled by a Dependency Injection issue that made it, in my quick scan, unreliable.  In any case, I'm able to find components in my RCP app in 4.3M6.
Comment 4 Jon Boley CLA 2013-04-09 17:38:57 EDT
Created attachment 229542 [details]
Source bundles for the previously attached jar files

The version number on the source bundles differ from the previous bundles because of the time they were generated.

Final note: I exploded the jar into a directory in my AUT's plugin directory, replaced the two jar files in their respective bundle directories, and started the AUT up.
Comment 5 Alexandra Schladebeck CLA 2013-04-10 03:17:14 EDT
Thanks for your work, notes and patches on this Jon. We'll be looking at this in the next few weeks so that it works for Kepler.
Comment 6 Jon Boley CLA 2013-04-10 11:20:06 EDT
You are welcome.  I did not test the code in a 4.2 environment, but I'm pretty sure it would be broken there.  So I would imagine to keep your all-in-one system going there is some heavy-lifting to be done with the build side.  But I really wanted to get my application(s) covered with some good UI and Use testing and I feel Jubula is the way to go.
Comment 7 Achim Loerke CLA 2013-04-15 05:13:04 EDT
@Triaged:+ Raimar is currently looking into the submitted patch.
Comment 8 Raimar Bühmann CLA 2013-04-15 08:44:56 EDT
I have looked into the patch submitted from Jon and saw, that he uses the same internal package in Kepler. This internal package has moved from the bundle org.eclipse.e4.ui.workbench (Juno) to org.eclispe.e4.ui.model.workbench (Kepler). After adding the bundle specific to Kepler as an optional bundle, I was able to  map objects successfully in a Kepler AUT.

http://git.eclipse.org/c/jubula/org.eclipse.jubula.core.git/commit/?id=66d939eefe98a118a3ac8dc27c054bbab5437ff3
Comment 9 Jon Boley CLA 2013-04-16 23:08:17 EDT
I did one other thing:  I removed the test and cast to HandledToolItemImpl as I thought the MToolItem method getElementId() was sufficient.  If it is, I think this should take the naming class outside of the impl scope.
Comment 10 Raimar Bühmann CLA 2013-04-18 04:11:41 EDT
Thanks Jon for your hint in comment 9. I have modified the class E4SwtComponentNamer, so that the internal class HandledToolItemImpl is not used anymore. Instead the toolbar and the toolbar items are detected by using the getWidget() method and comparing with the corresponding SWT types.

Your hint has been integrated in the fix for BUG 405872.
Comment 11 Oliver Goetz CLA 2013-04-24 08:15:29 EDT
The described behavior in the original post does not occur anymore (tested using current GD/JB and Kepler M6 Eclipse Classic/SDK Build id: 20130320-2352 as AUT.
Comment 12 Brian Watt CLA 2013-05-17 13:04:52 EDT
Created attachment 231166 [details]
Script to create an updated rcp-support zip file
Comment 13 Brian Watt CLA 2013-05-17 13:05:59 EDT
Created attachment 231167 [details]
The updated rcp-support zip file containing Job Boley's two updated jar files
Comment 14 Brian Watt CLA 2013-05-17 13:06:31 EDT
A few miscellaneous comments:

1. The 2nd Patch file is actually a jar file, but it is attached as text/plain so when you download it you should do whatever is necessary to name it with a .jar file extension.

2. I am attaching a very simple script named update-rcp-support-zip I used to create an updated rcp-support-201304091027.zip file.

3. I am attaching the updated rcp-support-201304091027.zip file containing Jon Boley's two jar files in their appropriate bundle directories.