-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #398 from scalecube/bring-back-slf4j
Set back slf4j, + added LoggingExtension
- Loading branch information
Showing
28 changed files
with
406 additions
and
616 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
54 changes: 54 additions & 0 deletions
54
cluster-testlib/src/main/java/io/scalecube/cluster/utils/LoggingExtension.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,54 @@ | ||
package io.scalecube.cluster.utils; | ||
|
||
import java.lang.reflect.Method; | ||
import org.junit.jupiter.api.extension.AfterAllCallback; | ||
import org.junit.jupiter.api.extension.AfterEachCallback; | ||
import org.junit.jupiter.api.extension.BeforeAllCallback; | ||
import org.junit.jupiter.api.extension.BeforeEachCallback; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class LoggingExtension | ||
implements AfterEachCallback, BeforeEachCallback, AfterAllCallback, BeforeAllCallback { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(LoggingExtension.class); | ||
|
||
@Override | ||
public void beforeAll(ExtensionContext context) { | ||
LOGGER.info( | ||
"***** Setup: " + context.getTestClass().map(Class::getSimpleName).orElse("") + " *****"); | ||
} | ||
|
||
@Override | ||
public void afterEach(ExtensionContext context) { | ||
LOGGER.info( | ||
"***** Test finished: " | ||
+ context.getTestClass().map(Class::getSimpleName).orElse("") | ||
+ "." | ||
+ context.getTestMethod().map(Method::getName).orElse("") | ||
+ "." | ||
+ context.getDisplayName() | ||
+ " *****"); | ||
} | ||
|
||
@Override | ||
public void beforeEach(ExtensionContext context) { | ||
LOGGER.info( | ||
"***** Test started: " | ||
+ context.getTestClass().map(Class::getSimpleName).orElse("") | ||
+ "." | ||
+ context.getTestMethod().map(Method::getName).orElse("") | ||
+ "." | ||
+ context.getDisplayName() | ||
+ " *****"); | ||
} | ||
|
||
@Override | ||
public void afterAll(ExtensionContext context) { | ||
LOGGER.info( | ||
"***** TearDown: " | ||
+ context.getTestClass().map(Class::getSimpleName).orElse("") | ||
+ " *****"); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
...er-testlib/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension
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 @@ | ||
io.scalecube.cluster.utils.LoggingExtension |
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 @@ | ||
junit.jupiter.extensions.autodetection.enabled=true |
File renamed without changes.
23 changes: 0 additions & 23 deletions
23
cluster-testlib/src/test/java/io/scalecube/cluster/utils/BaseTest.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.