1 package org.slf4j.impl; 2 3 import org.junit.Test; 4 5 import org.slf4j.ILoggerFactory; 6 import org.slf4j.LoggerFactory; 7 import uk.org.lidalia.slf4jtest.TestLoggerFactory; 8 9 import static org.hamcrest.Matchers.is; 10 import static org.junit.Assert.assertEquals; 11 import static org.junit.Assert.assertSame; 12 import static org.junit.Assert.assertThat; 13 14 public class StaticLoggerBinderTests { 15 16 @Test 17 public void getLoggerFactory() throws Exception { 18 assertSame(TestLoggerFactory.getInstance(), StaticLoggerBinder.getSingleton().getLoggerFactory()); 19 } 20 21 @Test 22 public void getLoggerFactoryClassStr() throws Exception { 23 assertEquals("uk.org.lidalia.slf4jtest.TestLoggerFactory", StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr()); 24 } 25 26 @Test 27 public void getLoggerFactoryReturnsCorrectlyFromSlf4JLoggerFactory() { 28 ILoggerFactory expected = TestLoggerFactory.getInstance(); 29 assertThat(LoggerFactory.getILoggerFactory(), is(expected)); 30 } 31 32 @Test 33 public void requestedApiVersion() throws Exception { 34 assertEquals("1.6", StaticLoggerBinder.REQUESTED_API_VERSION); 35 } 36 }