### Question:
Config { public static void load (File file) throws IOException { load(file, true); } protected  Config(); static void load(File file); static void load(File file, boolean skipExampleConfig); static void loadDir(File dir); static String get(String section, String key); static String getOrDefault(String section, String key, String defaultValue); static boolean getBool(String section, String key); static int getInt(String section, String key); static float getFloat(String section, String key); static void set(String section, String key, String value); static void reload(); static void clear(); static boolean forceExit; }### Answer:
@Test (expected = IllegalStateException.class) public void testLoadNotExistentFile () throws IOException { Config.load(new File("not-existent-file")); }
@Test public void testLoad () throws IOException { Config.load(new File("../config/junit-logger.cfg")); assertEquals(true, Config.getBool("Logger", "enabled")); assertEquals(true, Config.getBool("Logger", "printToConsole")); assertEquals("VERBOSE", Config.get("Logger", "level")); assertEquals(10, Config.getInt("Logger", "testInt")); assertEquals(1.2f, Config.getFloat("Logger", "testFloat"), 0.0001f); Config.reload(); }
@Test (expected = IllegalStateException.class) public void testLoadDirAsFile () throws IOException { Config.load(new File("../config/")); }
@Test public void testLoadExampleConfig () throws IOException { Config.load(new File("../data/junit/exampleconfig/test.example.cfg"), true); Config.load(new File("../data/junit/exampleconfig/test.travis.cfg"), true); }