@Test public void testGetChronoStratigraphyList() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); List<ChronoStratigraphy> 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, "getChronoStratigraphyList"); actualList = (List<ChronoStratigraphy>) returned; listSize = actualList.size(); if (listSize > 0) break; } ChronoStratigraphy expectedCsg = new ChronoStratigraphy(); expectedCsg.setYoungRegionalSubstage("Test Regional Sub-Stage"); expectedCsg.setYoungRegionalStage("Test Regional Stage"); expectedCsg.setYoungChronoName("CRETACEOUS"); assertEquals("01",1, listSize); assertEquals("02",expectedCsg.getYoungRegionalSubstage(), actualList.get(0).getYoungRegionalSubstage()); assertEquals("03",expectedCsg.getYoungRegionalStage(), actualList.get(0).getYoungRegionalStage()); assertEquals("04",expectedCsg.getYoungChronoName(), actualList.get(0).getYoungChronoName()); }
private List<ChronoStratigraphy> getChronoStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsChronoStratigraphy"); if (elems == null) { return null; } List<ChronoStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { ChronoStratigraphy one = getChronoStratigraphyObject(e); result.add(one); } return result; }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<ChronoStratigraphy> getChronoStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsChronoStratigraphy"); if (elems == null) { return null; } List<ChronoStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { ChronoStratigraphy one = getChronoStratigraphyObject(e); result.add(one); } return result; } }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<ChronoStratigraphy> getChronoStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsChronoStratigraphy"); if (elems == null) { return null; } List<ChronoStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { ChronoStratigraphy one = getChronoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats); }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<ChronoStratigraphy> getChronoStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsChronoStratigraphy"); if (elems == null) { return null; } List<ChronoStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { ChronoStratigraphy one = getChronoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);  }
CrsSpecimenTransformer extends AbstractXMLTransformer<Specimen> { private List<ChronoStratigraphy> getChronoStratigraphyList() { Element record = input.getRecord(); List<Element> elems = DOMUtil.getDescendants(record, "ncrsChronoStratigraphy"); if (elems == null) { return null; } List<ChronoStratigraphy> result = new ArrayList<>(elems.size()); for (Element e : elems) { ChronoStratigraphy one = getChronoStratigraphyObject(e); result.add(one); } return result; } CrsSpecimenTransformer(ETLStatistics stats);   }