Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW fail hard/fast options (for testing)

Right now perhaps the option you have here is -XmessageHandlerClass
which is supplied the classname of a type implementing IMessageHandler
- so you can then do what you want for any message that comes out.  I
guess you could use the type name of the THROW class if you wish,
likely to be something like "org.aspectj.bridge.IMessageHandler$1" (as
a workaround for it being non 'top-level' at the moment).

I think I raised a bugzilla already for another approach I was
thinking of, where you annotated the advice/pointcut with expectations
(I expect it to match X number of times) and errors will be thrown if
the expectation isn't met.  This is more straightforward with compile
time weaving though as you know when that has finished - it isn't so
obvious in LTW when it has reached the point where the expectation
should have been met. (there may still be more types to be loaded).

cheers,
Andy

On 22 October 2011 20:54, Brett Randall <javabrett@xxxxxxxxx> wrote:
> Hi,
>
> When unit testing aspects and advised test/tested code (as opposed to
> deploy/runtime, where this option wouldn't make sense), it would be
> nice to be able to instruct the weaver to throw some sort of unchecked
> Exception or Error if there are configuration problems with error
> severity or higher.  Does such an option exist - I couldn't see it in
> the LTW weaver options?
>
> This would allow unit tests to fail-fast in the case of a LTW
> configuration error, and could help clarify the cause of the failure.
> Some pre-existing unit tests I'm currently working with picked up some
> weaving issues during development e.g. a typo in a pointcut, and the
> program continues to execute, and to establish the cause of the unit
> test fail you need to read the weaver verbose console messages to find
> the problem, whereas an exception would be clearer.
>
> Has anything like this ever been considered - would it be feasible and
> worthwhile?
>
> Thanks
> Brett
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top