@Test public void testSkipRecord() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); boolean bval = true; CrsMultiMediaTransformer crsMultiMediaTransformer = new CrsMultiMediaTransformer(etlStatistics); CrsExtractor extractor = new CrsExtractor(multimediaFile, etlStatistics); for (XMLRecordInfo extracted : extractor) { CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "objectID", "RMNH.INS.867435"); CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "input", extracted); Object obj = ReflectionUtil.call(crsMultiMediaTransformer, "skipRecord", new Class[] {}, new Object[] {}); bval = (boolean) obj; } assertFalse(bval); }
@Override protected boolean skipRecord() { databaseID = val(input.getRecord(), "identifier"); if (hasStatusDeleted()) { if (logger.isDebugEnabled()) { debug("Skipping record with status \"deleted\""); } return true; } Element oaiDcElem = getDescendant(input.getRecord(), "oai_dc:dc"); if (val(oaiDcElem, "abcd:RecordBasis") == null) { if (logger.isDebugEnabled()) { debug("Skipping virtual specimen"); } return true; } if (getDescendant(oaiDcElem, "frmDigitalebestanden") == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <frmDigitalebestanden>"); } return true; } List<Element> elems = getDescendants(oaiDcElem, "ncrsDetermination"); if (elems == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <ncrsDetermination>"); } return true; } return testGenera != null && !hasTestGenus(elems); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { @Override protected boolean skipRecord() { databaseID = val(input.getRecord(), "identifier"); if (hasStatusDeleted()) { if (logger.isDebugEnabled()) { debug("Skipping record with status \"deleted\""); } return true; } Element oaiDcElem = getDescendant(input.getRecord(), "oai_dc:dc"); if (val(oaiDcElem, "abcd:RecordBasis") == null) { if (logger.isDebugEnabled()) { debug("Skipping virtual specimen"); } return true; } if (getDescendant(oaiDcElem, "frmDigitalebestanden") == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <frmDigitalebestanden>"); } return true; } List<Element> elems = getDescendants(oaiDcElem, "ncrsDetermination"); if (elems == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <ncrsDetermination>"); } return true; } return testGenera != null && !hasTestGenus(elems); } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { @Override protected boolean skipRecord() { databaseID = val(input.getRecord(), "identifier"); if (hasStatusDeleted()) { if (logger.isDebugEnabled()) { debug("Skipping record with status \"deleted\""); } return true; } Element oaiDcElem = getDescendant(input.getRecord(), "oai_dc:dc"); if (val(oaiDcElem, "abcd:RecordBasis") == null) { if (logger.isDebugEnabled()) { debug("Skipping virtual specimen"); } return true; } if (getDescendant(oaiDcElem, "frmDigitalebestanden") == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <frmDigitalebestanden>"); } return true; } List<Element> elems = getDescendants(oaiDcElem, "ncrsDetermination"); if (elems == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <ncrsDetermination>"); } return true; } return testGenera != null && !hasTestGenus(elems); } CrsMultiMediaTransformer(ETLStatistics stats); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { @Override protected boolean skipRecord() { databaseID = val(input.getRecord(), "identifier"); if (hasStatusDeleted()) { if (logger.isDebugEnabled()) { debug("Skipping record with status \"deleted\""); } return true; } Element oaiDcElem = getDescendant(input.getRecord(), "oai_dc:dc"); if (val(oaiDcElem, "abcd:RecordBasis") == null) { if (logger.isDebugEnabled()) { debug("Skipping virtual specimen"); } return true; } if (getDescendant(oaiDcElem, "frmDigitalebestanden") == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <frmDigitalebestanden>"); } return true; } List<Element> elems = getDescendants(oaiDcElem, "ncrsDetermination"); if (elems == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <ncrsDetermination>"); } return true; } return testGenera != null && !hasTestGenus(elems); } CrsMultiMediaTransformer(ETLStatistics stats);  }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { @Override protected boolean skipRecord() { databaseID = val(input.getRecord(), "identifier"); if (hasStatusDeleted()) { if (logger.isDebugEnabled()) { debug("Skipping record with status \"deleted\""); } return true; } Element oaiDcElem = getDescendant(input.getRecord(), "oai_dc:dc"); if (val(oaiDcElem, "abcd:RecordBasis") == null) { if (logger.isDebugEnabled()) { debug("Skipping virtual specimen"); } return true; } if (getDescendant(oaiDcElem, "frmDigitalebestanden") == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <frmDigitalebestanden>"); } return true; } List<Element> elems = getDescendants(oaiDcElem, "ncrsDetermination"); if (elems == null) { if (logger.isDebugEnabled()) { debug("Missing or empty element <ncrsDetermination>"); } return true; } return testGenera != null && !hasTestGenus(elems); } CrsMultiMediaTransformer(ETLStatistics stats);   }