use of org.orcid.utils.solr.entities.OrcidSolrDocument in project ORCID-Source by ORCID.
the class OrcidRecordToSolrDocumentTest method testNonSchemaExternalID.
@Test
public void testNonSchemaExternalID() throws JAXBException {
//as above, but with PDB identifier
Record record = getRecord("/v20recordWithPDB.xml");
OrcidRecordToSolrDocument v20 = new OrcidRecordToSolrDocument(false);
OrcidSolrDocument v20Doc = v20.convert(record, new ArrayList<Funding>());
Assert.assertEquals("cite-self", v20Doc.getSelfIds().get("cit-self").get(0));
Assert.assertEquals("pdb-value-self", v20Doc.getSelfIds().get("pdb-self").get(0));
Assert.assertEquals("cit-part-of", v20Doc.getPartOfIds().get("cit-part-of").get(0));
Assert.assertEquals("pdb-value-part-of", v20Doc.getPartOfIds().get("pdb-part-of").get(0));
Assert.assertTrue(v20Doc.getDigitalObjectIds().containsAll(v20Doc.getSelfIds().get("doi-self")));
Assert.assertTrue(v20Doc.getSelfIds().get("doi-self").containsAll(v20Doc.getDigitalObjectIds()));
Assert.assertTrue(v20Doc.getOtherIdentifierType().contains("pdb-value-self"));
Assert.assertTrue(v20Doc.getOtherIdentifierType().contains("pdb-value-part-of"));
}
use of org.orcid.utils.solr.entities.OrcidSolrDocument in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method checkSubtitlesPersisted.
@Test
@Rollback
public void checkSubtitlesPersisted() throws Exception {
OrcidProfile subtitledWorksProfile = getOrcidWithSubtitledWork();
OrcidSolrDocument standardWorkListing = solrDocWithAdditionalSubtitles();
orcidIndexManager.persistProfileInformationForIndexing(subtitledWorksProfile);
verify(solrDao).persist(eq(standardWorkListing));
}
use of org.orcid.utils.solr.entities.OrcidSolrDocument in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method fullyPopulatedSolrDocumentForPersistence.
private OrcidSolrDocument fullyPopulatedSolrDocumentForPersistence() {
OrcidSolrDocument orcidSolrDocument = new OrcidSolrDocument();
orcidSolrDocument.setOrcid("1234");
orcidSolrDocument.setCreditName("credit name");
orcidSolrDocument.setArxiv(new ArrayList<String>());
orcidSolrDocument.setAsin(new ArrayList<String>());
orcidSolrDocument.setAsintld(new ArrayList<String>());
orcidSolrDocument.setBibcode(new ArrayList<String>());
orcidSolrDocument.setDigitalObjectIds(new ArrayList<String>());
orcidSolrDocument.setEid(new ArrayList<String>());
orcidSolrDocument.setIsbn(new ArrayList<String>());
orcidSolrDocument.setIssn(new ArrayList<String>());
orcidSolrDocument.setJfm(new ArrayList<String>());
orcidSolrDocument.setJstor(new ArrayList<String>());
orcidSolrDocument.setLccn(new ArrayList<String>());
orcidSolrDocument.setMr(new ArrayList<String>());
orcidSolrDocument.setOclc(new ArrayList<String>());
orcidSolrDocument.setOl(new ArrayList<String>());
orcidSolrDocument.setOsti(new ArrayList<String>());
orcidSolrDocument.setOtherIdentifierType(new ArrayList<String>());
orcidSolrDocument.setPmc(new ArrayList<String>());
orcidSolrDocument.setRfc(new ArrayList<String>());
orcidSolrDocument.setSsrn(new ArrayList<String>());
orcidSolrDocument.setZbl(new ArrayList<String>());
orcidSolrDocument.setFamilyName("familyName");
orcidSolrDocument.setGivenNames("givenNames");
orcidSolrDocument.addEmailAddress("email");
// orcidSolrDocument.setAffiliatePrimaryInstitutionNames(Arrays.asList(new
// String[] { "Primary Inst1" }));
// orcidSolrDocument.setAffiliateInstitutionNames(Arrays.asList(new
// String[] { "Current Inst2" }));
orcidSolrDocument.setOtherNames(Arrays.asList(new String[] { "Other 1", "Other 2" }));
orcidSolrDocument.setPmid(Arrays.asList(new String[] { "work1-pmid" }));
orcidSolrDocument.setExternalIdSources(Arrays.asList(new String[] { "45678", "54321" }));
orcidSolrDocument.setExternalIdReferences(Arrays.asList(new String[] { "defghi", "abc123" }));
orcidSolrDocument.setExternalIdSourcesAndReferences(Arrays.asList(new String[] { "45678=defghi", "54321=abc123" }));
// orcidSolrDocument.setPastInstitutionNames(Arrays.asList(new String[]
// { "Past Inst 1", "Past Inst 2" }));
orcidSolrDocument.setWorkTitles(Arrays.asList(new String[] { "Work title 1", "Work title 2" }));
orcidSolrDocument.setKeywords(Arrays.asList(new String[] { "Pavement Studies", "Advanced Tea Making" }));
OrcidProfile orcidProfile = getStandardOrcid();
OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
return orcidSolrDocument;
}
use of org.orcid.utils.solr.entities.OrcidSolrDocument in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method solrDocumentLimitedtoVisibleDoi.
private OrcidSolrDocument solrDocumentLimitedtoVisibleDoi() {
OrcidSolrDocument orcidSolrDocument = fullyPopulatedSolrDocumentForPersistence();
orcidSolrDocument.setDigitalObjectIds((Arrays.asList(new String[] { "work1-doi1", "work2-doi1", "work2-doi2" })));
OrcidProfile orcidProfile = getStandardOrcidWithDoiInformation();
OrcidMessage orcidMessage = createFilteredOrcidMessage(orcidProfile);
orcidSolrDocument.setPublicProfileMessage(orcidMessage.toString());
return orcidSolrDocument;
}
use of org.orcid.utils.solr.entities.OrcidSolrDocument in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method checkGrantsPersisted.
@Test
@Rollback
public void checkGrantsPersisted() throws Exception {
OrcidProfile grantsProfileListing = getOrcidWithGrants();
OrcidSolrDocument grantsListing = solrDocWithFundingTitles();
orcidIndexManager.persistProfileInformationForIndexing(grantsProfileListing);
verify(solrDao).persist(eq(grantsListing));
}
Aggregations