[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Unit testing methods that take JoinPoint as an argument

You should be able to mock the object with JMock, etc. If you only care about a few of the attributes in the JoinPoint, then you might be able to instantiate one and populate those attributes. I don't recall if the constructors are protected, etc.


On May 31, 2007, at 4:19 PM, Jeffrey Sinclair wrote:


What mechanisms do people use to unit test methods that take a JoinPoint as
an argument?

Take a simple method call tracing aspect that delegates the actual writing
of the trace to some writer. The writer might have an API such as:

public void methodEntry(JoinPoint jp);

How do people go about testing such a method?



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

Dean Wampler, Ph.D. dean at objectmentor.com http://www.objectmentor.com http://www.aspectprogramming.com http://www.contract4j.org

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