Permalink
Browse files

o Rearranged try/catch and renamed a method

  • Loading branch information...
1 parent 06415de commit 12b7012a334509b2ae6eb3662fb243375edc6d7c @krosenvold krosenvold committed Jan 2, 2013
@@ -65,7 +65,6 @@
*/
public class StatelessXmlReporter
{
- private static final String LS = System.getProperty( "line.separator" );
private final File reportsDirectory;
@@ -84,37 +83,32 @@ public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStat
throws ReporterException
{
- FileWriter fw = getFileOutputStream( testSetReportEntry );
-
- org.apache.maven.shared.utils.xml.XMLWriter ppw =
- new org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter( fw );
- ppw.setEncoding( "UTF-8" );
-
- createTestSuiteElement( ppw, testSetReportEntry, testSetStats, reportNameSuffix );
-
- showProperties( ppw );
-
-
- for ( WrappedReportEntry entry : testSetStats.getReportEntries() )
+ FileWriter fw = getFileWriter( testSetReportEntry );
+ try
{
- if ( ReportEntryType.success.equals( entry.getReportEntryType() ) )
- {
- startTestElement( ppw, entry, reportNameSuffix );
- ppw.endElement();
- }
- else
- {
- getTestProblems( ppw, entry, trimStackTrace, reportNameSuffix );
- }
- }
+ org.apache.maven.shared.utils.xml.XMLWriter ppw =
+ new org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter( fw );
+ ppw.setEncoding( "UTF-8" );
- ppw.endElement(); // TestSuite
+ createTestSuiteElement( ppw, testSetReportEntry, testSetStats, reportNameSuffix );
+ showProperties( ppw );
+ for ( WrappedReportEntry entry : testSetStats.getReportEntries() )
+ {
+ if ( ReportEntryType.success.equals( entry.getReportEntryType() ) )
+ {
+ startTestElement( ppw, entry, reportNameSuffix );
+ ppw.endElement();
+ }
+ else
+ {
+ getTestProblems( ppw, entry, trimStackTrace, reportNameSuffix );
+ }
- try
- {
+ }
+ ppw.endElement(); // TestSuite
}
finally
@@ -123,7 +117,7 @@ public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStat
}
}
- private FileWriter getFileOutputStream( WrappedReportEntry testSetReportEntry )
+ private FileWriter getFileWriter( WrappedReportEntry testSetReportEntry )
{
File reportFile = getReportFile( testSetReportEntry, reportsDirectory, reportNameSuffix );
@@ -205,7 +199,8 @@ private static void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry re
}
- private void getTestProblems( XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, String reportNameSuffix )
+ private void getTestProblems( XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace,
+ String reportNameSuffix )
{
startTestElement( ppw, report, reportNameSuffix );

0 comments on commit 12b7012

Please sign in to comment.