Project

General

Profile

« Previous | Next » 

Revision ec1059aa

Added by Andreas Müller over 9 years ago

adapt tests to missing Reference.series #4293 and not null constraint for test database ddl #4382

View differences:

cdmlib-remote/src/test/java/eu/etaxonomy/cdm/remote/dto/assembler/lsid/AssemblerTest.java
84 84
    private IBook sec;
85 85
    private IBook book;
86 86
    private Reference<?> bookSection;
87
    private TeamOrPersonBase<?> authorTeam;
87
    private TeamOrPersonBase<?> authorship;
88 88
    private NonViralName<?> name;
89 89
    private LSID lsid;
90 90
    private TaxonDescription taxonDescription;
......
99 99
    public void setUp() throws Exception {
100 100
        lsid = new LSID("urn:lsid:example.org:taxonconcepts:1");
101 101

  
102
        authorTeam = Person.NewInstance();
103
        authorTeam.setTitleCache("authorTeam.titleCache", true);
104
        authorTeam.setLsid(new LSID("urn:lsid:dagg.org:agents:2"));
102
        authorship = Person.NewInstance();
103
        authorship.setTitleCache("authorTeam.titleCache", true);
104
        authorship.setLsid(new LSID("urn:lsid:dagg.org:agents:2"));
105 105

  
106 106
        name = BotanicalName.NewInstance(null);
107 107
        name.setNameCache("nameCache");
......
113 113
        name.setRank(Rank.SPECIES());
114 114

  
115 115
        sec = ReferenceFactory.newBook();
116
        sec.setAuthorship(authorTeam);
116
        sec.setAuthorship(authorship);
117 117
        sec.setTitleCache("sec.titleCache", true);
118 118
        sec.setLsid(new LSID("urn:lsid:example.org:references:1"));
119 119

  
......
154 154

  
155 155
        book = ReferenceFactory.newBook();
156 156
        book.setTitle("Book.title");
157
        book.setAuthorship(authorTeam);
157
        book.setAuthorship(authorship);
158 158
        book.setCreated(new DateTime(2004, 12, 25, 12, 0, 0, 0));
159 159
        book.setDatePublished(new TimePeriod(new Partial(DateTimeFieldType.year(), 1800)));
160 160
        book.setEdition("1st Edition");
......
172 172
        bookSection.setInReference((Reference<?>)book);
173 173
        bookSection.setPages("999 ff.");
174 174
        bookSection.setTitle("BookSection.title");
175
        bookSection.setAuthorship(authorTeam);
175
        bookSection.setAuthorship(authorship);
176 176
        bookSection.setCreated(new DateTime(2004, 12, 25, 12, 0, 0, 0));
177 177
        bookSection.setDatePublished(new TimePeriod(new Partial(DateTimeFieldType.year(), 1800)));
178 178
        bookSection.setReferenceAbstract("referenceAbstract");
179 179
        bookSection.setUri(new URI("http://persitent.books.foo/myBookSection"));
180 180
        bookSection.setUuid(UUID.randomUUID());
181
        bookSection.addCredit(Credit.NewInstance(authorTeam, "Credits to the authorTeam"));
181
        bookSection.addCredit(Credit.NewInstance(authorship, "Credits to the authorTeam"));
182 182
        bookSection.addSource(IdentifiableSource.NewDataImportInstance("http://persitent.IdentifiableSources.foo/2"));
183 183
    }
184 184

  
......
206 206
        assertEquals("CdmBase.created should be copied into BaseThing.created",new DateTime(2004, 12, 25, 12, 0, 0, 0),taxonConcept.getCreated());
207 207
        assertNotNull("TaxonBase.sec should be mapped into BaseThing.publishedInCitation",taxonConcept.getPublishedInCitation());
208 208
        assertEquals("TaxonBase.sec.titleCache should be mapped into BaseThing.publishedInCitation.title",sec.getTitleCache(),taxonConcept.getPublishedInCitation().getTitle());
209
        assertNotNull("TaxonBase.sec.authorTeam should be mapped into TaxonConcept.accordingTo",taxonConcept.getAccordingTo());
210
        assertEquals("TaxonBase.sec.authorTeam.titleCache should be mapped into TaxonConcept.accordingTo.title",authorTeam.getTitleCache(),taxonConcept.getAccordingTo().getTitle());
209
        assertNotNull("TaxonBase.sec.authorship should be mapped into TaxonConcept.accordingTo",taxonConcept.getAccordingTo());
210
        assertEquals("TaxonBase.sec.authorship.titleCache should be mapped into TaxonConcept.accordingTo.title",authorship.getTitleCache(),taxonConcept.getAccordingTo().getTitle());
211 211
        assertNotNull("TaxonBase.name should be mapped to TaxonConcept.hasName",taxonConcept.getHasName());
212 212
        assertEquals("NonViralName.nameCache should be mapped to TaxonName.nameComplete",name.getNameCache(),taxonConcept.getHasName().getNameComplete());
213 213
        assertNotNull("Taxon.relationsToThisTaxon should be copied into TaxonConcept.hasRelationship",taxonConcept.getHasRelationship());

Also available in: Unified diff