I've started digging into this feature, and I now have some intermediate
results and suggestions:
1) Equinox handles exploded bundles from the Eclipse workspace via URLs
of the form reference:file:/home/hwellmann/workspace/mybundle/
2) To build the correct bundle classpath, Equinox needs the usual PDE
build.properties file in the bundle root folder.
3) reference: URLs also work for bundle JARs, e.g.
reference:file:/home/hwellmann/targetPlatform/plugins/mybundle.jar. The
difference between a reference: and a file: URL is that reference:
bundles are provisioned in-place, without copying them to the Equinox
install area.
4) Felix also appears to support reference: URLs, at least for regular
bundles, but I haven't tried this.
5) Thus, I think it would be a useful extension for Pax Runner to
support the reference: protocol, not only for my original use case of
provisioning exploded bundles directly from the Eclipse workspace.
6) I locally created a new module pax-url-reference (based on
pax-url-link) to support the reference: protocol.
7) I added the new reference: handler to default.handlers in
runner.properties.
8) I changed the aggregator POMs of Pax Exam 2 and Pax Runner to use my
local SNAPSHOT version of Pax URL.
9) I changed PlatformImpl.downloadBundles() to pass through all bundles
with reference: URLs as local bundles without downloading them.
10) With all these changes, I can now deploy exploded bundles to Equinox
from Pax Exam like this.
@Configuration()
public Option[] config()
{
return options(
url("reference:file:/home/hwellmann/workspace/mybundle"),
junitBundles(),
equinox()
);
}
This is just a first shot, and I would love to hear some opinions if
this approach makes sense at all.
The interesting thing is that I didn't have to touch Pax Exam so far
(except for the POM dependencies).
However, a new option for Pax Exam would better support the typical use
case of deploying multiple bundles from your workspace. I'm thinking of
something like
explodedBundles().root("/home/hwellmann/workspace")
.bundle("mybundle1")
.bundle("mybundle2")
.bundle("mybundle3")
What do you think?
Best regards,
Harald
Am 26.07.2011 23:57, schrieb Toni Menzel:
Its currently not directly supported (if normal "urls" do not work).
What you can try is using the "url()" option and passing a equinox string into
it,
so like you say:
url("bundle:/path/to/workspace/project/bin")
but i'm pretty sure something in Exam will check this and probably not
"understand".
If equinox has this feature, it should be pretty simple to implement as its
just about leaving the url identifier untouched as much as possible and pass it
over to the osgi framework.
I hope to have a look at it and either directly do it or at least give pointers.
What would help definitely is a specific example that is known to work with
equinox.
Thanks for suggesting this one!
Toni
On Jul 26, 2011, at 9:22 PM, Harald Wellmann wrote:
Does Pax Exam support exploded bundles, i.e. unpacked JARs?
Use case: I would like to run Pax Exam tests directly from my Eclipse
workspace, working on workspace bundles/projects.
AFAIK, Equinox supports URLs like bundle:/path/to/workspace/project/bin (I'm
not sure about the exact syntax) for provisioning exploded bundles, so I think
it should be sufficient for Pax Exam and/or Pax Runner to wrap these URLs in
suitable options and forward them to Equinox.
If this is not currently supported, I wouldn't mind trying to implement this
feature, if someone could give me some pointers where to start...
Best regards,
Harald
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general