So guys, here is the deal:Tinybundles is about creating bundles on the fly out of resources that are driven in by inputstreams (so any resource) as well as class resources (those add(Foo.class)). To me, it makes most sense to use it in a context (classloader -wise) where you have most "freedom". Which is in Exam the point where you normally do the configuration. There you can pull in any resource available in the JUnit Runner's / Surefire classpath (pretty much everything). My scenario - when i explain it, usually is that you put a number of classes into the projects src/main/java like so: org/foo/bundle1/Activator org/foo/bundle1/Service org/foo/bundle1/intern/ServiceImpl org/foo/bundle2/Activator org/foo/bundle2/Service ..
Which you can then assemble to bundles (among from other resources) in your config section. Tinybundles primary output (when you call build()) is a (piped) InputStream. In older days, Tinybundles had some converters to File/URL but this has been removed cause it - belongs not into tinybundles core - led to ugly workarounds Thats why Pax Exam now accepts InputStreams directly as provisioning. (since 1.2.0 which is a snaphot as time of this writing, but should be out by next week, once Felix 2.0.1 made it) (see https://scm.ops4j.org/repos/ops4j/projects/pax/exam/pax-exam-it-06/src/test/java/org/examples/twitterclient/TwitterServiceTest.java ) Tinybundles also allows to load an existing bundle and mofify it with tinybundles api. (well, it creates a copy technically). The documentation at http://wiki.ops4j.org/display/PAXSB/Tinybundles will also be corrected once its final (when Exam 1.2 gets out) Additional things: But since we now can easily produce bundles as streams, it would be nice to have some kind of storage so you don't always have to deal with temporary files which is not very expressive. Thats why ops4j-base-store exists ( https://scm.ops4j.org/repos/ops4j/projects/base/ops4j-base-store/) With StoreFactory.defaultStore() you get an instance where you can write and retrieve inputstreams from. Like so: Handle handle = myStore.store( <anyinputstream like tinybundles output>); This handle is a lightweight reference that you can pass around and use to retrieve the stream again: myBundleStream = myStore.load(handle); Simple, but very useful (also used to cache things in Exam for example) Hope this helpes a bit. -> Feel free to suggest things here. Toni On Thu, Oct 8, 2009 at 6:29 PM, Clement Escoffier < [email protected]> wrote: > > On 08.10.2009, at 18:10, Alin Dreghiciu wrote: > > I'm pretty much sure that Toni can bring you up to speed as soon as he gets > online. > > On Thu, Oct 8, 2009 at 6:34 PM, Chris Custine <[email protected]> wrote: > >> Just started looking at TinyBundles and using it within Pax Exam tests. >> This looks like it would be a fantastic solution to preventing test bundle >> proliferation, but I can't seem to get it to work either inside a test *or* >> via configuration options. I see a bunch of the tests in >> https://scm.ops4j.org/repos/ops4j/qa/pax/exam-1.1.0/pax-exam-it-06commented >> out so I suspect there is an issue with the integration. Is >> anyone working on this currently? If not I would be happy to work on >> resolving this if someone could get me up to speed on the current status. >> > > Hi, > > I got the same issue and find a turn around. What I did is quite ugly but > works... > I generate my bundles in the configure method and dump them to file > (asFile()). I create them in a sub-folder of 'target'. > > Then, I get the URLs from my bundles and push them to the system properties > from the nested (created) OSGi framework. The my test method get this > property and is able to install the bundle. > > Regards, > > Clement > > >> Thanks, >> Chris >> -- >> Chris Custine >> FUSESource :: http://fusesource.com >> My Blog :: http://blog.organicelement.com >> Apache ServiceMix :: http://servicemix.apache.org >> Apache Directory Server :: http://directory.apache.org >> >> _______________________________________________ >> general mailing list >> [email protected] >> http://lists.ops4j.org/mailman/listinfo/general >> >> > > > -- > Alin Dreghiciu > Software Developer > My profile: http://www.linkedin.com/in/alindreghiciu > My blog: http://adreghiciu.blogspot.com > http://www.ops4j.org - New Energy for OSS Communities - Open Participation > Software. > http://www.qi4j.org - New Energy for Java - Domain Driven Development. > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general > > > > _______________________________________________ > general mailing list > [email protected] > http://lists.ops4j.org/mailman/listinfo/general > > -- Toni Menzel Independent Software Developer Professional Profile: http://okidokiteam.com [email protected] http://www.ops4j.org - New Energy for OSS Communities - Open Participation Software.
_______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
