Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Poincut questions

pointcut dbCalls() : ...;

/** substitute Mock.fakeCall() for any dbCalls() to any Mock */
Object around(Mock mock) : dbCalls()  && target(mock) {
return mock.fakeCall();
}

SADER, KEITH D (Contractor) wrote:

I'm using the virtual mock objects technique described in www.xprogramming.com/xpmag/virtualMockObjects.htm
along with Manual LaFlamme's exellent dbunit framework www.dbunit.org.

I'm using the following pointcuts, my intent is to advise all of my code with virtual Mocks so that I avoid database access, but to 'un-advise' my DatabaseTestCase+ classes so that they *do* go out and hit the database.

I can't seem to find the idiom(and maybe I'm using bad pointcut idioms) that will allow this.

pointcut allCalls() : execution(* *.*(..)) && !within(ComponentTestCase);

pointcut dbUnitCalls() : execution(* org.dbunit.DatabaseTestCase+.*(..));

pointcut dataCalls() : allCalls() && !dbUnitCalls();

Object around(): dataCalls()
{
...
}

any ideas?

thanks,
---
Keith Sader
Nash Resources Group sub-contracting for Computer Sciences Corporation
IAD:TFAS
Email:keith.d.sader@xxxxxxxx
We've got a blind date with destiny, and it looks like she ordered the lobster.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top