Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] JUnit Test and Aspects

Thanks a lot Dean

Alejandro
On Mar 19, 2009, at 2:38 PM, Dean Wampler wrote:

I did this when I wrote Contract4J. The easiest technique to support testing is to write generic aspects with an abstract pointcut. Then create a concrete derived aspect that defines the pointcut to match join points in one or more test classes. Write your tests to confirm that the test classes are advised appropriately. For "production", you would define a different derived aspect (or more than one) with a pointcut that matches the real application join points you care about.

This model of abstract super and concrete derived aspects is generally a good design anyway. The abstract super aspect is reusable.

Hope this helps.

dean

On Mar 19, 2009, at 8:24 AM, Alejandro Garcia wrote:

Hello,

I would like to know if it is possible to run JUnits tests together with aspects. I have an application where I'm applying some aspects.
I want to test the results of applying the aspects to the application. Just simple test  cases.
Where can I find information about it?

In advance I thank you for any help,

Alejandro







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

Dean Wampler, Ph.D.
co-author: "Programming Scala", O'Reilly

dean at objectmentor.com
twitter: @deanwampler, @chicagoscala
See also:
http://www.polyglotprogramming.com  Multi-language and multi-paradigm programming
http://www.aspectprogramming.com    AOP advocacy site
http://aquarium.rubyforge.org       AOP for Ruby
http://www.contract4j.org           Design by Contract for Java5

I want my tombstone to say:
  Unknown Application Error in Dean Wampler.exe.
  Application Terminated.
      [Okay]        [Cancel]






<ATT00001.txt>



Back to the top