Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

Re: [jmock-user] 1.2.0 no longer can mock non-public interfaces

Nat Pryce

2008-02-23

Replies: Find Java Web Hosting

Author LoginPost Reply
On 22/02/2008, alex-pub.jmock@(protected)
<alex-pub.jmock@(protected):
> I have a test case where I need to mock a class (not under my control) and
> some interfaces (under my control). The interfaces under my control are
> declared package private.
...
> I think that I tracked it to a change in CGLIBCoreMock:
> 1. Why new code is necessary?

It's to allow jMock to mock classes and interfaces that are in signed,
sealed packages.

> 2. Can you append 'org.jmock.codegen' instead of prepending it?

No. The mock versions need to be defined in a different (unsealed) package.

> 3. Is there a workaround for this?

If the interfaces are under your control, why not make them public?

> 4. Does this behavior manifest itself in 2.4.0, as I am planning to switch
> to it eventually?

Not sure. It's not a requirement I recall coming up before. I'll look into it.

--Nat

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.