Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add class name to test start/end logging
Browse files Browse the repository at this point in the history
  • Loading branch information
djansen-redhat committed Oct 30, 2014
1 parent 8321161 commit 6fed4b2
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -59,17 +59,24 @@ public class ZanataTestCase {

public DateTime testFunctionStart;

private String getTestDescription() {
return this.getClass().getCanonicalName()
.concat(".")
.concat(testName.getMethodName());
}

@Before
public void testEntry() {
log.info("Starting " + testName.getMethodName());
log.info("Starting ".concat(getTestDescription()));
testFunctionStart = new DateTime();
}

@After
public void testExit() {
Duration duration = new Duration(testFunctionStart, new DateTime());
PeriodFormatter periodFormatter = new PeriodFormatterBuilder()
.appendLiteral("Finished " + testName.getMethodName() + " in " )
.appendLiteral("Finished "
.concat(getTestDescription()).concat(" in " ))
.printZeroAlways()
.appendMinutes()
.appendSuffix(" minutes, ")
Expand Down

0 comments on commit 6fed4b2

Please sign in to comment.