Clover coverage report - Maven Clover report
Coverage timestamp: Sun Mar 18 2007 17:42:32 CET
file stats: LOC: 52   Methods: 5
NCLOC: 34   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ToStringReference.java 87.5% 100% 100% 96%
coverage coverage
 1    package com.agical.rmock.core.match.reference;
 2   
 3    import java.io.IOException;
 4   
 5    import com.agical.rmock.core.describe.ExpressionDescriber;
 6    import com.agical.rmock.core.match.Reference;
 7   
 8    /**
 9    * References objects and describes them with object.toString()
 10    * <br />
 11    * <br />
 12    * <em>(c) 2005 Agical AB</em>
 13    * @author joakim.ohlrogge
 14    */
 15    public class ToStringReference implements Reference {
 16   
 17    private final Object object;
 18   
 19  7257 public ToStringReference(Object object) {
 20  7257 super();
 21  7257 this.object = object;
 22    }
 23   
 24  688 public Object getObject() {
 25  688 return object;
 26    }
 27   
 28  16 public void describeWith(ExpressionDescriber expressionDescriber) throws IOException {
 29  16 if(object != null) {
 30  15 expressionDescriber.describeReference("<"+object.toString()+">");
 31    }
 32    else {
 33  1 expressionDescriber.describeReference("<null>");
 34    }
 35    }
 36   
 37  605 public boolean objectEquals(Object object) {
 38  605 if (this.object == null) {
 39  36 return object == null;
 40    }
 41  569 return this.object.equals(object);
 42    }
 43   
 44  53 public int objectCompareTo(Object object) {
 45  53 if(this.object instanceof Comparable) {
 46  52 return ((Comparable)this.object).compareTo(object);
 47    }
 48  1 return this.object.equals(object) ? 0 : this.object.hashCode() - object.hashCode();
 49    }
 50   
 51   
 52    }