Clover coverage report - jMock - 1.0-beta1
Coverage timestamp: Sat Nov 29 2003 19:35:59 GMT
file stats: LOC: 40   Methods: 7
NCLOC: 29   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
InvokableFactory.java - 57.1% 57.1% 57.1%
coverage coverage
 1   
 /* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
 2   
 package org.jmock.dynamic;
 3   
 
 4   
 import org.jmock.InvocationMatcher;
 5   
 import org.jmock.matcher.CallOnceMatcher;
 6   
 import org.jmock.stub.ReturnStub;
 7   
 import org.jmock.stub.ThrowStub;
 8   
 import org.jmock.stub.VoidStub;
 9   
 
 10   
 public class InvokableFactory {
 11   
 
 12  0
     public Invokable createReturnStub(String methodName, InvocationMatcher arguments, Object result) {
 13  0
         return new InvocationMocker(methodName, arguments, new ReturnStub(result));
 14   
     }
 15   
 
 16  12
     public Invokable createReturnExpectation(String methodName, InvocationMatcher arguments, Object result) {
 17  12
         return callOnce(new InvocationMocker(methodName, arguments, new ReturnStub(result)));
 18   
     }
 19   
 
 20  0
     public Invokable createThrowableStub(String methodName, InvocationMatcher arguments, Throwable throwable) {
 21  0
         return new InvocationMocker(methodName, arguments, new ThrowStub(throwable));
 22   
     }
 23   
 
 24  12
     public Invokable createThrowableExpectation(String methodName, InvocationMatcher arguments, Throwable throwable) {
 25  12
         return callOnce(new InvocationMocker(methodName, arguments, new ThrowStub(throwable)));
 26   
     }
 27   
 
 28  0
     public Invokable createVoidStub(String methodName, InvocationMatcher arguments) {
 29  0
         return new InvocationMocker(methodName, arguments, new VoidStub());
 30   
     }
 31   
 
 32  12
     public Invokable createVoidExpectation(String methodName, InvocationMatcher arguments) {
 33  12
         return callOnce(new InvocationMocker(methodName, arguments, new VoidStub()));
 34   
     }
 35   
 
 36  36
     private Invokable callOnce(InvocationMocker mocker) {
 37  36
         return mocker.addMatcher(new CallOnceMatcher());
 38   
     }
 39   
 }
 40