use of org.orcid.jaxb.model.record_rc1.Work in project ORCID-Source by ORCID.
the class BibtexManagerTest method testGenerateBibtexForSingleWorkFromCitationField.
@Test
public void testGenerateBibtexForSingleWorkFromCitationField() {
Work w = new Work();
Citation c = new Citation();
c.setWorkCitationType(CitationType.BIBTEX);
c.setCitation("HELLO");
w.setWorkCitation(c);
String bib = bibtexManager.generateBibtex(ORCID, w);
Assert.assertEquals("HELLO", bib);
}
use of org.orcid.jaxb.model.record_rc1.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyCountryTest.
@Test(expected = ActivityTypeValidationException.class)
public void validateWork_emptyCountryTest() {
Work work = getWork();
work.getCountry().setValue((Iso3166Country) null);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc1.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyContributorCreditNameTest.
@Test(expected = OrcidValidationException.class)
public void validateWork_emptyContributorCreditNameTest() {
Work work = getWork();
work.getWorkContributors().getContributor().get(0).getCreditName().setContent("");
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc1.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_invalidCitationTypeTest.
@Test(expected = ActivityTypeValidationException.class)
public void validateWork_invalidCitationTypeTest() {
Work work = getWork();
work.getWorkCitation().setWorkCitationType(null);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc1.Work in project ORCID-Source by ORCID.
the class BlackBoxBaseRC2 method unmarshallFromPath.
public Object unmarshallFromPath(String path, Class<?> type) {
try (Reader reader = new InputStreamReader(getClass().getResourceAsStream(path))) {
Object obj = unmarshall(reader, type);
Object result = null;
if (Address.class.equals(type)) {
result = (Address) obj;
} else if (Education.class.equals(type)) {
result = (Education) obj;
} else if (Employment.class.equals(type)) {
result = (Employment) obj;
} else if (Funding.class.equals(type)) {
result = (Funding) obj;
} else if (Keyword.class.equals(type)) {
result = (Keyword) obj;
} else if (Work.class.equals(type)) {
result = (Work) obj;
} else if (PeerReview.class.equals(type)) {
result = (PeerReview) obj;
} else if (ResearcherUrl.class.equals(type)) {
result = (ResearcherUrl) obj;
} else if (PersonalDetails.class.equals(type)) {
result = (PersonalDetails) obj;
} else if (OtherName.class.equals(type)) {
result = (OtherName) obj;
} else if (PersonExternalIdentifier.class.equals(type)) {
result = (PersonExternalIdentifier) obj;
}
return result;
} catch (IOException e) {
throw new RuntimeException("Error reading notification from classpath", e);
}
}
Aggregations