XMLManipulator implements Manipulatable { @Override public boolean writeConfValue(String file, String propertyName, String propertyValue) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return false; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); return marshallObject(propertyName, propertyValue, jaxbContext, confFile, configuration); } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return false; }  @Override boolean deleteConfValue(String file, String propertyName); @Override boolean editConfValue(String file, String propertyName,
			String newPropertyValue); @Override boolean writeConfValue(String file, String propertyName,
			String propertyValue); @Override String readConfValue(String file, String propertyName);  }
@Test public void testWriteConfValue_1() throws Exception { String propertyName = "a"; String propertyValue = "b"; String filePath = "abcdef.xml"; boolean result = xmlManipulator.writeConfValue(filePath, propertyName, propertyValue); assertEquals(false, result); }
@Test public void testWriteConfValue_2() throws Exception { String propertyName = "0123456789"; String propertyValue = "0123456789"; boolean result = xmlManipulator.writeConfValue(filePath, propertyName, propertyValue); assertEquals(true, result); }