@Test public void testGetLithoStratigraphyList() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); List<LithoStratigraphy> actualList = null; int listSize = 0; CrsSpecimenTransformer crsSpecimenTransformer = new CrsSpecimenTransformer(etlStatistics); CrsExtractor extractor = new CrsExtractor(specimenFile, etlStatistics); for (XMLRecordInfo extracted : extractor) { CommonReflectionUtil.setField(AbstractTransformer.class, crsSpecimenTransformer, "objectID", "RMNH.MAM.TT.5"); CommonReflectionUtil.setField(AbstractTransformer.class, crsSpecimenTransformer, "input", extracted); Object returned = CommonReflectionUtil.callMethod(null, null, crsSpecimenTransformer, "getLithoStratigraphyList"); actualList = (List<LithoStratigraphy>) returned; listSize = actualList.size(); if (listSize > 0) break; } LithoStratigraphy expectedLs = new LithoStratigraphy(); expectedLs.setQualifier("Test Qualifier"); expectedLs.setBed("Test Bed"); expectedLs.setInformalName("Test InfoName"); assertEquals("01",2, listSize); assertEquals("02",expectedLs.getQualifier(), actualList.get(1).getQualifier()); assertEquals("03",expectedLs.getBed(), actualList.get(1).getBed()); assertEquals("04",expectedLs.getInformalName(), actualList.get(1).getInformalName()); }
private List<LithoStratigraphy> getLithoStratigraphyList() { Element record = input.getRecord(); List<Element> lithoStratigraphyElements = DOMUtil.getDescendants(record, "ncrsLithoStratigraphy"); if (lithoStratigraphyElements == null) { return null; } List<LithoStratigraphy> result = new ArrayList<>(lithoStratigraphyElements.size()); for (Element e : lithoStratigraphyElements) { LithoStratigraphy one = getLithoStratigraphyObject(e); result.add(one); } return result; }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<LithoStratigraphy> getLithoStratigraphyList() { Element record = input.getRecord(); List<Element> lithoStratigraphyElements = DOMUtil.getDescendants(record, "ncrsLithoStratigraphy"); if (lithoStratigraphyElements == null) { return null; } List<LithoStratigraphy> result = new ArrayList<>(lithoStratigraphyElements.size()); for (Element e : lithoStratigraphyElements) { LithoStratigraphy one = getLithoStratigraphyObject(e); result.add(one); } return result; } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<LithoStratigraphy> getLithoStratigraphyList() { Element record = input.getRecord(); List<Element> lithoStratigraphyElements = DOMUtil.getDescendants(record, "ncrsLithoStratigraphy"); if (lithoStratigraphyElements == null) { return null; } List<LithoStratigraphy> result = new ArrayList<>(lithoStratigraphyElements.size()); for (Element e : lithoStratigraphyElements) { LithoStratigraphy one = getLithoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats); }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<LithoStratigraphy> getLithoStratigraphyList() { Element record = input.getRecord(); List<Element> lithoStratigraphyElements = DOMUtil.getDescendants(record, "ncrsLithoStratigraphy"); if (lithoStratigraphyElements == null) { return null; } List<LithoStratigraphy> result = new ArrayList<>(lithoStratigraphyElements.size()); for (Element e : lithoStratigraphyElements) { LithoStratigraphy one = getLithoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);  }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<LithoStratigraphy> getLithoStratigraphyList() { Element record = input.getRecord(); List<Element> lithoStratigraphyElements = DOMUtil.getDescendants(record, "ncrsLithoStratigraphy"); if (lithoStratigraphyElements == null) { return null; } List<LithoStratigraphy> result = new ArrayList<>(lithoStratigraphyElements.size()); for (Element e : lithoStratigraphyElements) { LithoStratigraphy one = getLithoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);   }