@Test public void test_Write_AllElements () { harvesterDao.writeMetaInfos(harvesterDocuments); final DB db = publisherConfig.getTargetDBConfig().get(0).getMongoConfig().connectToDB(); int idx = 0; for (final HarvesterRecord record: harvesterDocuments.subList(0, 1)) { for (final SourceDocumentReferenceMetaInfo metaInfo : record.getUniqueMetainfos()) { final WebResourceMetaInfo writtenMetaInfo = webResourceMetaInfoDao.read(metaInfo.getId()); final WebResourceMetaInfo correctMetaInfo = correctMetaInfos.get(idx++); ReflectionAssert.assertReflectionEquals(correctMetaInfo, writtenMetaInfo); } final HarvesterDocument document = record.getEdmIsShownByDocument(); if (null == document) { continue; } final String edmObject = (String)db.getCollection("Aggregation").findOne(new BasicDBObject("about", "/aggregation/provider" + document.getReferenceOwner().getRecordId())).get("edmObject"); final String edmPreview = (String)db.getCollection("EuropeanaAggregation").findOne(new BasicDBObject("about", "/aggregation/europeana" + document.getReferenceOwner().getRecordId())).get("edmPreview"); if (null != document && ProcessingJobSubTaskState.SUCCESS == document.getSubTaskStats().getThumbnailGenerationState() && ProcessingJobSubTaskState.SUCCESS == document.getSubTaskStats().getThumbnailStorageState()) { assertEquals(document.getUrl(), edmObject); assertEquals(document.getUrl(), edmPreview); } else { assertEquals("ana are mere", edmObject); assertEquals("ana are mere", edmPreview); } } }
public void writeMetaInfos (Collection<HarvesterRecord> records) { writeMetaInfos(records, "publisher-writeMetainfos-"+ Double.doubleToLongBits(Math.random() * 5000)); }
PublisherHarvesterDao { public void writeMetaInfos (Collection<HarvesterRecord> records) { writeMetaInfos(records, "publisher-writeMetainfos-"+ Double.doubleToLongBits(Math.random() * 5000)); } }
PublisherHarvesterDao { public void writeMetaInfos (Collection<HarvesterRecord> records) { writeMetaInfos(records, "publisher-writeMetainfos-"+ Double.doubleToLongBits(Math.random() * 5000)); } PublisherHarvesterDao(DBTargetConfig config); }
PublisherHarvesterDao { public void writeMetaInfos (Collection<HarvesterRecord> records) { writeMetaInfos(records, "publisher-writeMetainfos-"+ Double.doubleToLongBits(Math.random() * 5000)); } PublisherHarvesterDao(DBTargetConfig config); void writeMetaInfos(Collection<HarvesterRecord> records); void writeMetaInfos(Collection<HarvesterRecord> records, final String publishingBatchId); }
PublisherHarvesterDao { public void writeMetaInfos (Collection<HarvesterRecord> records) { writeMetaInfos(records, "publisher-writeMetainfos-"+ Double.doubleToLongBits(Math.random() * 5000)); } PublisherHarvesterDao(DBTargetConfig config); void writeMetaInfos(Collection<HarvesterRecord> records); void writeMetaInfos(Collection<HarvesterRecord> records, final String publishingBatchId);  }