Home » Eclipse Projects » SWTBot » "Hacking" an exported SWT product so it finds SWTBot
|
Re: "Hacking" an exported SWT product so it finds SWTBot [message #642702 is a reply to message #642688] |
Thu, 02 December 2010 12:37 |
Pascal G Messages: 157 Registered: July 2009 |
Senior Member |
|
|
On 10-12-02 06:13 AM, Geoff Bache wrote:
> Hi all,
>
> I'm sitting with an exported product made by a different group and would
> like to try out SWTBot on it as a proof of concept.
>
> Now I realise that the right way to get this to work is to change the
> product file and rebuild it, but I wondered if there was some kind of
> quicker and dirtier way just so I can experiment without needing to
> learn their whole build environment.
>
> I've dumped the SWTBot jar files in the plugins directory of the
> exported product and hoped I could poke in some configuration file
> somewhere there to make it find the application. I tried a few
> plausible-looking ones but no success so far.
>
> Anyone know if there is any way to do this? Where is this "registry" it
> tells me about? (as in Application "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion "
> could not be found in the registry)
>
> Regards,
> Geoff
>
Dumping jars in the plugin directory does not work (or works randomly,
go figure) since Eclipse 3.4. The new way to install plugins is to use
p2 director or the dropin folder for a more temporary solution. Dump
your jar files in the dropin folder and it *should* work. I've had some
cases where it doesn't and the solution was to poke around in the
Eclipse console (launching eclipse in the command-line with the -console
option) and install manually the jars. It's somewhat a trial and error
process, but here's the general idea:
(I'm using Linux, so forgive me if you're a Windows user)
$ ./eclipse -console
.... eclipse logging ...
$>ss
.... listing of eclipse plugins, swtbot's should be missing ...
$> install file:///path/to/eclipse/dropins/swtbot/jar/file.jar
Installed bundle id 222
$> start 222
.... Exception showing it misses some dependency ...
$> install file:///path/to/dependency/plugin/jar/file.jar
.... etc. etc. until you get it to work ...
Notice the file:// thing in the path after "install"? It's the protocol
spec (same as http://) and is needed because the path is actually an
URI. Under Windows, you would probably have something close to:
file://C:/path/to/eclipse (or is it backslash?)
This whole console thingy (and dropins folder) is part of Equinox (OSGi
implementation), so I think it should work with a product too, but I've
never tested it. If I'm not mistaken, all plugin management related
tools (p2 director included) is part of Equinox and is always bundled
with a product, but, once again, I've never tested it.
Hope this helps.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
| |
Re: "Hacking" an exported SWT product so it finds SWTBot [message #642748 is a reply to message #642688] |
Thu, 02 December 2010 14:55 |
|
Hi,
If your product is p2-ready, the right way to achieve installation of SWTBot and your test bundle is to use p2 repositories and install your extensions from them using p2 director from command-line.
See http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/p2_director.html
Le 02/12/2010 12:13, Geoff Bache a écrit :
> Hi all,
>
> I'm sitting with an exported product made by a different group and would
> like to try out SWTBot on it as a proof of concept.
>
> Now I realise that the right way to get this to work is to change the
> product file and rebuild it, but I wondered if there was some kind of
> quicker and dirtier way just so I can experiment without needing to
> learn their whole build environment.
>
> I've dumped the SWTBot jar files in the plugins directory of the
> exported product and hoped I could poke in some configuration file
> somewhere there to make it find the application. I tried a few
> plausible-looking ones but no success so far.
>
> Anyone know if there is any way to do this? Where is this "registry" it
> tells me about? (as in Application "
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion "
> could not be found in the registry)
>
> Regards,
> Geoff
>
--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
|
|
| |
Re: "Hacking" an exported SWT product so it finds SWTBot [message #642787 is a reply to message #642722] |
Thu, 02 December 2010 16:34 |
Pascal G Messages: 157 Registered: July 2009 |
Senior Member |
|
|
On 10-12-02 08:56 AM, Geoff Bache wrote:
> Hi Pascal,
>
> Thanks for your message. I'm using Eclipse 3.5.2 on Linux.
>
> There was no "dropins" directory in the exported product. I created one
> and put the swtbot jars there. No effect at all.
>
> So I tried your console thing and got a certain distance, and set about
> trying to install
> org.eclipse.swtbot.eclipse.junit4.headless_2.0.1.20101106_18
> 31-73ca7af-dev-e35
>
> It complains about various swtbot dependencies, which I installed OK.
> But when several of these are resolved, and I try to start it again, it
> says:
>
> org.osgi.framework.BundleException: The bundle could not be resolved.
> Reason: Missing Constraint: Import-Package: org.eclipse.ui; version="0.0.0"
>
> If I do "ss" I can see amongst other things
> 68 ACTIVE org.eclipse.ui_3.5.2.M20100120-0800
>
> What does it mean that it wants version 0.0.0, and can this really clash
> with 3.5.2?
>
> Regards,
> Geoff
>
If I'm right, the 0.0.0 version is just a magic version that is supposed
to match any version.
As for the eclipse.ui dependency, I have no idea why it isn't working.
I'm also mystified as why the junit4.headless components require
org.eclipse.ui to work... it's supposed to not require the UI after all!
Probably that Mickael's solution (p2) is more appropriate then...
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
| | |
Re: "Hacking" an exported SWT product so it finds SWTBot [message #642912 is a reply to message #642896] |
Fri, 03 December 2010 09:29 |
|
Le 03/12/2010 10:16, Geoff Bache a écrit :
> My only remaining problem is how to install my own jar file there. I'm
> working in Jython and have written a small eclipse application to enable
> this, much along the lines of the headless test runner. Is there an easy
> way to get p2 to install this there also?
Is your jar file an OSGi bundles?
> A further question is whether this approach (using p2 to install SWTBot)
> isn't superior to the one suggested in the FAQ here
>
> http://wiki.eclipse.org/SWTBot/FAQ#Can_I_test_an_exported_ec lipse_product
>
> as it allows more of a separation of concerns, and means you don't have
> to mess with the build to make it work. Perhaps this alternative method
> should at least be described there also.
You're right. I'll update a few things on this page, feel free to update it to add the knowledge you got from your experience.
--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
|
|
| |
Re: "Hacking" an exported SWT product so it finds SWTBot [message #642915 is a reply to message #642912] |
Fri, 03 December 2010 10:31 |
Geoff Bache Messages: 33 Registered: October 2010 |
Member |
|
|
Mickael Istria wrote on Fri, 03 December 2010 04:29 | Le 03/12/2010 10:16,
Is your jar file an OSGi bundles?
|
I believe so. I created it as an Eclipse plugin and it seems to have a bunch of bundle-information in MANIFEST.MF.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Testscript
Bundle-SymbolicName: org.eclipse.swtbot.testscript; singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.swtbot.swt.finder
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.swt.widgets,
org.eclipse.swtbot.eclipse.finder,
org.eclipse.swtbot.swt.finder,
org.eclipse.swtbot.swt.finder.utils,
org.eclipse.ui,
org.eclipse.ui.testing,
org.hamcrest.core
Bundle-ClassPath: .,
src/jython.jar
/Geoff
|
|
| | |
Goto Forum:
Current Time: Sat Apr 27 00:44:58 GMT 2024
Powered by FUDForum. Page generated in 0.03657 seconds
|