private static final Image successIcon = CFUnitView.getIcon( CFUnitView.ICON_LIGHT_GREEN );
private static final Image nwErrorIcon = CFUnitView.getIcon( CFUnitView.ICON_NWERROR );
public Image getImage(Object element) {
if(element instanceof CFUnitTestResult) {
CFUnitTestResult tc = (CFUnitTestResult)element;
switch( tc.getType() ) {
case CFUnitTestResult.ERROR:
return errorIcon;
case CFUnitTestResult.FAILURE:
return failureIcon;
case CFUnitTestResult.NWERROR:
return nwErrorIcon;
case CFUnitTestResult.SUCCESS:
return successIcon;
default:
return blankIcon;
}
}else if(element instanceof CFUnitTestCase) {
CFUnitTestCase tc = (CFUnitTestCase)element;
if( tc.getErrorCount() > 0 ) {
return errorIcon;
} else if( tc.getFailureCount() > 0 ) {
return failureIcon;
} else if( tc.getRunCount() > 0 ) {
return successIcon;
}
}