use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class ConvertVrc2ToVrc3Test method upgradeGroupIdToVrc3Test.
@Test
public void upgradeGroupIdToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(GroupIdRecords.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.groupid_rc3.GroupIdRecords.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc2Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-group-id-2.0_rc2.xml");
InputStream rc3Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-group-id-2.0_rc3.xml");
GroupIdRecords rc2Group = (GroupIdRecords) jaxbUnmarshaller.unmarshal(rc2Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.groupid_rc3.GroupIdRecords rc3GroupId1 = (org.orcid.jaxb.model.groupid_rc3.GroupIdRecords) jaxbUnmarshaller.unmarshal(rc3Stream);
V2Convertible result = versionConverterV2_0_rc2ToV2_0_rc3.upgrade(new V2Convertible(rc2Group, "v2_rc2"));
org.orcid.jaxb.model.groupid_rc3.GroupIdRecords rc3GroupId2 = (org.orcid.jaxb.model.groupid_rc3.GroupIdRecords) result.getObjectToConvert();
assertEquals(rc3GroupId1, rc3GroupId2);
}
use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class ConvertVrc2ToVrc3Test method upgradeWorksToVrc3Test.
@Test
public void upgradeWorksToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Works.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc3.Works.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc2Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-works-2.0_rc2.xml");
InputStream rc3Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-works-2.0_rc3.xml");
Works rc2Works = (Works) jaxbUnmarshaller.unmarshal(rc2Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc3.Works rc3Works1 = (org.orcid.jaxb.model.record.summary_rc3.Works) jaxbUnmarshaller.unmarshal(rc3Stream);
V2Convertible result = versionConverterV2_0_rc2ToV2_0_rc3.upgrade(new V2Convertible(rc2Works, "v2_rc2"));
org.orcid.jaxb.model.record.summary_rc3.Works rc3Works2 = (org.orcid.jaxb.model.record.summary_rc3.Works) result.getObjectToConvert();
assertEquals(rc3Works1, rc3Works2);
}
use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class ConvertVrc2ToVrc3Test method upgradeEmploymentsToVrc3Test.
@Test
public void upgradeEmploymentsToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Employments.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc3.Employments.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc2Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-employments-2.0_rc2.xml");
InputStream rc3Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-employments-2.0_rc3.xml");
Employments rc2Employments = (Employments) jaxbUnmarshaller.unmarshal(rc2Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc3.Employments rc3Employments1 = (org.orcid.jaxb.model.record.summary_rc3.Employments) jaxbUnmarshaller.unmarshal(rc3Stream);
V2Convertible result = versionConverterV2_0_rc2ToV2_0_rc3.upgrade(new V2Convertible(rc2Employments, "v2_rc2"));
org.orcid.jaxb.model.record.summary_rc3.Employments rc3Employments2 = (org.orcid.jaxb.model.record.summary_rc3.Employments) result.getObjectToConvert();
assertEquals(rc3Employments1, rc3Employments2);
}
use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class ConvertVrc2ToVrc3Test method upgradeEducationsToVrc3Test.
@Test
public void upgradeEducationsToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Educations.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc3.Educations.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc2Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc2.xml");
InputStream rc3Stream = ConvertVrc2ToVrc3Test.class.getClassLoader().getResourceAsStream("test-educations-2.0_rc3.xml");
Educations rc2Educations = (Educations) jaxbUnmarshaller.unmarshal(rc2Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc3.Educations rc3Educations1 = (org.orcid.jaxb.model.record.summary_rc3.Educations) jaxbUnmarshaller.unmarshal(rc3Stream);
V2Convertible result = versionConverterV2_0_rc2ToV2_0_rc3.upgrade(new V2Convertible(rc2Educations, "v2_rc2"));
org.orcid.jaxb.model.record.summary_rc3.Educations rc3Educations2 = (org.orcid.jaxb.model.record.summary_rc3.Educations) result.getObjectToConvert();
assertEquals(rc3Educations1, rc3Educations2);
}
use of org.orcid.core.version.V2Convertible in project ORCID-Source by ORCID.
the class ConvertVrc3ToVrc4Test method upgradeFundingsToVrc3Test.
@Test
public void upgradeFundingsToVrc3Test() throws JAXBException {
JAXBContext jaxbContext1 = JAXBContext.newInstance(Fundings.class);
JAXBContext jaxbContext2 = JAXBContext.newInstance(org.orcid.jaxb.model.record.summary_rc4.Fundings.class);
Unmarshaller jaxbUnmarshaller = jaxbContext1.createUnmarshaller();
InputStream rc3Stream = ConvertVrc3ToVrc4Test.class.getClassLoader().getResourceAsStream("test-fundings-2.0_rc3.xml");
InputStream rc4Stream = ConvertVrc3ToVrc4Test.class.getClassLoader().getResourceAsStream("test-fundings-2.0_rc4.xml");
Fundings rc4Fundings = (Fundings) jaxbUnmarshaller.unmarshal(rc3Stream);
jaxbUnmarshaller = jaxbContext2.createUnmarshaller();
org.orcid.jaxb.model.record.summary_rc4.Fundings rc4Fundings1 = (org.orcid.jaxb.model.record.summary_rc4.Fundings) jaxbUnmarshaller.unmarshal(rc4Stream);
V2Convertible result = versionConverterV2_0_rc3ToV2_0_rc4.upgrade(new V2Convertible(rc4Fundings, "v2_rc3"));
org.orcid.jaxb.model.record.summary_rc4.Fundings rc4Fundings2 = (org.orcid.jaxb.model.record.summary_rc4.Fundings) result.getObjectToConvert();
assertEquals(rc4Fundings1, rc4Fundings2);
}
Aggregations