[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: Re: [equinox-dev] Package access across plug-ins...

Why not have just one test fragment per bundle? After all, if you want
to test internals then a fragment is a good place to do it. Your test
API then only needs to iterate across each of the bundles, invoking
the tests as they go.

The other possibility is to use a single plugin to test swathes of
external functionality, like Eclipse uses to run the jdt-tests etc.

By the way, I don't know if this is helpful:

http://alblue.blogspot.com/2006/03/javaeclipse-running-all-tests-in.html

I put it together to solve having to explicitly manage running all
tests without the need for a hard-coded AllTests class, as well as
having subsets of tests that can only be run inside an OSGi runtime.
As the comment says down at the bottom, it can be improved with the
PackageAdmin service, but I've not revisited the code there yet.

Alex.

On 22/10/06, BJ Hargrave <hargrave@xxxxxxxxxx> wrote:
You can't do it with 2 bundles (plugins). Each bundles uses a distinct
class loader and package privacy does not cross class loader boundaries.
Fragments can access package private members since a fragment is loaded by
its host bundle's class loader.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx

office: +1 407 849 9117
mobile: +1 386 848 3788




"Kirby Bohling" <computerslicer23@xxxxxxxxxxx> Sent by: equinox-dev-bounces@xxxxxxxxxxx 10/21/2006 07:38 PM Please respond to Equinox development mailing list <equinox-dev@xxxxxxxxxxx>


To equinox-dev@xxxxxxxxxxx cc

Subject
[equinox-dev] Package access across plug-ins...






All,

  I'm still working on the Unit testing application described in an e-mail

yesterday.  I am splitting my plug-ins so that test code is not with
application code.

   When I run the tests thru the "Run As -> JUnit Test", it works fine.
When I right click it and do "Run as JUnit Test Plug-in", I get an error
when I attempt to access anything that is "protected" or "package
protected"
scope?  I have several API's that expose calls to be used for testing as
protected or package level scope.

   It appears that Fragments would solve this problem, but I'd like to
have
one test plug-in for a number of plug-ins.  So I don't think I'd have
access
to all of the various tests unless I could have many hosts for the
fragment
(I don't believe that's possible).  I was curious if there is a way to to
give the plug-in org.foo.test access so that it can access org.foo
protected
constructors and package protected scope objects.  When the code is all in
a
single plug-in it appears to work fine.

   If this is an inappropriate list, a pointer to the correct list would
be
useful.

   Thanks,
        Kirby

_________________________________________________________________
All-in-one security and maintenance for your PC.  Get a free 90-day trial!

http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail


_______________________________________________ equinox-dev mailing list equinox-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________ equinox-dev mailing list equinox-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/equinox-dev