JAVA-11489 Removed a test that was designed to run for 50 seconds to a

new Manual Test class
This commit is contained in:
Dhawal Kapil 2022-05-17 22:04:30 +05:30
parent e1c046fcab
commit 851c7d933e
2 changed files with 25 additions and 8 deletions

View File

@ -5,7 +5,6 @@ import com.google.common.flogger.LoggerConfig;
import com.google.common.flogger.StackSize;
import org.junit.Test;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.stream.IntStream;
@ -25,13 +24,6 @@ public class FloggerIntegrationTest {
});
}
@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);
});
}
@Test
public void givenAnObject_shouldLogTheObject() {
User user = new User();

View File

@ -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);
});
}
}