use of org.drools.workbench.models.testscenarios.shared.VerifyScorecardScore in project drools-wb by kiegroup.
the class VerifyScorecardScoreWidgetTest method testShowFailed.
@Test
public void testShowFailed() {
final VerifyScorecardScore verifyScorecardScore = new VerifyScorecardScore();
verifyScorecardScore.setExpected(10.0);
verifyScorecardScore.setResult(20.0);
makeWidget(verifyScorecardScore, true);
verify(view).showFailed("20.0");
verify(view, never()).showPassed();
}
use of org.drools.workbench.models.testscenarios.shared.VerifyScorecardScore in project drools-wb by kiegroup.
the class VerifyScorecardScoreWidgetTest method setValue.
@Test
public void setValue() {
makeWidget(new VerifyScorecardScore(10.0), false);
verify(view).setValue("10.0");
}
use of org.drools.workbench.models.testscenarios.shared.VerifyScorecardScore in project drools-wb by kiegroup.
the class VerifyScorecardScoreWidgetTest method testShowPassed.
@Test
public void testShowPassed() {
final VerifyScorecardScore verifyScorecardScore = new VerifyScorecardScore();
verifyScorecardScore.setExpected(10.0);
verifyScorecardScore.setResult(10.0);
makeWidget(verifyScorecardScore, true);
verify(view, never()).showFailed(anyString());
verify(view).showPassed();
}
use of org.drools.workbench.models.testscenarios.shared.VerifyScorecardScore in project drools-wb by kiegroup.
the class ScenarioHelper method lumpyMap.
/**
* Called lumpy map - as this takes a flat list of fixtures, and groups
* things together. It will return a list - of which each element will
* either be a list - or a map. If its a map - then its a map of FactData to
* the fact type. If its a list, then it will be expectations or
* retractions.
* <p/>
* Man, this will be so much nicer with generics.
* @return List<List<VeryifyRuleFired or VerifyFact or RetractFact> OR
* Map<String, List<FactData>> OR ExecutionTrace>
*/
public List<Fixture> lumpyMap(final List<Fixture> fixtures) {
List<Fixture> output = new ArrayList<Fixture>();
FixturesMap dataInput = new FixturesMap();
CallFixtureMap callOnDataInput = new CallFixtureMap();
FixtureList verifyFact = new FixtureList();
FixtureList verifyRule = new FixtureList();
FixtureList retractFacts = new FixtureList();
for (Fixture fixture : fixtures) {
if (fixture instanceof FactData) {
accumulateDataForFactData(dataInput, (FactData) fixture);
} else if (fixture instanceof CallMethod) {
accumulateCallMethod(callOnDataInput, (CallMethod) fixture);
} else if (fixture instanceof ActivateRuleFlowGroup) {
accumulateDataForActivateRuleFlowGroup(dataInput, fixture);
} else if (fixture instanceof RetractFact) {
retractFacts.add(fixture);
} else if (fixture instanceof VerifyRuleFired) {
verifyRule.add(fixture);
} else if (fixture instanceof VerifyFact) {
verifyFact.add(fixture);
} else if (fixture instanceof VerifyScorecardScore) {
verifyFact.add(fixture);
} else if (fixture instanceof ExecutionTrace) {
gatherFixtures(output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, false);
output.add(fixture);
verifyRule = new FixtureList();
verifyFact = new FixtureList();
retractFacts = new FixtureList();
callOnDataInput = new CallFixtureMap();
dataInput = new FixturesMap();
}
}
gatherFixtures(output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, true);
return output;
}
use of org.drools.workbench.models.testscenarios.shared.VerifyScorecardScore in project drools-wb by kiegroup.
the class VerifyScorecardScoreWidgetTest method setDoNotShowResult.
@Test
public void setDoNotShowResult() {
makeWidget(new VerifyScorecardScore(10.0), false);
verify(view, never()).showFailed(anyString());
verify(view, never()).showPassed();
}
Aggregations