forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAVA-11489 Removed a test that was designed to run for 50 seconds to a
new Manual Test class
- Loading branch information
Showing
2 changed files
with
25 additions
and
8 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
25 changes: 25 additions & 0 deletions
25
logging-modules/flogger/src/test/java/com/baeldung/flogger/FloggerManualTest.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,25 @@ | ||
package com.baeldung.flogger; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
import java.util.stream.IntStream; | ||
|
||
import org.junit.Test; | ||
|
||
import com.google.common.flogger.FluentLogger; | ||
|
||
public class FloggerManualTest { | ||
static { | ||
// System.setProperty("flogger.backend_factory", "com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"); | ||
System.setProperty("flogger.backend_factory", | ||
"com.google.common.flogger.backend.slf4j.Slf4jBackendFactory#getInstance"); | ||
} | ||
private static final FluentLogger logger = FluentLogger.forEnclosingClass(); | ||
|
||
@Test | ||
public void givenATimeInterval_shouldLogAfterEveryTimeInterval() { | ||
IntStream.range(0, 1_000_0000).forEach(value -> { | ||
logger.atInfo().atMostEvery(10, TimeUnit.SECONDS).log("This log shows [every 10 seconds] => %d", value); | ||
}); | ||
} | ||
|
||
} |