Without seeing the code it's almost impossible to tell.
Does the class you're trying to mock have final methods? If so, make
them non-final.
--Nat
2009/10/22 Sam <mail@(protected)>:
> Hi,
>
> Given the stack trace below, how can I avoid the call to Arrays.mergeSort()?
> I'm using 'allowing(arrays)' but that doesn't prevent the comparison of segment1
> to segment2 which are my explicit mocks.
>
>
> Many thanks,
> Sam
>
>
junit.framework.AssertionFailedError: unexpected invocation:
> segment1.compareTo(<segment2>)
> expectations:
> allowed, never invoked: arrays.<any method>(<any parameters>); returns a
> default value
> what happened before this: nothing!
> at org.jmock.internal.InvocationDispatcher.
> dispatch(InvocationDispatcher.java:56)
> at org.jmock.Mockery.dispatch(Mockery.java:218)
> at org.jmock.Mockery.access$000(Mockery.java:43)
> at org.jmock.Mockery$MockObject.invoke(Mockery.java:258)
> at org.jmock.internal.InvocationDiverter.
> invoke(InvocationDiverter.java:27)
> at org.jmock.internal.FakeObjectMethods.
> invoke(FakeObjectMethods.java:38)
> at org.jmock.lib.legacy.ClassImposteriser$4.
> invoke(ClassImposteriser.java:137)
> at
> hot.biz.pgood.air.FlightSegmentJdo$$EnhancerByCGLIB$$c65fa396.
> compareTo(<generated>)
> at
java.util.Arrays.mergeSort (
Arrays.java:1156)
> at
java.util.Arrays.sort (
Arrays.java:1080)
> at
java.util.Collections.sort (
Collections.java:117)
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
http://www.natpryce.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email