[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Weaving into JUnit Plug-in Test with Equinox Aspects?

Yang,

Are you using a special config.ini file? Or did you just keep the generated one which is selected by default (I think it is the sessings tab of the run config)?

In order to set up Equinox Aspects properly you have start several bundles and - of course - do that in time (weaving has to occour before the test cases are executed). This is easy done with an OSGi Framework run configuration where you have a Budles tab where you can control all that stuff. But in case you are using an Eclipse Application run configuration or a JUnit Plug-in run configuration you have to specify all that in a handmade config.ini file.

Please take a look at the CVS. In the test subdirectory you will find some test projects which make use of such a config.ini.

Regards
Heiko

P.S.: Are some PDE guys listening? Would it be possible to change the Eclipse Application and JUnit Plug-in run configuration dialogs to have a full featured Bundles tab instead of that minimalistic Plug-ins tab?

On 17.12.2008, at 15:57, Meyer, Yang wrote:

Hello,

I have two bundles, "….tracking" and "….tracking.aspects", which are closely modelled after the Equinox Aspects quickstart demo with its two bundles "hello" and "hello.aspects". I defined a class OTTrackingTest in the "tracking" bundle with a method testFoo(), which I explicitly invoke in the bundle's Activator.start(…) method. Everything works fine, and my advice is woven in properly.

Now I want JUnit to run all tests in my OTTrackingTest class. So I made it a subclass of TestCase and created a JUnit Plug-in Test launch configuration for it. To the launch config I added the necessary plug-ins and the VM argument telling Equinox about our weaving hook.

Running it indeed runs the tests and shows the progress/results in the JUnit view -- but no weaving is performed!

I thought this might be because the "org.eclipse.equinox.weaving.aspectj" bundle is started/activated too late, so I tried manually starting it from inside my "tracking" bundle's Activator. But this doesn't work (I guess it's too late for that here?).

Does anybody have an idea what I am doing wrong? Or is there some inherent limitation that makes it impossible to weave aspects into JUnit Plug-in Tests?

I've been trying to sort it out for almost a day now, and it's pretty much driving me nuts :-) I'd be very grateful for any suggestions or pointers!

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