use of org.orcid.jaxb.model.v3.dev1.common.FuzzyDate in project ORCID-Source by ORCID.
the class WorksPaginatorTest method getPublicWorkGroup.
private WorkGroup getPublicWorkGroup(int i) {
WorkGroup workGroup = new WorkGroup();
workGroup.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
for (int x = 0; x < 10; x++) {
WorkSummary workSummary = new WorkSummary();
workSummary.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis())));
workSummary.setPublicationDate(new PublicationDate(new FuzzyDate(new Year(2017), new Month(x), new Day(x))));
workSummary.setTitle(getTitle(i));
workSummary.setVisibility(Visibility.PUBLIC);
workSummary.setDisplayIndex(Integer.toString(x));
workSummary.setPutCode(Long.valueOf(new StringBuilder(i).append(x).toString()));
workSummary.setSource(getSource());
workSummary.setType(WorkType.EDITED_BOOK);
workGroup.getWorkSummary().add(workSummary);
}
return workGroup;
}
use of org.orcid.jaxb.model.v3.dev1.common.FuzzyDate in project ORCID-Source by ORCID.
the class JSONInputValidatorTest method testValidateJSONInputForValidV3PeerReview.
@Test
public void testValidateJSONInputForValidV3PeerReview() throws JAXBException, SAXException, IOException {
PeerReview peerReview = org.orcid.test.helper.v3.Utils.getPeerReview();
peerReview.setCompletionDate(new FuzzyDate(new Year(2017), new Month(1), new Day(1)));
validator.validateJSONInput(peerReview);
}
use of org.orcid.jaxb.model.v3.dev1.common.FuzzyDate in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_StartDateOnlyTest.
@Test
public void affiliationsCreateDateSortString_StartDateOnlyTest() {
Affiliation aff = new Employment();
FuzzyDate start = new FuzzyDate();
start.setDay(new Day(1));
start.setMonth(new Month(2));
start.setYear(new Year(3));
aff.setStartDate(start);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("Y-3-02-01", dateSortString);
}
use of org.orcid.jaxb.model.v3.dev1.common.FuzzyDate in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_EndDateOnlyTest.
@Test
public void affiliationsCreateDateSortString_EndDateOnlyTest() {
Affiliation aff = new Employment();
FuzzyDate end = new FuzzyDate();
end.setDay(new Day(1));
end.setMonth(new Month(2));
end.setYear(new Year(3));
aff.setEndDate(end);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("X-3-02-01", dateSortString);
}
use of org.orcid.jaxb.model.v3.dev1.common.FuzzyDate in project ORCID-Source by ORCID.
the class PojoUtilTest method affiliationsCreateDateSortString_StartDate_NullMonthNullDayTest.
@Test
public void affiliationsCreateDateSortString_StartDate_NullMonthNullDayTest() {
Affiliation aff = new Employment();
FuzzyDate start = new FuzzyDate();
start.setYear(new Year(2017));
aff.setStartDate(start);
String dateSortString = PojoUtil.createDateSortString(aff);
assertEquals("Y-2017-00-00", dateSortString);
}
Aggregations