Search in sources :

Example 61 with Title

use of org.orcid.jaxb.model.v3.dev1.common.Title in project ORCID-Source by ORCID.

the class ActivityUtilsTest method getEmptyWork.

private Work getEmptyWork() {
    Work w = new Work();
    // Title
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title(""));
    title.setSubtitle(new Subtitle(""));
    title.setTranslatedTitle(new TranslatedTitle(""));
    w.setWorkTitle(title);
    // Citation
    w.setWorkCitation(new Citation());
    WorkContributors wc = new WorkContributors();
    // Contributors
    Contributor c = new Contributor();
    c.setCreditName(new CreditName(""));
    wc.getContributor().add(c);
    w.setWorkContributors(wc);
    return w;
}
Also used : Subtitle(org.orcid.jaxb.model.v3.dev1.common.Subtitle) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) WorkContributors(org.orcid.jaxb.model.v3.dev1.record.WorkContributors) Work(org.orcid.jaxb.model.v3.dev1.record.Work) CreditName(org.orcid.jaxb.model.v3.dev1.common.CreditName) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) Title(org.orcid.jaxb.model.v3.dev1.common.Title) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) FundingContributor(org.orcid.jaxb.model.v3.dev1.record.FundingContributor) Contributor(org.orcid.jaxb.model.v3.dev1.common.Contributor) Citation(org.orcid.jaxb.model.v3.dev1.record.Citation)

Example 62 with Title

use of org.orcid.jaxb.model.v3.dev1.common.Title in project ORCID-Source by ORCID.

the class ActivityUtilsTest method getEmptyWorkSummary.

private WorkSummary getEmptyWorkSummary() {
    WorkSummary s = new WorkSummary();
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title(""));
    title.setSubtitle(new Subtitle(""));
    title.setTranslatedTitle(new TranslatedTitle(""));
    s.setTitle(title);
    return s;
}
Also used : Subtitle(org.orcid.jaxb.model.v3.dev1.common.Subtitle) WorkSummary(org.orcid.jaxb.model.v3.dev1.record.summary.WorkSummary) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle) TranslatedTitle(org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle) Title(org.orcid.jaxb.model.v3.dev1.common.Title) WorkTitle(org.orcid.jaxb.model.v3.dev1.record.WorkTitle)

Example 63 with Title

use of org.orcid.jaxb.model.v3.dev1.common.Title in project ORCID-Source by ORCID.

the class JpaJaxbMembershipAdapterTest method testToOrgAffiliationRelationEntity.

@Test
public void testToOrgAffiliationRelationEntity() throws JAXBException {
    Membership e = getMembership();
    assertNotNull(e);
    OrgAffiliationRelationEntity oar = adapter.toOrgAffiliationRelationEntity(e);
    assertNotNull(oar);
    // General info
    assertEquals(Long.valueOf(0), oar.getId());
    assertEquals(Visibility.PRIVATE.value(), oar.getVisibility().value());
    assertEquals("department-name", oar.getDepartment());
    assertEquals("role-title", oar.getTitle());
    // Dates
    assertEquals(Integer.valueOf(2), oar.getStartDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getStartDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getStartDate().getYear());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getEndDate().getYear());
    // Source
    assertNull(oar.getSourceId());
    assertNull(oar.getClientSourceId());
    assertNull(oar.getElementSourceId());
}
Also used : Membership(org.orcid.jaxb.model.v3.dev1.record.Membership) OrgAffiliationRelationEntity(org.orcid.persistence.jpa.entities.OrgAffiliationRelationEntity) Test(org.junit.Test)

Example 64 with Title

use of org.orcid.jaxb.model.v3.dev1.common.Title in project ORCID-Source by ORCID.

the class JpaJaxbDistinctionAdapterTest method testToOrgAffiliationRelationEntity.

@Test
public void testToOrgAffiliationRelationEntity() throws JAXBException {
    Distinction e = getDistinction();
    assertNotNull(e);
    OrgAffiliationRelationEntity oar = adapter.toOrgAffiliationRelationEntity(e);
    assertNotNull(oar);
    // General info
    assertEquals(Long.valueOf(0), oar.getId());
    assertEquals(Visibility.PRIVATE.value(), oar.getVisibility().value());
    assertEquals("department-name", oar.getDepartment());
    assertEquals("role-title", oar.getTitle());
    // Dates
    assertEquals(Integer.valueOf(2), oar.getStartDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getStartDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getStartDate().getYear());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getEndDate().getYear());
    // Source
    assertNull(oar.getSourceId());
    assertNull(oar.getClientSourceId());
    assertNull(oar.getElementSourceId());
}
Also used : OrgAffiliationRelationEntity(org.orcid.persistence.jpa.entities.OrgAffiliationRelationEntity) Distinction(org.orcid.jaxb.model.v3.dev1.record.Distinction) Test(org.junit.Test)

Example 65 with Title

use of org.orcid.jaxb.model.v3.dev1.common.Title in project ORCID-Source by ORCID.

the class JpaJaxbEducationAdapterTest method testToOrgAffiliationRelationEntity.

@Test
public void testToOrgAffiliationRelationEntity() throws JAXBException {
    Education e = getEducation(true);
    assertNotNull(e);
    OrgAffiliationRelationEntity oar = jpaJaxbEducationAdapter.toOrgAffiliationRelationEntity(e);
    assertNotNull(oar);
    // General info
    assertEquals(Long.valueOf(0), oar.getId());
    assertEquals(Visibility.PRIVATE.value(), oar.getVisibility().value());
    assertEquals("education:department-name", oar.getDepartment());
    assertEquals("education:role-title", oar.getTitle());
    // Dates
    assertEquals(Integer.valueOf(2), oar.getStartDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getStartDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getStartDate().getYear());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getDay());
    assertEquals(Integer.valueOf(2), oar.getEndDate().getMonth());
    assertEquals(Integer.valueOf(1848), oar.getEndDate().getYear());
    // Source
    assertNull(oar.getSourceId());
    assertNull(oar.getClientSourceId());
    assertNull(oar.getElementSourceId());
}
Also used : Education(org.orcid.jaxb.model.v3.dev1.record.Education) OrgAffiliationRelationEntity(org.orcid.persistence.jpa.entities.OrgAffiliationRelationEntity) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)81 Title (org.orcid.jaxb.model.v3.dev1.common.Title)44 Work (org.orcid.jaxb.model.v3.dev1.record.Work)43 WorkTitle (org.orcid.jaxb.model.v3.dev1.record.WorkTitle)40 ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)38 Url (org.orcid.jaxb.model.v3.dev1.common.Url)33 DBUnitTest (org.orcid.test.DBUnitTest)29 ExternalIDs (org.orcid.jaxb.model.v3.dev1.record.ExternalIDs)27 ClientResponse (com.sun.jersey.api.client.ClientResponse)26 Response (javax.ws.rs.core.Response)25 Funding (org.orcid.jaxb.model.v3.dev1.record.Funding)23 FundingTitle (org.orcid.jaxb.model.v3.dev1.record.FundingTitle)19 OrcidError (org.orcid.jaxb.model.v3.dev1.error.OrcidError)17 PeerReview (org.orcid.jaxb.model.v3.dev1.record.PeerReview)17 TranslatedTitle (org.orcid.jaxb.model.v3.dev1.common.TranslatedTitle)14 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)14 ArrayList (java.util.ArrayList)13 DisambiguatedOrganization (org.orcid.jaxb.model.v3.dev1.common.DisambiguatedOrganization)13 LastModifiedDate (org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate)13 Visibility (org.orcid.jaxb.model.v3.dev1.common.Visibility)13