Exemplo n.º 1
0
  @Test
  public void testIsErrorEnabled() {
    org.apache.log4j.Logger mock = createStrictMock(org.apache.log4j.Logger.class);
    replay(mock);

    InternalLogger logger = new Log4JLogger(mock);
    assertTrue(logger.isErrorEnabled());
    verify(mock);
  }
Exemplo n.º 2
0
  @Test
  public void testInfo() {
    org.apache.log4j.Logger mock = createStrictMock(org.apache.log4j.Logger.class);

    mock.info("a");
    replay(mock);

    InternalLogger logger = new Log4JLogger(mock);
    logger.info("a");
    verify(mock);
  }
Exemplo n.º 3
0
  @Test
  public void testDebugWithException() {
    org.apache.log4j.Logger mock = createStrictMock(org.apache.log4j.Logger.class);

    mock.debug("a", e);
    replay(mock);

    InternalLogger logger = new Log4JLogger(mock);
    logger.debug("a", e);
    verify(mock);
  }
Exemplo n.º 4
0
  @Test
  public void testIsInfoEnabled() {
    org.apache.log4j.Logger mock = createStrictMock(org.apache.log4j.Logger.class);

    expect(mock.isInfoEnabled()).andReturn(true);
    replay(mock);

    InternalLogger logger = new Log4JLogger(mock);
    assertTrue(logger.isInfoEnabled());
    verify(mock);
  }
Exemplo n.º 5
0
 @Test
 public void testCreation() {
   InternalLogger logger = new CommonsLoggerFactory().newInstance("foo");
   assertTrue(logger instanceof CommonsLogger);
   assertEquals("foo", logger.toString());
 }