use of cz.mzk.recordmanager.server.index.enrich.UrlDedupRecordEnricher in project RecordManager2 by moravianlibrary.
the class UrlEnricherTest method krameriusUrlTest.
@Test
public void krameriusUrlTest() {
DedupRecord dr = new DedupRecord();
SolrInputDocument merged = new SolrInputDocument();
List<SolrInputDocument> local = new ArrayList<SolrInputDocument>();
local.add(newField(MZKKRAM_PROT_URL));
local.add(newField(MZKKRAM_UNKN_URL));
List<String> result = new ArrayList<>();
result.add(MZKKRAM_PROT_URL);
UrlDedupRecordEnricher ue = new UrlDedupRecordEnricher();
ue.enrich(dr, merged, local);
Assert.assertEquals(merged.getFieldValues(SolrFieldConstants.URL).toArray(), result.toArray());
}
use of cz.mzk.recordmanager.server.index.enrich.UrlDedupRecordEnricher in project RecordManager2 by moravianlibrary.
the class UrlEnricherTest method notDuplicitUrlTest.
@Test
public void notDuplicitUrlTest() {
DedupRecord dr = new DedupRecord();
SolrInputDocument merged = new SolrInputDocument();
List<SolrInputDocument> local = new ArrayList<SolrInputDocument>();
local.add(newField(MZK_ONLINE_MZK_URL));
local.add(newField(MZK_UNKNOWN_TRE_URL));
local.add(newField(MZK_PROTECTED_BRNO_URL));
List<String> result = new ArrayList<>();
result.add(MZK_ONLINE_MZK_URL);
result.add(MZK_UNKNOWN_TRE_URL);
result.add(MZK_PROTECTED_BRNO_URL);
UrlDedupRecordEnricher ue = new UrlDedupRecordEnricher();
ue.enrich(dr, merged, local);
Assert.assertTrue(merged.getFieldValues(SolrFieldConstants.URL).containsAll(result));
}
use of cz.mzk.recordmanager.server.index.enrich.UrlDedupRecordEnricher in project RecordManager2 by moravianlibrary.
the class UrlEnricherTest method unknownUrlTest.
@Test
public void unknownUrlTest() {
DedupRecord dr = new DedupRecord();
SolrInputDocument merged = new SolrInputDocument();
List<SolrInputDocument> local = new ArrayList<SolrInputDocument>();
local.add(newField(MZK_UNKNOWN_MZK_TEXT_URL));
local.add(newField(TRE_UNKNOWN_MZK_TEXT_URL));
local.add(newField(MZK_UNKNOWN_BRNO_URL));
local.add(newField(TRE_UNKNOWN_BRNO_URL));
local.add(newField(MZK_UNKNOWN_TRE_URL));
List<String> result = new ArrayList<>();
result.add(MZK_UNKNOWN_TRE_URL);
result.add(UNKNOWN_MZK_TEXT_URL);
result.add(UNKNOWN_BRNO_URL);
UrlDedupRecordEnricher ue = new UrlDedupRecordEnricher();
ue.enrich(dr, merged, local);
Assert.assertEquals(merged.getFieldValues(SolrFieldConstants.URL).toArray(), result.toArray());
}
use of cz.mzk.recordmanager.server.index.enrich.UrlDedupRecordEnricher in project RecordManager2 by moravianlibrary.
the class UrlEnricherTest method onlineUrlTest.
@Test
public void onlineUrlTest() {
DedupRecord dr = new DedupRecord();
SolrInputDocument merged = new SolrInputDocument();
List<SolrInputDocument> local = new ArrayList<SolrInputDocument>();
local.add(newField(MZK_ONLINE_MZK_URL));
local.add(newField(TRE_ONLINE_MZK_URL));
local.add(newField(MZK_UNKNOWN_MZK_URL));
local.add(newField(MZK_PROTECTED_MZK_URL));
List<String> result = new ArrayList<>();
result.add(MZK_ONLINE_MZK_URL);
result.add(TRE_ONLINE_MZK_URL);
UrlDedupRecordEnricher ue = new UrlDedupRecordEnricher();
ue.enrich(dr, merged, local);
Assert.assertEquals(merged.getFieldValues(SolrFieldConstants.URL).toArray(), result.toArray());
}
use of cz.mzk.recordmanager.server.index.enrich.UrlDedupRecordEnricher in project RecordManager2 by moravianlibrary.
the class UrlEnricherTest method unknownProtectedUrlTest.
@Test
public void unknownProtectedUrlTest() {
DedupRecord dr = new DedupRecord();
SolrInputDocument merged = new SolrInputDocument();
List<SolrInputDocument> local = new ArrayList<SolrInputDocument>();
local.add(newField(TRE_UNKNOWN_MZK_URL));
local.add(newField(MZK_PROTECTED_MZK_URL));
List<String> result = new ArrayList<>();
result.add(MZK_PROTECTED_MZK_URL);
UrlDedupRecordEnricher ue = new UrlDedupRecordEnricher();
ue.enrich(dr, merged, local);
Assert.assertEquals(merged.getFieldValues(SolrFieldConstants.URL).toArray(), result.toArray());
}
Aggregations