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

Commit

Permalink
Merge pull request #623 from zanata/add-class-name-test-output
Browse files Browse the repository at this point in the history
Add class name to test start/end logging
  • Loading branch information
djansen-redhat committed Nov 3, 2014
2 parents 8df5ac7 + 6fed4b2 commit 9e7ac9a
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 9e7ac9a

Please sign in to comment.