@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); }
@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; }
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; } }
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; }  }
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); }
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);  }