Clover coverage report - jMock - 1.0-beta1
Coverage timestamp: Sat Nov 29 2003 19:35:59 GMT
file stats: LOC: 41   Methods: 4
NCLOC: 30   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
LIFOInvocationDispatcher.java 100% 100% 100% 100%
coverage
 1   
 /* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
 2   
 package org.jmock.dynamic;
 3   
 
 4   
 import org.jmock.expectation.Verifiable;
 5   
 
 6   
 import java.util.ArrayList;
 7   
 import java.util.Iterator;
 8   
 import java.util.ListIterator;
 9   
 
 10   
 public class LIFOInvocationDispatcher implements InvocationDispatcher {
 11   
 
 12   
     private ArrayList invokables = new ArrayList();
 13   
 
 14  52
     public Object dispatch(Invocation invocation) throws Throwable {
 15  52
         ListIterator i = invokables.listIterator(invokables.size());
 16  52
         while (i.hasPrevious()) {
 17  52
             Invokable invokable = (Invokable) i.previous();
 18  52
             if (invokable.matches(invocation)) {
 19  28
                 return invokable.invoke(invocation);
 20   
             }
 21   
         }
 22  24
         throw new DynamicMockError(invocation, "No match found");
 23   
     }
 24   
 
 25  60
     public void add(Invokable invokable) {
 26  60
         invokables.add(invokable);
 27   
     }
 28   
 
 29  20
     public void verify() {
 30  20
         Iterator i = invokables.iterator();
 31  20
         while (i.hasNext()) {
 32  22
             ((Verifiable) i.next()).verify();
 33   
         }
 34   
     }
 35   
 
 36  2
     public void clear() {
 37  2
         invokables.clear();
 38   
     }
 39   
 
 40   
 }
 41