Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Commit

Permalink
Use debug log level for debugging messages #42
Browse files Browse the repository at this point in the history
  • Loading branch information
redfish4ktc committed Jul 7, 2014
1 parent 252ed2c commit 89c3e2a
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

// TODO for multi projects, could be nice to prefix testsuite by the name of the project
// could be done in a subclass or with an option (see http://blog.infostretch.com/customizing-soapui-reports)
// TODO modify log level used to debug
// TODO use stringbuilder instead StringBuffer
public class StepInfoJUnitReportCollector extends JUnitSecurityReportCollector {
private static final Logger log = Logger.getLogger(StepInfoJUnitReportCollector.class);
Expand All @@ -51,11 +50,14 @@ public void afterStep(TestCaseRunner testRunner, TestCaseRunContext runContext,
TestStep currentStep = result.getTestStep();
TestCase testCase = currentStep.getTestCase();

log.error("##### testcase: " + testCase.getName());
log.error("##### currentStep: " + currentStep.getName());

if(log.isDebugEnabled()) {
log.debug("Entering afterStep");
log.debug(" testcase: " + testCase.getName());
log.debug(" currentStep: " + currentStep.getName());
}

if (result.getStatus() == TestStepStatus.FAILED) {
log.debug("Test step status is FAILED");
// TODO restore this behaviour
// if (maxErrors > 0) {
// Integer errors = errorCount.get(testCase);
Expand All @@ -78,7 +80,7 @@ public void afterStep(TestCaseRunner testRunner, TestCaseRunContext runContext,
// no previous failure, but success
else if (pendingSuccess.containsKey(testCase)) {
String testCasePendingSuccess = pendingSuccess.get(testCase);
log.error("##### existing pending success, adding: " + testCasePendingSuccess);
log.debug("Existing pending success, adding: " + testCasePendingSuccess);
buf.append(testCasePendingSuccess);
// appendBreakLine(buf);

Expand All @@ -100,7 +102,7 @@ else if (pendingSuccess.containsKey(testCase)) {

// use string value since constant is defined in pro.. duh..
if (testRunner.getTestCase().getSettings().getBoolean("Complete Error Logs")) {
log.error("##### process complete error logs!!!!");
log.debug("Add complete error logs");
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
result.writeTo(writer);
Expand All @@ -109,12 +111,10 @@ else if (pendingSuccess.containsKey(testCase)) {
// TODO break line needed?
}

// buf.append("</pre><hr/>");

getFailures().put(testCase, buf.toString());
}
else {
log.error("##### Success");
log.debug("Test step status is SUCCESS");
StringBuffer buf = new StringBuffer();
if (pendingSuccess.containsKey(testCase)) {
buf.append(pendingSuccess.get(testCase));
Expand Down Expand Up @@ -170,7 +170,7 @@ private static void appendTestStepStatus(StringBuffer buf, TestStep step, TestSt

private static void appendTestAssertionsOfTestStepIfAvailable(StringBuffer buf, TestStep step) {
if (step instanceof Assertable) {
log.error("##### step is assertable");
log.debug("Test step is Assertable");
Assertable requestStep = (Assertable) step;
if (requestStep.getAssertionCount() > 0) {
buf.append("Assertion details:").append(EOL);
Expand Down

0 comments on commit 89c3e2a

Please sign in to comment.