Clover coverage report - Drools - 2.0-rc2
Coverage timestamp: Wed May 11 2005 07:12:26 BST
file stats: LOC: 123   Methods: 4
NCLOC: 27   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DuplicateRuleNameException.java - 100% 100% 100%
coverage
 1    package org.drools.rule;
 2   
 3    /*
 4    * $Id: DuplicateRuleNameException.java,v 1.5 2004/12/06 01:30:37 dbarnett Exp $
 5    *
 6    * Copyright 2001-2003 (C) The Werken Company. All Rights Reserved.
 7    *
 8    * Redistribution and use of this software and associated documentation
 9    * ("Software"), with or without modification, are permitted provided that the
 10    * following conditions are met:
 11    *
 12    * 1. Redistributions of source code must retain copyright statements and
 13    * notices. Redistributions must also contain a copy of this document.
 14    *
 15    * 2. Redistributions in binary form must reproduce the above copyright notice,
 16    * this list of conditions and the following disclaimer in the documentation
 17    * and/or other materials provided with the distribution.
 18    *
 19    * 3. The name "drools" must not be used to endorse or promote products derived
 20    * from this Software without prior written permission of The Werken Company.
 21    * For written permission, please contact bob@werken.com.
 22    *
 23    * 4. Products derived from this Software may not be called "drools" nor may
 24    * "drools" appear in their names without prior written permission of The Werken
 25    * Company. "drools" is a trademark of The Werken Company.
 26    *
 27    * 5. Due credit should be given to The Werken Company. (http://werken.com/)
 28    *
 29    * THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS ``AS IS''
 30    * AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 31    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 32    * ARE DISCLAIMED. IN NO EVENT SHALL THE WERKEN COMPANY OR ITS CONTRIBUTORS BE
 33    * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 34    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 35    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 36    * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 37    * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 38    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 39    * POSSIBILITY OF SUCH DAMAGE.
 40    *
 41    */
 42   
 43    /**
 44    * Indicates an attempt to add a <code>Rule</code> to a <code>RuleSet</code>
 45    * that already contains a <code>Rule</code> with the same name.
 46    *
 47    * @see Rule
 48    * @see RuleSet
 49    *
 50    * @author <a href="mailto:bob@eng.werken.com">bob mcwhirter </a>
 51    */
 52    public class DuplicateRuleNameException extends RuleConstructionException
 53    {
 54    // ------------------------------------------------------------
 55    // Instance members
 56    // ------------------------------------------------------------
 57   
 58    /** The rule-set. */
 59    private RuleSet ruleSet;
 60   
 61    /** The member rule. */
 62    private Rule originalRule;
 63   
 64    /** The conflicting rule. */
 65    private Rule conflictingRule;
 66   
 67    // ------------------------------------------------------------
 68    // Constructors
 69    // ------------------------------------------------------------
 70   
 71    /**
 72    * Construct.
 73    *
 74    * @param ruleSet
 75    * The <code>RuleSet</code>.
 76    * @param originalRule
 77    * The <code>Rule</code> already in the <code>RuleSet</code>.
 78    * @param conflictingRule
 79    * The new, conflicting <code>Rule</code>.
 80    */
 81  1 public DuplicateRuleNameException(RuleSet ruleSet,
 82    Rule originalRule,
 83    Rule conflictingRule)
 84    {
 85  1 this.ruleSet = ruleSet;
 86  1 this.originalRule = originalRule;
 87  1 this.conflictingRule = conflictingRule;
 88    }
 89   
 90    // ------------------------------------------------------------
 91    // Instance methods
 92    // ------------------------------------------------------------
 93   
 94    /**
 95    * Retrieve the <code>RuleSet</code>.
 96    *
 97    * @return The <code>RuleSet</code>.
 98    */
 99  1 public RuleSet getRuleSet()
 100    {
 101  1 return this.ruleSet;
 102    }
 103   
 104    /**
 105    * Retrieve the original <code>Rule</code> in the <code>RuleSet</code>.
 106    *
 107    * @return The <code>Rule</code>.
 108    */
 109  1 public Rule getOriginalRule()
 110    {
 111  1 return this.originalRule;
 112    }
 113   
 114    /**
 115    * Retrieve the new conflicting <code>Rule</code>.
 116    *
 117    * @return The <code>Rule</code>.
 118    */
 119  1 public Rule getConflictingRule()
 120    {
 121  1 return this.conflictingRule;
 122    }
 123    }