All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.greenpepper.extensions.fit.FitRuleForInterpreter Maven / Gradle / Ivy

There is a newer version: 4.2.4
Show newest version
package com.greenpepper.extensions.fit;

import com.greenpepper.Example;
import com.greenpepper.Statistics;
import static com.greenpepper.annotation.Annotations.exception;
import com.greenpepper.interpreter.RuleForInterpreter;
import com.greenpepper.interpreter.column.Column;
import com.greenpepper.interpreter.column.ExpectedColumn;
import com.greenpepper.reflect.Fixture;
import fit.ColumnFixture;

/**
 * 

FitRuleForInterpreter class.

* * @author oaouattara * @version $Id: $Id */ public class FitRuleForInterpreter extends RuleForInterpreter { protected boolean hasExecuted = false; /** *

Constructor for FitRuleForInterpreter.

* * @param fixture a {@link com.greenpepper.reflect.Fixture} object. */ public FitRuleForInterpreter( Fixture fixture ) { super(fixture); } /** {@inheritDoc} */ @Override protected void doCell( Column column, Example cell ) { try { if(column instanceof ExpectedColumn && !hasExecuted) { ((ColumnFixture)fixture.getTarget()).execute(); hasExecuted = true; } Statistics cellStats = column.doCell( cell ); if(!cell.hasSibling()) ((ColumnFixture)fixture.getTarget()).reset(); stats.tally( cellStats ); } catch (Exception e) { cell.annotate( exception( e ) ); stats.exception(); } finally { if(!cell.hasSibling()) hasExecuted = false; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy