org.apache.felix.ipojo.junit4osgi.plugin
Class XMLReport

java.lang.Object
  extended by org.apache.felix.ipojo.junit4osgi.plugin.Report
      extended by org.apache.felix.ipojo.junit4osgi.plugin.XMLReport

public class XMLReport
extends Report

This class generates test result as XML files compatible with Surefire.

Author:
Felix Project Team

Field Summary
 
Fields inherited from class org.apache.felix.ipojo.junit4osgi.plugin.Report
m_completedCount, m_endTime, m_errorsCount, m_failuresCount, m_startTime, NL
 
Constructor Summary
XMLReport()
           
 
Method Summary
 void generateReport(junit.framework.Test test, junit.framework.TestResult tr, File reportsDirectory, BundleContext bc, Map configuration)
          Generates the XML reports.
 void testError(junit.framework.Test test, Throwable e, String out, String err, String log)
          A test throws an unexpected errors.
 void testFailed(junit.framework.Test test, Throwable e, String out, String err, String log)
          A test fails.
 void testSucceeded(junit.framework.Test test)
          A test ends successfully.
 
Methods inherited from class org.apache.felix.ipojo.junit4osgi.plugin.Report
elapsedTimeAsString, getErrorSources, getFailureSources, getNumErrors, getNumFailures, getNumTests, getStackTrace, reset, testError, testFailed, testStarting, testSucceeded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReport

public XMLReport()
Method Detail

testSucceeded

public void testSucceeded(junit.framework.Test test)
A test ends successfully.

Parameters:
test - the test executed successfully.

testError

public void testError(junit.framework.Test test,
                      Throwable e,
                      String out,
                      String err,
                      String log)
A test throws an unexpected errors.

Parameters:
test - the test in error
e - the thrown exception
out - the output messages printed during the test execution
err - the error messages printed during the test execution
log - the messages logged during the test execution

testFailed

public void testFailed(junit.framework.Test test,
                       Throwable e,
                       String out,
                       String err,
                       String log)
A test fails.

Parameters:
test - the failing test
e - the thrown failure
out - the output messages printed during the test execution
err - the error messages printed during the test execution
log - the messages logged during the test execution

generateReport

public void generateReport(junit.framework.Test test,
                           junit.framework.TestResult tr,
                           File reportsDirectory,
                           BundleContext bc,
                           Map configuration)
                    throws Exception
Generates the XML reports.

Parameters:
test - the test
tr - the test result
reportsDirectory - the directory in which reports are created.
bc - the bundle context (to get installed bundles)
configuration - the Felix configuration
Throws:
Exception - when the XML report cannot be generated correctly


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.