MessageManager { protected ResourceBundle getResourceBundle(String basename, Locale locale) { if (locale == null) { locale = Locale.getDefault(); } ResourceBundle bundle = null; try { bundle = ResourceBundle.getBundle(basename, locale); } catch (MissingResourceException e) { if (throwIfResourceNotFound) { StringBuilder sb = new StringBuilder("resource[").append( basename).append("] is not found"); throw new MessageRuntimeException(sb.toString(), e); } } return bundle; } 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 testGetResourceBundle() { MessageManager manager = new MessageManager("jp/terasoluna/fw/message/terasoluna-logger02.properties"); try { manager.getResourceBundle("META-INF/hoge.properties", null); fail("例外が発生しませんでした"); } catch (Exception e) { e.printStackTrace(); assertEquals("resource[META-INF/hoge.properties] is not found", e .getMessage()); assertEquals(MessageRuntimeException.class, e.getClass()); } }