### Question:
DatabaseFieldConfigLoader { public static DatabaseFieldConfig fromReader(BufferedReader reader) throws SQLException { DatabaseFieldConfig config = new DatabaseFieldConfig(); boolean anything = false; while (true) { String line; try { line = reader.readLine(); } catch (IOException e) { throw SqlExceptionUtil.create("Could not read DatabaseFieldConfig from stream", e); } if (line == null) { break; } if (line.equals(CONFIG_FILE_END_MARKER)) { break; } if (line.length() == 0 || line.startsWith("#") || line.equals(CONFIG_FILE_START_MARKER)) { continue; } String[] parts = line.split("=", -2); if (parts.length != 2) { throw new SQLException("DatabaseFieldConfig reading from stream cannot parse line: " + line); } readField(config, parts[0], parts[1]); anything = true; } if (anything) { return config; } else { return null; } }  static DatabaseFieldConfig fromReader(BufferedReader reader); static void write(BufferedWriter writer, DatabaseFieldConfig config, String tableName); static void writeConfig(BufferedWriter writer, DatabaseFieldConfig config, String tableName);  }### Answer:
@Test public void testEmptyFile() throws Exception { String value = ""; assertNull(DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value)))); }
@Test(expected = SQLException.class) public void testBadLine() throws Exception { String value = "not a good line"; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }
@Test public void testBlankLine() throws Exception { String value = LINE_SEP; assertNull(DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value)))); }
@Test public void testComment() throws Exception { String value = "# some comment" + LINE_SEP; assertNull(DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value)))); }
@Test(expected = IllegalArgumentException.class) public void testBadPersisterClass() throws Exception { String value = "persisterClass=unknown class name" + LINE_SEP; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }
@Test(expected = IllegalArgumentException.class) public void testBadEnumValue() throws Exception { String value = "unknownEnumValue=notvalidclass" + LINE_SEP; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }
@Test(expected = IllegalArgumentException.class) public void testBadEnumClass() throws Exception { String value = "unknownEnumValue=notvalidclass#somevalue" + LINE_SEP; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }
@Test(expected = IllegalArgumentException.class) public void testBadEnumClassNotAnEnum() throws Exception { String value = "unknownEnumValue=java.lang.Object#somevalue" + LINE_SEP; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }
@Test(expected = IllegalArgumentException.class) public void testBadEnumClassInvalidEnumValue() throws Exception { String value = "unknownEnumValue=" + OurEnum.class.getName() + "#notvalid" + LINE_SEP; DatabaseFieldConfigLoader.fromReader(new BufferedReader(new StringReader(value))); }