use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.
the class ValidateV3_dev1SamplesTest method testMarshallEmployment.
@Test
public void testMarshallEmployment() throws JAXBException, SAXException, URISyntaxException {
Employment object = (Employment) unmarshallFromPath("/record_3.0_dev1/samples/read_samples/employment-3.0_dev1.xml", Employment.class);
marshall(object, "/record_3.0_dev1/employment-3.0_dev1.xsd");
object = (Employment) unmarshallFromPath("/record_3.0_dev1/samples/write_samples/employment-3.0_dev1.xml", Employment.class);
marshall(object, "/record_3.0_dev1/employment-3.0_dev1.xsd");
}
use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_StartAndEndDateNullTest.
@Test
public void affiliationsCreateDateSortString_StartAndEndDateNullTest() {
Affiliation aff = new Employment();
aff.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(0)));
String dateSortString = PojoUtil.createDateSortString(aff);
assertNotNull(dateSortString);
assertThat(dateSortString, anyOf(is("Z-1969-12-31"), is("Z-1970-1-1")));
}
use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_NullStartYearNullEndYearTest.
@Test
public void affiliationsCreateDateSortString_NullStartYearNullEndYearTest() {
Affiliation aff = new Employment();
FuzzyDate start = new FuzzyDate();
FuzzyDate end = new FuzzyDate();
start.setDay(new Day(1));
start.setMonth(new Month(2));
end.setDay(new Day(3));
end.setMonth(new Month(4));
aff.setStartDate(start);
aff.setEndDate(end);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("X-NaN-04-03-NaN-02-01", dateSortString);
}
use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_NullEndYearTest.
@Test
public void affiliationsCreateDateSortString_NullEndYearTest() {
Affiliation aff = new Employment();
FuzzyDate end = new FuzzyDate();
end.setDay(new Day(1));
end.setMonth(new Month(2));
aff.setEndDate(end);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("X-NaN-02-01", dateSortString);
}
use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_StartDateAndEndDate_NullMonthNullDayTest.
@Test
public void affiliationsCreateDateSortString_StartDateAndEndDate_NullMonthNullDayTest() {
Affiliation aff = new Employment();
FuzzyDate start = new FuzzyDate();
FuzzyDate end = new FuzzyDate();
start.setYear(new Year(1970));
end.setYear(new Year(2017));
aff.setStartDate(start);
aff.setEndDate(end);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("X-2017-00-00-1970-00-00", dateSortString);
}
Aggregations