Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 85   Methods: 10
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Address.java 50% 92.3% 100% 86.2%
coverage coverage
 1    /*
 2    * JBoss, the OpenSource J2EE webOS
 3    *
 4    * Distributable under LGPL license.
 5    * See terms of license at gnu.org.
 6    */
 7    package org.jboss.cache.pojo.test;
 8   
 9   
 10    /**
 11    * Test class for PojoCache.
 12    *
 13    * @version $Revision: 1.3 $
 14    * <p>Below is the annotation that signifies this class is "prepared" under JBossAop. This is used in
 15    * conjunction with a special jboss-aop.xml (supplied by JBossCache). In addition, this is JDK1.4 style,
 16    * so a annoc Ant build target is needed to pre-compile it.</p>
 17    * <p>To use this approach, just apply this line to your pojo and run annoc (and possibly aopc).</p>
 18    */
 19    // We are using JDK1.5 annotation.
 20    @org.jboss.cache.pojo.annotation.Replicable
 21    public class Address
 22    {
 23    private String street = null;
 24    private String city = null;
 25    private int zip = 0;
 26   
 27  2 public String getStreet()
 28    {
 29  2 return street;
 30    }
 31   
 32  834 public void setStreet(String street)
 33    {
 34  834 this.street = street;
 35    }
 36   
 37  125 public String getCity()
 38    {
 39  125 return city;
 40    }
 41   
 42  954 public void setCity(String city)
 43    {
 44  954 this.city = city;
 45    }
 46   
 47  39 public int getZip()
 48    {
 49  39 return zip;
 50    }
 51   
 52  924 public void setZip(int zip)
 53    {
 54  924 this.zip = zip;
 55    }
 56   
 57  2 public String toString()
 58    {
 59  2 return "street=" + getStreet() + ", city=" + getCity() + ", zip=" + getZip();
 60    }
 61   
 62  60 public int hashCode()
 63    {
 64  60 return 1241 * zip + 37 * (city != null ? city.hashCode() : 0)
 65  60 + 37 * (street != null ? street.hashCode() : 0);
 66    }
 67   
 68  66 private boolean equals(Object o1, Object o2)
 69    {
 70  66 return o1 == o2 || (o1 != null && o1.equals(o2));
 71    }
 72   
 73  33 public boolean equals(Object o)
 74    {
 75  33 if (!(o instanceof Address))
 76  0 return false;
 77   
 78  33 Address addr = (Address)o;
 79  33 return addr.zip == zip && equals(addr.city, city) && equals(addr.street, street);
 80    }
 81   
 82    // public Object writeReplace() {
 83    // return this;
 84    // }
 85    }