コード例 #1
0
 @Test
 public void messageProvider() {
   assertEquals(TEST_MSG_EN, TestMessages.P2_MSG.getText(TEST_P1, TEST_P2));
   assertEquals(TEST_TTL_EN, TestMessages.P2_TTL.getText(TEST_P1, TEST_P2));
   assertEquals(TEST_MSG_FR, TestMessages.P2_MSG.getText(Locale.FRENCH, TEST_P1, TEST_P2));
   assertEquals(TEST_TTL_FR, TestMessages.P2_TTL.getText(Locale.FRENCH, TEST_P1, TEST_P2));
 }
コード例 #2
0
  @Test
  public void loggerProxy() {
    TestMessages.P2_MSG.error(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.ERROR, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);
    TestMessages.P2_MSG.error(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.ERROR, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);

    TestMessages.P2_TTL.error(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.ERROR, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
    TestMessages.P2_TTL.error(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.ERROR, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);

    TestMessages.P2_MSG.warn(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.WARN, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);
    TestMessages.P2_MSG.warn(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.WARN, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);

    TestMessages.P2_TTL.warn(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.WARN, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
    TestMessages.P2_TTL.warn(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.WARN, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);

    TestMessages.P2_MSG.info(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.INFO, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);
    TestMessages.P2_MSG.info(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.INFO, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);

    TestMessages.P2_TTL.info(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.INFO, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
    TestMessages.P2_TTL.info(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.INFO, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);

    TestMessages.P2_MSG.debug(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.DEBUG, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);
    TestMessages.P2_MSG.debug(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.DEBUG, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);

    TestMessages.P2_TTL.debug(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.DEBUG, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
    TestMessages.P2_TTL.debug(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.DEBUG, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);

    TestMessages.P2_MSG.trace(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.TRACE, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);
    TestMessages.P2_MSG.trace(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.TRACE, TEST_CATEGORY, TEST_MSG_EN, TEST_LOCATION);

    TestMessages.P2_TTL.trace(TEST_CATEGORY, TEST_THROWABLE, TEST_P1, TEST_P2);
    assertSingleEvent(Level.TRACE, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
    TestMessages.P2_TTL.trace(TEST_CATEGORY, TEST_P1, TEST_P2);
    assertSingleEvent(Level.TRACE, TEST_CATEGORY, TEST_TTL_EN, TEST_LOCATION);
  }