Community
Participate
Working Groups
Detected while working on Tycho build, which is more compliant and rigorous with OSGi that the PDE-based build. The org.eclipse.swtbot.swt.finder.test contains some keyboard layouts. The KeyboardLayout class will try to read them using its own classloader, which is not aware of the .test plugin. So, conforming to OSGi, the test fails because it cannot load keyboards. The right way to contribute a keyboard in the OSGi way is to put the keyboard file in a fragment hosted by the bundle containing the KeyboardLayout class.
I'm working on it. You can see progress here: https://github.com/mickaelistria/swtbot/tree/360217
(In reply to comment #1) > I'm working on it. You can see progress here: > https://github.com/mickaelistria/swtbot/tree/360217 It seems to me that org.eclipse.swtbot.swt.finder use the eclipse buddy policy extension, see "Eclipse-BuddyPolicy: registered" in https://github.com/mickaelistria/swtbot/blob/360217/org.eclipse.swtbot.swt.finder/META-INF/MANIFEST.MF. So if you simpy declare "Eclipse-RegisterBuddy:org.eclipse.swtbot.swt.finder" in MANIFEST.MF of the test bundle it should works. See http://cyrillakech.blogspot.com/2007/12/eclipse-buddypolicy-registered-et.html
That's right. However, I don't like a lot buddyPolicies, it is not always easy to understand and the specific use-case of SWTBot keyboard is quite easy to fix with a fragment. I'll go for a fragment solution. Moreover, I just tried this, and it works well. So...
Why do these unit tests need OSGi to run. They are swt based tests, and I'd like to run them using plain JUnit because that's how users of that jar use it for the most part. Can't they run as plain old junit tests as they do right now?
I've been using the Tycho surefire-plugin to test this plugin in a Tycho build, and run the test in an Eclipse. I'll try to have those test running in a simple "surefire-plugin" so that their execution gets independant of OSGi. However, I am not sure how much people use the jar directly...
I succeeded to get test running (except keyboard layout issues on french keyboard) on both maven-surefire (non-OSGi) and (ycho-surefire (OSGi). This is available on my "master" branch with the following commit: https://github.com/mickaelistria/swtbot/commit/e138b644c19a22a52be8e03523121a665ecd04c8 Ketan, do you think we should: * Keep only OSGi tests ? * Keep only non-OSGi tests, and then remove the fragment I created for OSGi ? * Keep both, Run both ? Tests will get twice longer to execute.
Build is working great and the problem was fixed (I don't remember how).