Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 64   Methods: 5
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MockInterceptor.java - 87.5% 80% 84.6%
coverage coverage
 1    package org.jboss.cache.optimistic;
 2   
 3    import org.jboss.cache.CacheImpl;
 4    import org.jboss.cache.InvocationContext;
 5    import org.jboss.cache.interceptors.Interceptor;
 6    import org.jboss.cache.marshall.MethodCall;
 7   
 8    import java.lang.reflect.Method;
 9    import java.util.ArrayList;
 10    import java.util.List;
 11   
 12    /**
 13    * Handles putXXX() methods: if the given node doesn't exist, it will be created
 14    * (depending on the create_if_not_exists argument)
 15    *
 16    * @author Bela Ban
 17    * @version $Id: CreateIfNotExistsInterceptor.java,v 1.7 2005/01/26 11:45:14
 18    * belaban Exp $
 19    */
 20    public class MockInterceptor extends Interceptor
 21    {
 22   
 23   
 24  76 public void setCache(CacheImpl cache)
 25    {
 26  76 super.setCache(cache);
 27   
 28    }
 29   
 30    private Method called = null;
 31   
 32    private List calledlist = new ArrayList();
 33   
 34  474 public synchronized Object invoke(InvocationContext ctx) throws Throwable
 35    {
 36  474 MethodCall m = ctx.getMethodCall();
 37  474 calledlist.add(m.getMethod());
 38  474 called = m.getMethod();
 39   
 40  474 return null;
 41    }
 42   
 43   
 44    /**
 45    * @return Returns the called.
 46    */
 47  98 public Method getCalled()
 48    {
 49  98 return called;
 50    }
 51   
 52  35 public List getAllCalled()
 53    {
 54  35 return calledlist;
 55    }
 56   
 57    /**
 58    * @param called The called to set.
 59    */
 60  0 public void setCalled(Method called)
 61    {
 62  0 this.called = called;
 63    }
 64    }