/** * Returns an unmodifiable map instance containing the custom messages * for this configuration. * @return unmodifiable map containing custom messages */ protected Map<String, String> getCustomMessages() { return getConfiguration().getMessages(); }
@Test public void testCustomMessages() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); final DefaultConfiguration config = (DefaultConfiguration) loadConfiguration( "InputConfigurationLoaderCustomMessages.xml", props); final Configuration[] children = config.getChildren(); final Configuration[] grandchildren = children[0].getChildren(); final String expectedKey = "name.invalidPattern"; assertTrue("Messages should contain key: " + expectedKey, grandchildren[0].getMessages() .containsKey(expectedKey)); }
/** * Returns an unmodifiable map instance containing the custom messages * for this configuration. * @return unmodifiable map containing custom messages */ protected Map<String, String> getCustomMessages() { return getConfiguration().getMessages(); }