Skip to content

Commit

Permalink
Switch to JUnit 4 assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed May 20, 2024
1 parent 7b92b6f commit 8c01341
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/
package org.apache.logging.log4j.core.appender.rolling;

import static junit.framework.Assert.fail;
import static org.apache.logging.log4j.core.test.hamcrest.Descriptors.that;
import static org.apache.logging.log4j.core.test.hamcrest.FileMatchers.hasName;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.hasItemInArray;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -100,7 +100,7 @@ public void testAppender() throws Exception {
Thread.yield();
final String name = "RollingFile";
final RollingFileAppender appender = loggerContextRule.getAppender(name);
assertNotNull(appender, name);
assertNotNull(name, appender);
if (appender.getManager().getSemaphore().tryAcquire(5, TimeUnit.SECONDS)) {
// If we are in here, either the rollover is done or has not taken place yet.
validate();
Expand All @@ -114,7 +114,7 @@ private void validate() {
final File[] files = DIR.toFile().listFiles();
Arrays.sort(files);
assertTrue(
hasGzippedFile.matches(files),
() -> "was expecting files with '.gz' suffix, found: " + Arrays.toString(files));
"was expecting files with '.gz' suffix, found: " + Arrays.toString(files),
hasGzippedFile.matches(files));
}
}

0 comments on commit 8c01341

Please sign in to comment.