Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv19428/src/core/test/mockobjects/dynamic Modified Files: Tag: Nat_reworks_dynamics_from_0_09 NameMatcherTest.java CallDecoratorTest.java MockCallFactory.java Added Files: Tag: Nat_reworks_dynamics_from_0_09 DefaultReturnStubTest.java Log Message: Further changes from Nat --- NEW FILE: DefaultReturnStubTest.java --- /** Created on Jun 22, 2003 by npryce */ package test.mockobjects.dynamic; import com.mockobjects.dynamic.ActiveCall; import com.mockobjects.dynamic.DefaultReturnStub; import com.mockobjects.util.AssertMo; import junit.framework.AssertionFailedError; import junit.framework.TestCase; public class DefaultReturnStubTest extends TestCase { static final Object[] NO_ARG_VALUES = new Object[0]; static final Class[] NO_ARG_TYPES = new Class[0]; private DefaultReturnStub stub; public DefaultReturnStubTest(String name) { super(name); } public void setUp() { stub = new DefaultReturnStub(); } public void testDescription() { AssertMo.assertIncludes( "contains expected description", "guessed result", stub.getDescription() ); } public void testIsConstructedEmpty() { assertFalse( "should not match string result type", stub.matches( resultCall(String.class) ) ); assertFalse( "should not match int result type", stub.matches( resultCall(int.class) ) ); assertFalse( "should not match Integer result type", stub.matches( resultCall(Integer.class) ) ); } public void testMatchesCallsThatHaveARegisteredReturnType() { stub.addResult( String.class, "hello" ); stub.addResult( int.class, new Integer(0) ); assertTrue( "should match string result type", stub.matches( resultCall(String.class) ) ); assertTrue( "should match int result type", stub.matches( resultCall(int.class) ) ); assertFalse( "should not match Integer result type", stub.matches( resultCall(Integer.class) ) ); } public void testReturnsRegisteredValuesForAppropriateReturnTypesFromCall() throws Throwable { stub.addResult( String.class, "hello" ); stub.addResult( int.class, new Integer(0) ); assertEquals( "expected registered value for string result type", "hello", stub.call(resultCall(String.class)) ); assertEquals( "expected registered value for int result type", new Integer(0), stub.call(resultCall(int.class)) ); } public void testRegisteredResultOverridePreviousResultsForTheSameType() throws Throwable { stub.addResult( String.class, "result1" ); stub.addResult( String.class, "result2" ); assertEquals( "expected second result", "result2", stub.call(resultCall(String.class)) ); } public void testCallWithUnregisteredReturnTypeThrowsAssertionFailedError() { try { stub.addResult( String.class, "hello" ); stub.addResult( int.class, new Integer(0) ); stub.addResult( Double.class, new Double(0.0) ); } catch( AssertionFailedError ex ) { String message = ex.getMessage(); AssertMo.assertIncludes( "message should include expected types", String.class.toString(), message ); AssertMo.assertIncludes( "message should include expected types", int.class.toString(), message ); AssertMo.assertIncludes( "message should include expected types", Double.class.toString(), message ); } } public void testCallWhenNoRegisteredReturnTypeThrowsAssertionFailedError() { try { stub.addResult( String.class, "hello" ); stub.addResult( int.class, new Integer(0) ); stub.addResult( Double.class, new Double(0.0) ); } catch( AssertionFailedError ex ) { String message = ex.getMessage(); AssertMo.assertIncludes( "message should report no registered return types", "no result types are registered", message ); } } public void testFactoryMethodCreatesAStubLoadedWithUsefulResults() throws Throwable { stub = DefaultReturnStub.createStub(); assertHasRegisteredValue( stub, byte.class, new Byte((byte)0) ); assertHasRegisteredValue( stub, short.class, new Short((short)0) ); assertHasRegisteredValue( stub, int.class, new Integer(0) ); assertHasRegisteredValue( stub, long.class, new Long(0L) ); assertHasRegisteredValue( stub, char.class, new Character('\0') ); assertHasRegisteredValue( stub, float.class, new Float(0.0F) ); assertHasRegisteredValue( stub, double.class, new Double(0.0) ); assertHasRegisteredValue( stub, Byte.class, new Byte((byte)0) ); assertHasRegisteredValue( stub, Short.class, new Short((short)0) ); assertHasRegisteredValue( stub, Integer.class, new Integer(0) ); assertHasRegisteredValue( stub, Long.class, new Long(0L) ); assertHasRegisteredValue( stub, Character.class, new Character('\0') ); assertHasRegisteredValue( stub, Float.class, new Float(0.0F) ); assertHasRegisteredValue( stub, Double.class, new Double(0.0) ); assertHasRegisteredValue( stub, String.class, "<default string result>" ); } public void assertHasRegisteredValue( DefaultReturnStub stub, Class resultType, Object resultValue ) throws Throwable { ActiveCall call = resultCall(resultType); assertTrue( "should have result registered for type " + resultType, stub.matches(call) ); assertEquals( "expected "+resultValue+" to be returned", resultValue, stub.call(call) ); } private ActiveCall resultCall( Class resultType ) { return new ActiveCall( "ignoredMethodName", NO_ARG_TYPES, resultType, NO_ARG_VALUES ); } } Index: NameMatcherTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/NameMatcherTest.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- NameMatcherTest.java 21 Jun 2003 14:01:07 -0000 1.1.2.1 +++ NameMatcherTest.java 26 Jun 2003 17:33:12 -0000 1.1.2.2 @@ -43,7 +43,7 @@ delegate.setExpectedMatches( CALL ); delegate.setupMatchesReturn(true); - callName.matches( CALL ); + boolean result = callName.matches( CALL ); delegate.verifyExpectations(); } Index: CallDecoratorTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/CallDecoratorTest.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- CallDecoratorTest.java 21 Jun 2003 14:01:07 -0000 1.1.2.1 +++ CallDecoratorTest.java 26 Jun 2003 17:33:12 -0000 1.1.2.2 @@ -91,7 +91,7 @@ mockCallable.setExpectedMatches(CALL); mockCallable.setupMatchesReturn(true); - callDecorator.matches(CALL); + boolean result = callDecorator.matches(CALL); mockCallable.verifyExpectations(); } Index: MockCallFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/MockCallFactory.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- MockCallFactory.java 21 Jun 2003 14:01:07 -0000 1.4.2.1 +++ MockCallFactory.java 26 Jun 2003 17:33:12 -0000 1.4.2.2 @@ -1,15 +1,12 @@ package test.mockobjects.dynamic; import mockmaker.ReturnValues; - -import com.mockobjects.ExceptionalReturnValue; -import com.mockobjects.ExpectationCounter; -import com.mockobjects.ExpectationList; -import com.mockobjects.constraint.Constraint; -import com.mockobjects.dynamic.CallCollectionBuilder; +import com.mockobjects.*; import com.mockobjects.dynamic.CallFactory; import com.mockobjects.dynamic.Callable; +import com.mockobjects.constraint.Constraint; import com.mockobjects.dynamic.CompositeCallable; +import com.mockobjects.dynamic.CallCollectionBuilder; public class MockCallFactory implements CallFactory{ private ExpectationCounter myCreateReturnStubCalls = new ExpectationCounter("com.mockobjects.dynamic.CallFactory CreateReturnStubCalls"); private ReturnValues myActualCreateReturnStubReturnValues = new ReturnValues(false); @@ -27,6 +24,10 @@ private ExpectationList myCreateArgumentMatcherParameter0Values = new ExpectationList("com.mockobjects.dynamic.CallFactory java.lang.String"); private ExpectationList myCreateArgumentMatcherParameter1Values = new ExpectationList("com.mockobjects.dynamic.CallFactory com.mockobjects.constraint.Constraint"); private ExpectationList myCreateArgumentMatcherParameter2Values = new ExpectationList("com.mockobjects.dynamic.CallFactory com.mockobjects.dynamic.Callable"); + private ExpectationCounter myCreateNameMatcherCalls = new ExpectationCounter("com.mockobjects.dynamic.CallFactory CreateNameMatcherCalls"); + private ReturnValues myActualCreateNameMatcherReturnValues = new ReturnValues(false); + private ExpectationList myCreateNameMatcherParameter0Values = new ExpectationList("com.mockobjects.dynamic.CallFactory java.lang.String"); + private ExpectationList myCreateNameMatcherParameter1Values = new ExpectationList("com.mockobjects.dynamic.CallFactory com.mockobjects.dynamic.Callable"); private ExpectationCounter myCreateCallSequenceCalls = new ExpectationCounter("com.mockobjects.dynamic.CallFactory CreateCallSequenceCalls"); private ReturnValues myActualCreateCallSequenceReturnValues = new ReturnValues(false); private ExpectationCounter myCreateCallSelectionCalls = new ExpectationCounter("com.mockobjects.dynamic.CallFactory CreateCallSelectionCalls"); @@ -34,174 +35,198 @@ private ExpectationCounter myCreateCallCollectionBuilderCalls = new ExpectationCounter("com.mockobjects.dynamic.CallFactory CreateCallCollectionBuilderCalls"); private ReturnValues myActualCreateCallCollectionBuilderReturnValues = new ReturnValues(false); private ExpectationList myCreateCallCollectionBuilderParameter0Values = new ExpectationList("com.mockobjects.dynamic.CallFactory com.mockobjects.dynamic.CompositeCallable"); - public void setExpectedCreateReturnStubCalls(int calls){ - myCreateReturnStubCalls.setExpected(calls); + myCreateReturnStubCalls.setExpected(calls); } public void addExpectedCreateReturnStubValues(Object arg0){ - myCreateReturnStubParameter0Values.addExpected(arg0); + myCreateReturnStubParameter0Values.addExpected(arg0); } public Callable createReturnStub(Object arg0){ - myCreateReturnStubCalls.inc(); - myCreateReturnStubParameter0Values.addActual(arg0); - Object nextReturnValue = myActualCreateReturnStubReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (Callable) nextReturnValue; + myCreateReturnStubCalls.inc(); + myCreateReturnStubParameter0Values.addActual(arg0); + Object nextReturnValue = myActualCreateReturnStubReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; } public void setupExceptionCreateReturnStub(Throwable arg){ - myActualCreateReturnStubReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateReturnStubReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateReturnStub(Callable arg){ - myActualCreateReturnStubReturnValues.add(arg); + myActualCreateReturnStubReturnValues.add(arg); } public void setExpectedCreateThrowStubCalls(int calls){ - myCreateThrowStubCalls.setExpected(calls); + myCreateThrowStubCalls.setExpected(calls); } public void addExpectedCreateThrowStubValues(Throwable arg0){ - myCreateThrowStubParameter0Values.addExpected(arg0); + myCreateThrowStubParameter0Values.addExpected(arg0); } public Callable createThrowStub(Throwable arg0){ - myCreateThrowStubCalls.inc(); - myCreateThrowStubParameter0Values.addActual(arg0); - Object nextReturnValue = myActualCreateThrowStubReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (Callable) nextReturnValue; + myCreateThrowStubCalls.inc(); + myCreateThrowStubParameter0Values.addActual(arg0); + Object nextReturnValue = myActualCreateThrowStubReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; } public void setupExceptionCreateThrowStub(Throwable arg){ - myActualCreateThrowStubReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateThrowStubReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateThrowStub(Callable arg){ - myActualCreateThrowStubReturnValues.add(arg); + myActualCreateThrowStubReturnValues.add(arg); } public void setExpectedCreateVoidStubCalls(int calls){ - myCreateVoidStubCalls.setExpected(calls); + myCreateVoidStubCalls.setExpected(calls); } public Callable createVoidStub(){ - myCreateVoidStubCalls.inc(); - Object nextReturnValue = myActualCreateVoidStubReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (Callable) nextReturnValue; + myCreateVoidStubCalls.inc(); + Object nextReturnValue = myActualCreateVoidStubReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; } public void setupExceptionCreateVoidStub(Throwable arg){ - myActualCreateVoidStubReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateVoidStubReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateVoidStub(Callable arg){ - myActualCreateVoidStubReturnValues.add(arg); + myActualCreateVoidStubReturnValues.add(arg); } public void setExpectedCreateCallOnceExpectationCalls(int calls){ - myCreateCallOnceExpectationCalls.setExpected(calls); + myCreateCallOnceExpectationCalls.setExpected(calls); } public void addExpectedCreateCallOnceExpectationValues(Callable arg0){ - myCreateCallOnceExpectationParameter0Values.addExpected(arg0); + myCreateCallOnceExpectationParameter0Values.addExpected(arg0); } public Callable createCallOnceExpectation(Callable arg0){ - myCreateCallOnceExpectationCalls.inc(); - myCreateCallOnceExpectationParameter0Values.addActual(arg0); - Object nextReturnValue = myActualCreateCallOnceExpectationReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (Callable) nextReturnValue; + myCreateCallOnceExpectationCalls.inc(); + myCreateCallOnceExpectationParameter0Values.addActual(arg0); + Object nextReturnValue = myActualCreateCallOnceExpectationReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; } public void setupExceptionCreateCallOnceExpectation(Throwable arg){ - myActualCreateCallOnceExpectationReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateCallOnceExpectationReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateCallOnceExpectation(Callable arg){ - myActualCreateCallOnceExpectationReturnValues.add(arg); + myActualCreateCallOnceExpectationReturnValues.add(arg); } public void setExpectedCreateArgumentMatcherCalls(int calls){ - myCreateArgumentMatcherCalls.setExpected(calls); + myCreateArgumentMatcherCalls.setExpected(calls); } public void addExpectedCreateArgumentMatcherValues(String arg0, Constraint[] arg1, Callable arg2){ - myCreateArgumentMatcherParameter0Values.addExpected(arg0); - myCreateArgumentMatcherParameter1Values.addExpectedMany(arg1); - myCreateArgumentMatcherParameter2Values.addExpected(arg2); + myCreateArgumentMatcherParameter0Values.addExpected(arg0); + myCreateArgumentMatcherParameter1Values.addExpectedMany(arg1); + myCreateArgumentMatcherParameter2Values.addExpected(arg2); } public Callable createArgumentMatcher(String arg0, Constraint[] arg1, Callable arg2){ - myCreateArgumentMatcherCalls.inc(); - myCreateArgumentMatcherParameter0Values.addActual(arg0); - myCreateArgumentMatcherParameter1Values.addActualMany(arg1); - myCreateArgumentMatcherParameter2Values.addActual(arg2); - Object nextReturnValue = myActualCreateArgumentMatcherReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (Callable) nextReturnValue; + myCreateArgumentMatcherCalls.inc(); + myCreateArgumentMatcherParameter0Values.addActual(arg0); + myCreateArgumentMatcherParameter1Values.addActualMany(arg1); + myCreateArgumentMatcherParameter2Values.addActual(arg2); + Object nextReturnValue = myActualCreateArgumentMatcherReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; } public void setupExceptionCreateArgumentMatcher(Throwable arg){ - myActualCreateArgumentMatcherReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateArgumentMatcherReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateArgumentMatcher(Callable arg){ - myActualCreateArgumentMatcherReturnValues.add(arg); + myActualCreateArgumentMatcherReturnValues.add(arg); + } + public void setExpectedCreateNameMatcherCalls(int calls){ + myCreateNameMatcherCalls.setExpected(calls); + } + public void addExpectedCreateNameMatcherValues(String arg0, Callable arg1){ + myCreateNameMatcherParameter0Values.addExpected(arg0); + myCreateNameMatcherParameter1Values.addExpected(arg1); + } + public Callable createNameMatcher(String arg0, Callable arg1){ + myCreateNameMatcherCalls.inc(); + myCreateNameMatcherParameter0Values.addActual(arg0); + myCreateNameMatcherParameter1Values.addActual(arg1); + Object nextReturnValue = myActualCreateNameMatcherReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (Callable) nextReturnValue; + } + public void setupExceptionCreateNameMatcher(Throwable arg){ + myActualCreateNameMatcherReturnValues.add(new ExceptionalReturnValue(arg)); + } + public void setupCreateNameMatcher(Callable arg){ + myActualCreateNameMatcherReturnValues.add(arg); } public void setExpectedCreateCallSequenceCalls(int calls){ - myCreateCallSequenceCalls.setExpected(calls); + myCreateCallSequenceCalls.setExpected(calls); } public CompositeCallable createCallSequence(){ - myCreateCallSequenceCalls.inc(); - Object nextReturnValue = myActualCreateCallSequenceReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (CompositeCallable) nextReturnValue; + myCreateCallSequenceCalls.inc(); + Object nextReturnValue = myActualCreateCallSequenceReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (CompositeCallable) nextReturnValue; } public void setupExceptionCreateCallSequence(Throwable arg){ - myActualCreateCallSequenceReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateCallSequenceReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateCallSequence(CompositeCallable arg){ - myActualCreateCallSequenceReturnValues.add(arg); + myActualCreateCallSequenceReturnValues.add(arg); } public void setExpectedCreateCallSelectionCalls(int calls){ - myCreateCallSelectionCalls.setExpected(calls); + myCreateCallSelectionCalls.setExpected(calls); } public CompositeCallable createCallSelection(){ - myCreateCallSelectionCalls.inc(); - Object nextReturnValue = myActualCreateCallSelectionReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (CompositeCallable) nextReturnValue; + myCreateCallSelectionCalls.inc(); + Object nextReturnValue = myActualCreateCallSelectionReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (CompositeCallable) nextReturnValue; } public void setupExceptionCreateCallSelection(Throwable arg){ - myActualCreateCallSelectionReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateCallSelectionReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateCallSelection(CompositeCallable arg){ - myActualCreateCallSelectionReturnValues.add(arg); + myActualCreateCallSelectionReturnValues.add(arg); } public void setExpectedCreateCallCollectionBuilderCalls(int calls){ - myCreateCallCollectionBuilderCalls.setExpected(calls); + myCreateCallCollectionBuilderCalls.setExpected(calls); } public void addExpectedCreateCallCollectionBuilderValues(CompositeCallable arg0){ - myCreateCallCollectionBuilderParameter0Values.addExpected(arg0); + myCreateCallCollectionBuilderParameter0Values.addExpected(arg0); } public CallCollectionBuilder createCallCollectionBuilder(CompositeCallable arg0){ - myCreateCallCollectionBuilderCalls.inc(); - myCreateCallCollectionBuilderParameter0Values.addActual(arg0); - Object nextReturnValue = myActualCreateCallCollectionBuilderReturnValues.getNext(); - if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) - throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); - return (CallCollectionBuilder) nextReturnValue; + myCreateCallCollectionBuilderCalls.inc(); + myCreateCallCollectionBuilderParameter0Values.addActual(arg0); + Object nextReturnValue = myActualCreateCallCollectionBuilderReturnValues.getNext(); + if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException) + throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException(); + return (CallCollectionBuilder) nextReturnValue; } public void setupExceptionCreateCallCollectionBuilder(Throwable arg){ - myActualCreateCallCollectionBuilderReturnValues.add(new ExceptionalReturnValue(arg)); + myActualCreateCallCollectionBuilderReturnValues.add(new ExceptionalReturnValue(arg)); } public void setupCreateCallCollectionBuilder(CallCollectionBuilder arg){ - myActualCreateCallCollectionBuilderReturnValues.add(arg); + myActualCreateCallCollectionBuilderReturnValues.add(arg); } public void verify(){ - myCreateReturnStubCalls.verify(); - myCreateReturnStubParameter0Values.verify(); - myCreateThrowStubCalls.verify(); - myCreateThrowStubParameter0Values.verify(); - myCreateVoidStubCalls.verify(); - myCreateCallOnceExpectationCalls.verify(); - myCreateCallOnceExpectationParameter0Values.verify(); - myCreateArgumentMatcherCalls.verify(); - myCreateArgumentMatcherParameter0Values.verify(); - myCreateArgumentMatcherParameter1Values.verify(); - myCreateArgumentMatcherParameter2Values.verify(); - myCreateCallSequenceCalls.verify(); - myCreateCallSelectionCalls.verify(); - myCreateCallCollectionBuilderCalls.verify(); - myCreateCallCollectionBuilderParameter0Values.verify(); + myCreateReturnStubCalls.verify(); + myCreateReturnStubParameter0Values.verify(); + myCreateThrowStubCalls.verify(); + myCreateThrowStubParameter0Values.verify(); + myCreateVoidStubCalls.verify(); + myCreateCallOnceExpectationCalls.verify(); + myCreateCallOnceExpectationParameter0Values.verify(); + myCreateArgumentMatcherCalls.verify(); + myCreateArgumentMatcherParameter0Values.verify(); + myCreateArgumentMatcherParameter1Values.verify(); + myCreateArgumentMatcherParameter2Values.verify(); + myCreateNameMatcherCalls.verify(); + myCreateNameMatcherParameter0Values.verify(); + myCreateNameMatcherParameter1Values.verify(); + myCreateCallSequenceCalls.verify(); + myCreateCallSelectionCalls.verify(); + myCreateCallCollectionBuilderCalls.verify(); + myCreateCallCollectionBuilderParameter0Values.verify(); } } |