Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 140   Methods: 12
NCLOC: 93   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
EvictionRegionConfig.java 54.5% 71% 91.7% 69.2%
coverage coverage
 1    /*
 2    * JBoss, Home of Professional Open Source.
 3    * Copyright 2006, Red Hat Middleware LLC, and individual contributors
 4    * as indicated by the @author tags. See the copyright.txt file in the
 5    * distribution for a full listing of individual contributors.
 6    *
 7    * This is free software; you can redistribute it and/or modify it
 8    * under the terms of the GNU Lesser General Public License as
 9    * published by the Free Software Foundation; either version 2.1 of
 10    * the License, or (at your option) any later version.
 11    *
 12    * This software is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 15    * Lesser General Public License for more details.
 16    *
 17    * You should have received a copy of the GNU Lesser General Public
 18    * License along with this software; if not, write to the Free
 19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 21    */
 22    package org.jboss.cache.config;
 23   
 24    import org.apache.commons.logging.LogFactory;
 25    import org.jboss.cache.Fqn;
 26   
 27    public class EvictionRegionConfig extends ConfigurationComponent
 28    {
 29    /**
 30    * The serialVersionUID
 31    */
 32    private static final long serialVersionUID = -5482474634995601400L;
 33   
 34    public static final String NAME = "name";
 35    public static final String REGION = "region";
 36    public static final String REGION_POLICY_CLASS = "policyClass";
 37    public static final String EVENT_QUEUE_SIZE = "eventQueueSize";
 38   
 39    private Fqn regionFqn;
 40    @Dynamic
 41    private Integer eventQueueSize;
 42    private EvictionPolicyConfig evictionPolicyConfig;
 43   
 44  4589 public EvictionRegionConfig()
 45    {
 46    }
 47   
 48  1421846 public EvictionPolicyConfig getEvictionPolicyConfig()
 49    {
 50  1421846 return evictionPolicyConfig;
 51    }
 52   
 53  4270 public void setEvictionPolicyConfig(EvictionPolicyConfig config)
 54    {
 55  4270 testImmutability("evictionPolicyConfig");
 56  4270 if (this.evictionPolicyConfig instanceof ConfigurationComponent)
 57    {
 58  12 removeChildConfig((ConfigurationComponent) this.evictionPolicyConfig);
 59    }
 60  4270 if (config instanceof ConfigurationComponent)
 61    {
 62  4202 addChildConfig((ConfigurationComponent) config);
 63    }
 64  4270 if (config != null)
 65  4270 config.validate();
 66   
 67  4270 this.evictionPolicyConfig = config;
 68    }
 69   
 70  1135 public Fqn getRegionFqn()
 71    {
 72  1135 return regionFqn;
 73    }
 74   
 75  3040 public void setRegionFqn(Fqn regionFqn)
 76    {
 77  3040 testImmutability("regionFqn");
 78  3040 this.regionFqn = regionFqn;
 79    }
 80   
 81  8 public String getRegionName()
 82    {
 83  8 return regionFqn == null ? null : regionFqn.toString();
 84    }
 85   
 86  3036 public void setRegionName(String name)
 87    {
 88  3036 setRegionFqn(name == null ? null : Fqn.fromString(name));
 89    }
 90   
 91  5337 public int getEventQueueSize()
 92    {
 93  5337 return eventQueueSize == null ? EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT : eventQueueSize;
 94    }
 95   
 96  3036 public void setEventQueueSize(int queueSize)
 97    {
 98  3036 testImmutability("eventQueueSize");
 99  3036 if (queueSize <= 0)
 100    {
 101  0 LogFactory.getLog(EvictionRegionConfig.class).warn("Ignoring invalid queue capacity " +
 102    queueSize + " -- using " +
 103    EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT);
 104  0 queueSize = EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT;
 105    }
 106  3036 this.eventQueueSize = queueSize;
 107    }
 108   
 109  3031 public void setDefaultEventQueueSize(int queueSize)
 110    {
 111  3031 if (eventQueueSize == null)
 112  0 setEventQueueSize(queueSize);
 113    }
 114   
 115   
 116  0 @Override
 117    public boolean equals(Object obj)
 118    {
 119  0 if (this == obj)
 120  0 return true;
 121   
 122  0 if (obj instanceof EvictionRegionConfig)
 123    {
 124  0 EvictionRegionConfig other = (EvictionRegionConfig) obj;
 125  0 return safeEquals(this.regionFqn, other.regionFqn);
 126    }
 127  0 return false;
 128    }
 129   
 130  3031 @Override
 131    public int hashCode()
 132    {
 133  3031 int result = 17;
 134  3031 result = 31 * result + (regionFqn == null ? 0 : regionFqn.hashCode());
 135   
 136  3031 return result;
 137    }
 138   
 139   
 140    }