ResourceLoader { public Document getDocument() { if(document == null) { buildDocument(inputStream); } return document; } ResourceLoader(String name); Document getDocument(); Properties getProperties();  }
@Test public void documentRead() { ResourceLoader resourceLoader = new ResourceLoader("collection/test-collections.xml"); Document document = resourceLoader.getDocument(); Assert.assertNotNull(document); }
@Test public void readElements() { ResourceLoader resourceLoader = new ResourceLoader("collection/test-collections.xml"); Document document = resourceLoader.getDocument(); @SuppressWarnings("unchecked") List<Element> collectionList = document.selectNodes(" System.out.println(collectionList); for(Element node : collectionList) { System.out.println(node.elementText("analyzer")); System.out.println(node.elementText("indexingDirectory")); @SuppressWarnings("unchecked") List<Element> fieldsList = document.selectNodes(" for(Element e : fieldsList) { System.out.println(e.attributeValue("name")); System.out.println(e.attributeValue("store")); System.out.println(e.attributeValue("index")); System.out.println(e.attributeValue("type")); System.out.println(e.attributeValue("analyze")); System.out.println(e.attributeValue("must")); System.out.println(e.attributeValue("boost")); } @SuppressWarnings("unchecked") List<Element> defaultSearchFields = document.selectNodes(" for(Element e : defaultSearchFields) { System.out.println(e.attributeValue("name")); } @SuppressWarnings("unchecked") List<Element> sortFields = document.selectNodes(" for(Element e : sortFields) { System.out.println(e.attributeValue("source")); System.out.println(e.attributeValue("dest")); } } }