Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Testing plug-in's without using single test-bundles

If you require direct access to internal classes from tests, fragments
are the only way to do this. If all your tests require access to
internal classes, then you will have to have one test fragment per host,
which should also have access to all host's other fragments, iirc.

If you are willing to break OSGi class visibility somewhat, bundles can
export internal packages with eclipse-specific x-internal/x-friends
Export-Package attributes. This will still give you warning/errors
inside IDE, which makes unwanted/unexpected classpath reference obvious
during development, but the packages will be accessible at runtime.

There is also middle-ground approach, where most of the tests can be
kept in single plain test bundle and a small number of test fragments
for tests that require access to internal classes.


On 11/28/2013, 8:19, Paolo Bazzi wrote:
That would correspond to my proposed solution 4, which requires to
create about 70 new fragments and splitting up the >4500 existing unit
Nevertheless, this approach would not work to test a fragment itself,
since a fragment cannot be a fragment of a fragment.


Am 28.11.2013 09:31, schrieb Sievers, Jan:
1) Converting the plain-java test project into a plugin test project

- In order to be able to test classes in internal packages, I have to
export every single package with x-friend:<my.test.plugin> notation and
have to repeat this procedure for each new tested package
Have you tried using test fragments instead?

tycho-user mailing list

tycho-user mailing list

Back to the top