MessageManager { public String getMessage(boolean resource, String messageIdOrPattern, Object... args) throws MessageRuntimeException { return getMessage(resource, messageIdOrPattern, null, args); } MessageManager(String configFile);  MessageManager(String configFile, String messageIdFormatKey,
                          String messageBaseNameKey,
                          String throwIfResourceNotFoundKey,
                          String messageFormatterFqcnKey); String getMessage(boolean resource, String messageIdOrPattern,
            Object... args); String getMessage(boolean resource, String messageIdOrPattern,
            Locale locale, Object... args);  }
@Test public void testConstructor06() { Thread.currentThread().setContextClassLoader(new BadClassLoader()); try { new MessageManager(""); fail("例外が発生しませんでした"); } catch (Exception e) { e.printStackTrace(); assertEquals("java.lang.RuntimeException: hoge", e.getMessage()); assertEquals(MessageRuntimeException.class, e.getClass()); } }
@Test public void testGetMessage05() { MessageManager manager = new MessageManager("jp/terasoluna/fw/message/terasoluna-logger04.properties"); try { manager.getMessage(true, "message02"); fail("例外が発生しませんでした"); } catch (Exception e) { e.printStackTrace(); assertEquals( "message pattern is illeagal. pattern=メッセージ02{a}] logId=message02", e.getMessage()); assertEquals(MessageRuntimeException.class, e.getClass()); } }