private double time;
private double failures;
private List<FileMeasure> asFileMeasures() {
List<FileMeasure> measures = new ArrayList<FileMeasure>();
FileMeasure measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_ERRORS ) );
measure.setValue( errors );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_SKIPPED ) );
measure.setValue( skipped );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_FAILURES ) );
measure.setValue( failures );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_TESTS ) );
measure.setValue( tests );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_TIME ) );
measure.setValue( scaleValue( time * 1000, 3 ) );
measures.add( measure );
if ( tests > 0 ) {
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_SUCCESS_PERCENTAGE ) );
measure.setValue( scaleValue( 100d - ( ( errors + failures ) * 100d / tests ) ) );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_ERRORS_PERCENTAGE ) );
measure.setValue( scaleValue( errors * 100d / tests ) );
measures.add( measure );
measure = new FileMeasure();
measure.setFile(file);
measure.setMetric( loadMetric( Metrics.SUREFIRE_FAILURE_PERCENTAGE ) );
measure.setValue( scaleValue( failures * 100d / tests ) );
measures.add( measure );
}
return measures;
}