aboutsummaryrefslogtreecommitdiff
path: root/slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java')
-rwxr-xr-xslf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java b/slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java
index 370fc14b..a836f86b 100755
--- a/slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java
+++ b/slf4j-api/src/test/java/org/slf4j/helpers/SubstituteLoggerFactoryTest.java
@@ -24,16 +24,21 @@
*/
package org.slf4j.helpers;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
import org.slf4j.Logger;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
-public class SubstituteLoggerFactoryTest extends TestCase {
- private SubstituteLoggerFactory factory = new SubstituteLoggerFactory();
+public class SubstituteLoggerFactoryTest {
+ private final SubstituteLoggerFactory factory = new SubstituteLoggerFactory();
+ @Test
public void testFactory() {
Logger log = factory.getLogger("foo");
assertNotNull(log);
@@ -42,23 +47,25 @@ public class SubstituteLoggerFactoryTest extends TestCase {
assertTrue("Loggers with same name must be same", log == log2);
}
+ @Test
public void testLoggerNameList() {
factory.getLogger("foo1");
factory.getLogger("foo2");
- Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1", "foo2"));
- Set<String> actualNames = new HashSet<String>(factory.getLoggerNames());
+ Set<String> expectedNames = new HashSet<>(Arrays.asList("foo1", "foo2"));
+ Set<String> actualNames = new HashSet<>(factory.getLoggerNames());
assertEquals(expectedNames, actualNames);
}
+ @Test
public void testLoggers() {
factory.getLogger("foo1");
factory.getLogger("foo2");
- Set<String> expectedNames = new HashSet<String>(Arrays.asList("foo1", "foo2"));
+ Set<String> expectedNames = new HashSet<>(Arrays.asList("foo1", "foo2"));
- Set<String> actualNames = new HashSet<String>();
+ Set<String> actualNames = new HashSet<>();
for (SubstituteLogger slog : factory.getLoggers()) {
actualNames.add(slog.getName());
}