Skip to content

Commit

Permalink
JAVA-11489 Removed a test that was designed to run for 50 seconds to a
Browse files Browse the repository at this point in the history
new Manual Test class
  • Loading branch information
dkapil committed May 17, 2022
1 parent da48249 commit 65a28f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
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;

Expand All @@ -25,13 +24,6 @@ public void givenAnInterval_shouldLogAfterEveryInterval() {
});
}

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

}

0 comments on commit 65a28f6

Please sign in to comment.