Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: aspectj-users digest, Vol 1 #230 - 4 msgs

aspectj-users-request,您好!

  

======= 2003-08-02 您在来信中写道:=======

>Send aspectj-users mailing list submissions to
>	aspectj-users@xxxxxxxxxxx
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://dev.eclipse.org/mailman/listinfo/aspectj-users
>or, via email, send a message with subject or body 'help' to
>	aspectj-users-request@xxxxxxxxxxx
>
>You can reach the person managing the list at
>	aspectj-users-admin@xxxxxxxxxxx
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of aspectj-users digest..."
>
>
>Today's Topics:
>
>   1. RE: Using AspectJ and mock objects--again (SADER, KEITH D (Contractor))
>   2. Poincut questions (SADER, KEITH D (Contractor))
>   3. Re: Poincut questions (Wes Isberg)
>   4. RE: Poincut questions (SADER, KEITH D (Contractor))
>
>--__--__--
>
>Message: 1
>Subject: RE: [aspectj-users] Using AspectJ and mock objects--again
>Date: Fri, 1 Aug 2003 11:12:54 -0500
>From: "SADER, KEITH D (Contractor)" <KEITH.D.SADER@xxxxxxxx>
>To: <aspectj-users@xxxxxxxxxxx>
>Reply-To: aspectj-users@xxxxxxxxxxx
>
>>=20
>> Keith,
>>=20
>> Glad you liked my article. <plug>You should also check out my book:
>> Mastering AspectJ.</plug>
>
>Can't... resist... must.. buy... book...
>:-)
>
>>=20
>> In answer to question 1: I can't tell by inspection what=20
>> might be going
>> wrong. I suggest using either AJDT or AjBrowser to see if=20
>> your pointcuts are
>> accidentally advising anything you don't mean them to. You=20
>> can also print
>> information from thisJoinPoint in your advice to get a better=20
>> idea of where
>> the advice is executing.
>
>Thanks, I'll keep that in mind for my next debugging issue.
>
>>=20
>> In answer to question 2: Method level overrides are verbose=20
>> in AspectJ...
>
>I think I've solved my problem via Virtual Mock Objects.  =
>www.xprogramming.com/xpmag
>It's a really slick solution that will have the least impact on my code =
>for now.
>
>>>=20
>> Hope I've helped,
>> Nick
>
>Lots!  My next project is to try to figure out some sort of =
>transactional aspect
>for our app.
>
>regards,
>Keith Sader.
>
>--__--__--
>
>Message: 2
>Date: Fri, 1 Aug 2003 15:52:03 -0500
>From: "SADER, KEITH D (Contractor)" <KEITH.D.SADER@xxxxxxxx>
>To: <aspectj-users@xxxxxxxxxxx>
>Subject: [aspectj-users] Poincut questions
>Reply-To: aspectj-users@xxxxxxxxxxx
>
>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.
>
>--__--__--
>
>Message: 3
>Date: Fri, 01 Aug 2003 14:51:12 -0700
>From: Wes Isberg <wes@xxxxxxxxxxxxxx>
>To: aspectj-users@xxxxxxxxxxx
>Subject: Re: [aspectj-users] Poincut questions
>Reply-To: aspectj-users@xxxxxxxxxxx
>
>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
>>
>
>
>--__--__--
>
>Message: 4
>Subject: RE: [aspectj-users] Poincut questions
>Date: Fri, 1 Aug 2003 17:23:24 -0500
>From: "SADER, KEITH D (Contractor)" <KEITH.D.SADER@xxxxxxxx>
>To: <aspectj-users@xxxxxxxxxxx>
>Reply-To: aspectj-users@xxxxxxxxxxx
>
>I'm not sure if that's the path to take with virtual mocks.  If I was =
>using an actual Mock I think that's what I'd like to do, but so far, it =
>looks like virtual mocks are more flexible.
>Perhaps I'm not following you?  My ignorance proceeds me :-)
>
>I'm trying to use virtual mocks so that I don't have to declare actual =
>mock objects, or care about returning a specific Mock'd method.  I'd =
>like to 'mock on the fly' as it were everywhere but in test cases that I =
>want to hit the database.
>
>My thinking, at the moment, is that I'd like to advise every =
>ComponentTestCase derived test to use virtual mocks, while having the =
>DatabaseTestCase derived objects ignore the 'virtual mocks'.
>
><mind-control>must buy Nicholas Lisieski's book</mind-control>
>
>thanks,
>Keith Sader.
>
>> -----Original Message-----
>> From: Wes Isberg [mailto:wes@xxxxxxxxxxxxxx]
>> Sent: Friday, August 01, 2003 4:51 PM
>> To: aspectj-users@xxxxxxxxxxx
>> Subject: Re: [aspectj-users] Poincut questions
>>=20
>>=20
>> pointcut dbCalls() : ...;
>>=20
>> /** substitute Mock.fakeCall() for any dbCalls() to any Mock */
>> Object around(Mock mock) : dbCalls()  && target(mock) {
>> return mock.fakeCall();
>> }
>>=20
>> SADER, KEITH D (Contractor) wrote:
>>=20
>> > I'm using the virtual mock objects technique described in=20
>> www.xprogramming.com/xpmag/virtualMockObjects.htm
>> > along with Manual LaFlamme's exellent dbunit framework=20
>> www.dbunit.org.
>> >=20
>> > I'm using the following pointcuts, my intent is to advise=20
>> all of my code with virtual Mocks so that I avoid database=20
>> access, but to 'un-advise' my DatabaseTestCase+ classes so=20
>> that they *do* go out and hit the database.
>> >=20
>> > I can't seem to find the idiom(and maybe I'm using bad=20
>> pointcut idioms) that will allow this.
>> >=20
>> > pointcut allCalls() : execution(* *.*(..)) &&=20
>> !within(ComponentTestCase);
>> >=20
>> > pointcut dbUnitCalls() : execution(*=20
>> org.dbunit.DatabaseTestCase+.*(..));
>> >=20
>> > pointcut dataCalls() : allCalls() && !dbUnitCalls();
>> >=20
>> > Object around(): dataCalls()
>> > {
>> > ...
>> > }
>> >=20
>> > any ideas?
>> >=20
>>=20
>
>
>--__--__--
>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>End of aspectj-users Digest





Back to the top