XmlConfigurationDaoImpl implements ConfigurationDao { @Override public List<ConfigurationNode> getNodes(final RootNode rootNode) { return this.rootNode.getConfigurationNodes(rootNode); } @Inject  XmlConfigurationDaoImpl(@Named("localHolmesDataDir") final String localHolmesDataDir); @Override List<ConfigurationNode> getNodes(final RootNode rootNode); @Override ConfigurationNode getNode(final RootNode rootNode, final String nodeId); @Override Optional<ConfigurationNode> findNode(final RootNode rootNode, final String excludedNodeId, final String label, final String path); @Override void save(); @Override T getParameter(final ConfigurationParameter<T> parameter); @Override void setParameter(final ConfigurationParameter<T> parameter, final T value);  }
@Test public void testXmlConfiguration() throws IOException { String configDir = new File(this.getClass().getResource("/configuration").getPath()).getAbsolutePath(); XmlConfigurationDaoImpl configuration = new XmlConfigurationDaoImpl(configDir); assertNotNull(configuration.getNodes(RootNode.AUDIO)); assertNotNull(configuration.getNodes(VIDEO)); assertNotNull(configuration.getNodes(RootNode.PICTURE)); assertTrue(configuration.getNodes(RootNode.ROOT).isEmpty()); }
@Test public void testXmlConfigurationEmpty() throws IOException { String configDir = new File(this.getClass().getResource("/configurationEmpty").getPath()).getAbsolutePath(); XmlConfigurationDaoImpl configuration = new XmlConfigurationDaoImpl(configDir); assertNotNull(configuration.getNodes(RootNode.AUDIO)); assertNotNull(configuration.getNodes(VIDEO)); assertNotNull(configuration.getNodes(RootNode.PICTURE)); assertTrue(configuration.getNodes(RootNode.ROOT).isEmpty()); }
@Test public void testXmlConfigurationNull() throws IOException { String configDir = new File(this.getClass().getResource("/configurationNull").getPath()).getAbsolutePath(); XmlConfigurationDaoImpl configuration = new XmlConfigurationDaoImpl(configDir); assertNotNull(configuration.getNodes(RootNode.AUDIO)); assertNotNull(configuration.getNodes(VIDEO)); assertNotNull(configuration.getNodes(RootNode.PICTURE)); assertTrue(configuration.getNodes(RootNode.ROOT).isEmpty()); }