panel.add( new Image( images.warning() ) );
failures++;
} else {
panel.add( new Image( images.testPassed() ) );
}
panel.add( new SmallLabel( verifyRuleFired.getExplanation() ) );
resultsDetail.add( panel );
total++;
} else if ( fixture instanceof VerifyFact ) {
VerifyFact verifyFact = (VerifyFact) fixture;
for ( Iterator<VerifyField> fieldIterator = verifyFact.getFieldValues().iterator(); fieldIterator.hasNext(); ) {
total++;
VerifyField verifyField = fieldIterator.next();
HorizontalPanel panel = new HorizontalPanel();
if ( !verifyField.getSuccessResult().booleanValue() ) {
panel.add( new Image( images.warning() ) );
failures++;
} else {
panel.add( new Image( images.testPassed() ) );
}
panel.add( new SmallLabel( verifyField.getExplanation() ) );
resultsDetail.add( panel );
}
} else if ( fixture instanceof ExecutionTrace ) {
ExecutionTrace ex = (ExecutionTrace) fixture;
if ( ex.getNumberOfRulesFired() == data.result.getScenario().getMaxRuleFirings() ) {
Window.alert( constants.MaxRuleFiringsReachedWarning(
data.result.getScenario().getMaxRuleFirings() ) );
}
}
}
results.setWidget( 0,
0,
new SmallLabel( constants.Results() ) );
results.getFlexCellFormatter().setHorizontalAlignment( 0,
0,
HasHorizontalAlignment.ALIGN_RIGHT );
if ( failures > 0 ) {
results.setWidget( 0,
1,
new PercentageBar( "#CC0000",
150,
failures,
total ) );
} else {
results.setWidget( 0,
1,
new PercentageBar( "GREEN",
150,
failures,
total ) );
}
results.setWidget( 1,
0,
new SmallLabel( constants.SummaryColon() ) );
results.getFlexCellFormatter().setHorizontalAlignment( 1,
0,
HasHorizontalAlignment.ALIGN_RIGHT );
results.setWidget( 1,
1,
resultsDetail );
results.setWidget( 2,
0,
new SmallLabel( constants.AuditLogColon() ) );
final Button showExp = new Button( constants.ShowEventsButton() );
results.setWidget( 2,
1,
showExp );