Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-2197 Fix broker tests to work with sybase. Added LoggingRule
- Loading branch information
Showing
5 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
testsuite/integration/src/test/java/org/keycloak/testsuite/rule/LoggingRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.keycloak.testsuite.rule; | ||
|
||
import org.jboss.logging.Logger; | ||
import org.junit.rules.TestRule; | ||
import org.junit.runner.Description; | ||
import org.junit.runners.model.Statement; | ||
|
||
/** | ||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a> | ||
*/ | ||
public class LoggingRule implements TestRule { | ||
|
||
private final Logger log; | ||
|
||
public LoggingRule(Object test) { | ||
log = Logger.getLogger(test.getClass()); | ||
} | ||
|
||
@Override | ||
public Statement apply(final Statement base, final Description description) { | ||
return new Statement() { | ||
|
||
@Override | ||
public void evaluate() throws Throwable { | ||
log.debugf("Before %s", description.getMethodName()); | ||
|
||
try { | ||
base.evaluate(); | ||
} finally { | ||
log.debugf("After %s", description.getMethodName()); | ||
} | ||
|
||
} | ||
|
||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters