@Test public void testReadConfValue_3() throws Exception { String propertyName = "distributed"; String result = xmlManipulator.readConfValue(filePath, propertyName); assertEquals("true", result); }
@Override public String readConfValue(String file, String propertyName) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return null; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); List<Property> propertyList = configuration.getProperty(); for (Iterator<Property> iterator = propertyList.iterator(); iterator .hasNext();) { Property property = iterator.next(); if (property.getName().equals(propertyName)) { return property.getValue(); } } } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; }
XMLManipulator implements Manipulatable { @Override public String readConfValue(String file, String propertyName) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return null; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); List<Property> propertyList = configuration.getProperty(); for (Iterator<Property> iterator = propertyList.iterator(); iterator .hasNext();) { Property property = iterator.next(); if (property.getName().equals(propertyName)) { return property.getValue(); } } } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; } }
XMLManipulator implements Manipulatable { @Override public String readConfValue(String file, String propertyName) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return null; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); List<Property> propertyList = configuration.getProperty(); for (Iterator<Property> iterator = propertyList.iterator(); iterator .hasNext();) { Property property = iterator.next(); if (property.getName().equals(propertyName)) { return property.getValue(); } } } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; }  }
XMLManipulator implements Manipulatable { @Override public String readConfValue(String file, String propertyName) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return null; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); List<Property> propertyList = configuration.getProperty(); for (Iterator<Property> iterator = propertyList.iterator(); iterator .hasNext();) { Property property = iterator.next(); if (property.getName().equals(propertyName)) { return property.getValue(); } } } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; }  @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 String readConfValue(String file, String propertyName) { try { File confFile = new File(file); if (!confFile.exists()) { System.err.println("File " + file + " does not exists."); return null; } JAXBContext jaxbContext = JAXBContext .newInstance("com.impetus.ankush.agent.action.impl"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Configuration configuration = (Configuration) unmarshaller .unmarshal(confFile); List<Property> propertyList = configuration.getProperty(); for (Iterator<Property> iterator = propertyList.iterator(); iterator .hasNext();) { Property property = iterator.next(); if (property.getName().equals(propertyName)) { return property.getValue(); } } } catch (JAXBException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; }  @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);  }