Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 49   Methods: 2
NCLOC: 38   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ORSummaryRule.java 100% 94.4% 50% 92.3%
coverage coverage
 1    package org.jboss.cache.pojo.test.propagation.impl;
 2   
 3    import org.jboss.cache.pojo.test.propagation.Node;
 4    import org.jboss.cache.pojo.test.propagation.StateItem;
 5   
 6    import java.util.List;
 7   
 8    public class ORSummaryRule extends AbstractPropagtionRule
 9    {
 10    private static final String RULE_NAME = "OR-Rule";
 11   
 12  60 public void summaryUpperPropagate(Node node)
 13    {
 14  60 long maxSeverity = 0;
 15   
 16  60 List stateItems = node.getStateItems();
 17  60 int size = stateItems.size();
 18  60 for (int idx = 0; idx < size; idx++)
 19    {
 20  70 StateItem stateItem = (StateItem) stateItems.get(idx);
 21   
 22  70 maxSeverity = updateMaxSeverity(maxSeverity, stateItem);
 23    }
 24   
 25  60 List childNodes = node.getChildren();
 26  60 size = childNodes.size();
 27  60 for (int idx = 0; idx < size; idx++)
 28    {
 29  22 Node child = (Node) childNodes.get(idx);
 30  22 StateItem childSummary = child.getSummaryStateItem();
 31   
 32  22 maxSeverity = updateMaxSeverity(maxSeverity, childSummary);
 33    }
 34   
 35  60 long summaryState = STATE_CLEAR + maxSeverity;
 36  60 StateItem summaryItem = node.getSummaryStateItem();
 37  60 boolean isSummaryChanged = summaryItem.setState(summaryState);
 38   
 39  60 if (StateItem.STATE_CHANGED == isSummaryChanged)
 40    {
 41  20 upperPropagate(node);
 42    }
 43    }
 44   
 45  0 public String toString()
 46    {
 47  0 return RULE_NAME;
 48    }
 49    }