Search in sources :

Example 86 with ActivitiesSummary

use of org.orcid.jaxb.model.record.summary_rc1.ActivitiesSummary in project ORCID-Source by ORCID.

the class ValidateV2RC4SamplesTest method testmarshallActivities.

@Test
public void testmarshallActivities() throws JAXBException, SAXException, URISyntaxException {
    ActivitiesSummary object = (ActivitiesSummary) unmarshallFromPath("/record_2.0_rc4/samples/activities-2.0_rc4.xml", ActivitiesSummary.class);
    marshall(object, "/record_2.0_rc4/activities-2.0_rc4.xsd");
}
Also used : ActivitiesSummary(org.orcid.jaxb.model.record.summary_rc4.ActivitiesSummary) Test(org.junit.Test)

Example 87 with ActivitiesSummary

use of org.orcid.jaxb.model.record.summary_rc1.ActivitiesSummary in project ORCID-Source by ORCID.

the class ValidateV2RC4Identifiers method testRecord.

@Test
public void testRecord() {
    Record record = unmarshallFromPath("/record_2.0_rc4/samples/record-2.0_rc4.xml", Record.class);
    ActivitiesSummary as = record.getActivitiesSummary();
    ExternalIDs fundingIDs = as.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getExternalIdentifiers();
    ExternalIDs fundingIDs2 = as.getFundings().getFundingGroup().get(0).getIdentifiers();
    assertEquals("grant_number", fundingIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", fundingIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), fundingIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, fundingIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getType(), fundingIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getValue(), fundingIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs workIDs = as.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getExternalIdentifiers();
    ExternalIDs workIDs2 = as.getWorks().getWorkGroup().get(0).getIdentifiers();
    assertEquals("agr", workIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", workIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), workIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, workIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(workIDs.getExternalIdentifier().get(0).getType(), workIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(workIDs.getExternalIdentifier().get(0).getValue(), workIDs2.getExternalIdentifier().get(0).getValue());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_rc4.ExternalIDs) Record(org.orcid.jaxb.model.record_rc4.Record) Url(org.orcid.jaxb.model.common_rc4.Url) ActivitiesSummary(org.orcid.jaxb.model.record.summary_rc4.ActivitiesSummary) MarshallingTest(org.orcid.jaxb.model.notification.custom.MarshallingTest) Test(org.junit.Test)

Example 88 with ActivitiesSummary

use of org.orcid.jaxb.model.record.summary_rc1.ActivitiesSummary in project ORCID-Source by ORCID.

the class ValidateV2RC3SamplesTest method testmarshallActivities.

@Test
public void testmarshallActivities() throws JAXBException, SAXException, URISyntaxException {
    ActivitiesSummary object = (ActivitiesSummary) unmarshallFromPath("/record_2.0_rc3/samples/activities-2.0_rc3.xml", ActivitiesSummary.class);
    marshall(object, "/record_2.0_rc3/activities-2.0_rc3.xsd");
}
Also used : ActivitiesSummary(org.orcid.jaxb.model.record.summary_rc3.ActivitiesSummary) Test(org.junit.Test)

Example 89 with ActivitiesSummary

use of org.orcid.jaxb.model.record.summary_rc1.ActivitiesSummary in project ORCID-Source by ORCID.

the class ValidateV2IdentifiersTest method testActivities.

@Test
public void testActivities() {
    ActivitiesSummary as = unmarshallFromPath("/record_2.0/samples/read_samples/activities-2.0.xml", ActivitiesSummary.class);
    ExternalIDs fundingIDs = as.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getExternalIdentifiers();
    ExternalIDs fundingIDs2 = as.getFundings().getFundingGroup().get(0).getIdentifiers();
    assertEquals("grant_number", fundingIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", fundingIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), fundingIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, fundingIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getType(), fundingIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getValue(), fundingIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs peerIDs = as.getPeerReviews().getPeerReviewGroup().get(0).getPeerReviewSummary().get(0).getExternalIdentifiers();
    ExternalIDs peerIDs2 = as.getPeerReviews().getPeerReviewGroup().get(0).getIdentifiers();
    assertEquals("something", peerIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", peerIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://orcid.org"), peerIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, peerIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(peerIDs.getExternalIdentifier().get(0).getType(), peerIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(peerIDs.getExternalIdentifier().get(0).getValue(), peerIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs workIDs = as.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getExternalIdentifiers();
    ExternalIDs workIDs2 = as.getWorks().getWorkGroup().get(0).getIdentifiers();
    assertEquals("agr", workIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", workIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://orcid.org"), workIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, workIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(workIDs.getExternalIdentifier().get(0).getType(), workIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(workIDs.getExternalIdentifier().get(0).getValue(), workIDs2.getExternalIdentifier().get(0).getValue());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) Url(org.orcid.jaxb.model.common_v2.Url) ActivitiesSummary(org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary) MarshallingTest(org.orcid.jaxb.model.notification.custom.MarshallingTest) Test(org.junit.Test)

Example 90 with ActivitiesSummary

use of org.orcid.jaxb.model.record.summary_rc1.ActivitiesSummary in project ORCID-Source by ORCID.

the class ValidateV2IdentifiersTest method testRecord.

@Test
public void testRecord() {
    Record record = unmarshallFromPath("/record_2.0/samples/read_samples/record-2.0.xml", Record.class);
    ActivitiesSummary as = record.getActivitiesSummary();
    ExternalIDs fundingIDs = as.getFundings().getFundingGroup().get(0).getFundingSummary().get(0).getExternalIdentifiers();
    ExternalIDs fundingIDs2 = as.getFundings().getFundingGroup().get(0).getIdentifiers();
    assertEquals("grant_number", fundingIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", fundingIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), fundingIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, fundingIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getType(), fundingIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(fundingIDs.getExternalIdentifier().get(0).getValue(), fundingIDs2.getExternalIdentifier().get(0).getValue());
    ExternalIDs workIDs = as.getWorks().getWorkGroup().get(0).getWorkSummary().get(0).getExternalIdentifiers();
    ExternalIDs workIDs2 = as.getWorks().getWorkGroup().get(0).getIdentifiers();
    assertEquals("agr", workIDs.getExternalIdentifier().get(0).getType());
    assertEquals("external-id-value", workIDs.getExternalIdentifier().get(0).getValue());
    assertEquals(new Url("http://tempuri.org"), workIDs.getExternalIdentifier().get(0).getUrl());
    assertEquals(Relationship.SELF, workIDs.getExternalIdentifier().get(0).getRelationship());
    assertEquals(workIDs.getExternalIdentifier().get(0).getType(), workIDs2.getExternalIdentifier().get(0).getType());
    assertEquals(workIDs.getExternalIdentifier().get(0).getValue(), workIDs2.getExternalIdentifier().get(0).getValue());
}
Also used : ExternalIDs(org.orcid.jaxb.model.record_v2.ExternalIDs) Record(org.orcid.jaxb.model.record_v2.Record) Url(org.orcid.jaxb.model.common_v2.Url) ActivitiesSummary(org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary) MarshallingTest(org.orcid.jaxb.model.notification.custom.MarshallingTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)107 ActivitiesSummary (org.orcid.jaxb.model.record.summary_v2.ActivitiesSummary)90 WorkSummary (org.orcid.jaxb.model.record.summary_v2.WorkSummary)47 EducationSummary (org.orcid.jaxb.model.record.summary_v2.EducationSummary)40 EmploymentSummary (org.orcid.jaxb.model.record.summary_v2.EmploymentSummary)40 FundingSummary (org.orcid.jaxb.model.record.summary_v2.FundingSummary)39 PeerReviewSummary (org.orcid.jaxb.model.record.summary_v2.PeerReviewSummary)37 Record (org.orcid.jaxb.model.record_v2.Record)25 DBUnitTest (org.orcid.test.DBUnitTest)23 Person (org.orcid.jaxb.model.record_v2.Person)20 ClientResponse (com.sun.jersey.api.client.ClientResponse)18 Response (javax.ws.rs.core.Response)18 Address (org.orcid.jaxb.model.record_v2.Address)16 Email (org.orcid.jaxb.model.record_v2.Email)16 Keyword (org.orcid.jaxb.model.record_v2.Keyword)16 PersonExternalIdentifier (org.orcid.jaxb.model.record_v2.PersonExternalIdentifier)16 ResearcherUrl (org.orcid.jaxb.model.record_v2.ResearcherUrl)16 WorkGroup (org.orcid.jaxb.model.record.summary_v2.WorkGroup)14 Name (org.orcid.jaxb.model.record_v2.Name)14 OtherName (org.orcid.jaxb.model.record_v2.OtherName)14