Clover coverage report - Drools - 2.0-rc2
Coverage timestamp: Wed May 11 2005 07:12:26 BST
file stats: LOC: 37   Methods: 1
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
JavaBlockConsequenceFactory.java 100% 85.7% 100% 90%
coverage coverage
 1    package org.drools.semantics.java;
 2   
 3    import org.drools.rule.Rule;
 4    import org.drools.smf.Configuration;
 5    import org.drools.smf.ConsequenceFactory;
 6    import org.drools.smf.FactoryException;
 7    import org.drools.spi.Consequence;
 8    import org.drools.spi.RuleBaseContext;
 9   
 10    public class JavaBlockConsequenceFactory
 11    implements
 12    ConsequenceFactory
 13    {
 14  82 public Consequence newConsequence( Rule rule,
 15    RuleBaseContext context,
 16    Configuration config) throws FactoryException
 17    {
 18  82 try
 19    {
 20  82 Integer id = (Integer) context.get( "java-consequence-id" );
 21  82 if (id == null)
 22    {
 23  65 id = new Integer( 0 );
 24    }
 25  82 context.put("java-consequence-id", new Integer(id.intValue() + 1));
 26   
 27  82 return new JavaBlockConsequence( rule,
 28    id.intValue(),
 29    config.getText( ) );
 30   
 31    }
 32    catch ( Exception e )
 33    {
 34  0 throw new FactoryException( e );
 35    }
 36    }
 37    }