@Test(expected = ExitException.class) public void testValidateConfigMissingString() throws ExitException { final Properties properties = new Properties(); final String requiredStrings[] = {"p1", "p2", "p3"}; final String requiredBooleans[] = {}; final String requiredIntegers[] = {}; final String requiredLongs[] = {}; properties.put("p1", STRING_TEST_VALUE); properties.put("p3", STRING_TEST_VALUE); ConfigParser.validateConfig(properties, requiredStrings, requiredBooleans, requiredIntegers, requiredLongs); }
public static void validateConfig(final Properties config, final String[] requiredStrings, final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs) throws ExitException { for (final String param : requiredStrings) { parseString(config, param); } for (final String param : requiredBooleans) { parseBoolean(config, param); } for (final String param : requiredIntegers) { parseInteger(config, param); } for (final String param : requiredLongs) { parseLong(config, param); } }
ConfigParser { public static void validateConfig(final Properties config, final String[] requiredStrings, final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs) throws ExitException { for (final String param : requiredStrings) { parseString(config, param); } for (final String param : requiredBooleans) { parseBoolean(config, param); } for (final String param : requiredIntegers) { parseInteger(config, param); } for (final String param : requiredLongs) { parseLong(config, param); } } }
ConfigParser { public static void validateConfig(final Properties config, final String[] requiredStrings, final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs) throws ExitException { for (final String param : requiredStrings) { parseString(config, param); } for (final String param : requiredBooleans) { parseBoolean(config, param); } for (final String param : requiredIntegers) { parseInteger(config, param); } for (final String param : requiredLongs) { parseLong(config, param); } } private  ConfigParser(); }
ConfigParser { public static void validateConfig(final Properties config, final String[] requiredStrings, final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs) throws ExitException { for (final String param : requiredStrings) { parseString(config, param); } for (final String param : requiredBooleans) { parseBoolean(config, param); } for (final String param : requiredIntegers) { parseInteger(config, param); } for (final String param : requiredLongs) { parseLong(config, param); } } private  ConfigParser(); static void checkParamExists(final Properties properties, final String param); static boolean parseBoolean(final Properties properties, final String param); static boolean parseBoolean(final Properties properties, final String param, final Boolean defaultValue); static int parseInteger(final Properties properties, final String param); static int parseInteger(final Properties properties, final String param, final Integer defaultValue); static long parseLong(final Properties properties, final String param); static long parseLong(final Properties properties, final String param, final Long defaultValue); static String parseString(final Properties properties, final String param); static String parseString(final Properties properties, final String param, final String defaultValue); static void validateBooleanParam(final String val); static void validateConfig(final Properties config, final String[] requiredStrings,
        final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs); static void validateIntegerParam(final String val); static void validateLongParam(final String val); }
ConfigParser { public static void validateConfig(final Properties config, final String[] requiredStrings, final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs) throws ExitException { for (final String param : requiredStrings) { parseString(config, param); } for (final String param : requiredBooleans) { parseBoolean(config, param); } for (final String param : requiredIntegers) { parseInteger(config, param); } for (final String param : requiredLongs) { parseLong(config, param); } } private  ConfigParser(); static void checkParamExists(final Properties properties, final String param); static boolean parseBoolean(final Properties properties, final String param); static boolean parseBoolean(final Properties properties, final String param, final Boolean defaultValue); static int parseInteger(final Properties properties, final String param); static int parseInteger(final Properties properties, final String param, final Integer defaultValue); static long parseLong(final Properties properties, final String param); static long parseLong(final Properties properties, final String param, final Long defaultValue); static String parseString(final Properties properties, final String param); static String parseString(final Properties properties, final String param, final String defaultValue); static void validateBooleanParam(final String val); static void validateConfig(final Properties config, final String[] requiredStrings,
        final String[] requiredBooleans, final String[] requiredIntegers, final String[] requiredLongs); static void validateIntegerParam(final String val); static void validateLongParam(final String val);  }