Example #1
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);
  }
Example #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);
  }
Example #3
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);
  }