Project

General

Profile

Revision b4be3c3e

IDb4be3c3e9363207590c280ab95eeec24c8e8b0bd
Parent 208ded38
Child 13621704, 08183f99

Added by Andreas Kohlbecker over 2 years ago

ref #7874 adding missing testcase related to Person nomenclatural title genration

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/AgentServiceImplTest.java
194 194

  
195 195
        Person turland = (Person) service.load(UUID.fromString("a598ab3f-b33b-4b4b-b237-d616fcb6b5b1"));
196 196
        Person monro = (Person) service.load(UUID.fromString("e7206bc5-61ab-468e-a9f5-dec118b46b7f"));
197
        // TODO Add Assertion Person "Ehrenberg" must not be member of a team.
198
        Person ehrenberg = (Person) service.load(UUID.fromString("6363ae88-ec57-4b23-8235-6c86fbe59446"));
199

  
197 200

  
198 201
        Team turland_monro_protected = (Team) service.load(UUID.fromString("5bff55de-f7cc-44d9-baac-908f52ad0cb8"));
199 202
        Team turland_monro = (Team) service.load(UUID.fromString("30ca93d6-b543-4bb9-b6ff-e9ededa65af7"));
......
201 204

  
202 205
        // Person has no flag for protecting the nomenclaturalTitle
203 206
        assertNull(nomenclaturalTitleField.get(turland));
207
        assertNull(nomenclaturalTitleField.get(ehrenberg));
208
        assertTrue(ehrenberg.isProtectedTitleCache());
204 209
        assertEquals("A.M. Monro", nomenclaturalTitleField.get(monro).toString());
205 210

  
206 211
        // Team has a flag for protectedNomenclaturalTitle flag
......
217 222
        turland_monro = (Team) service.load(UUID.fromString("30ca93d6-b543-4bb9-b6ff-e9ededa65af7"));
218 223

  
219 224
        assertEquals("Expecting nomenclaturalTitle to be set since it was NULL", "Turland, N.J.", nomenclaturalTitleField.get(turland));
225
        assertEquals("Expecting nomenclaturalTitle to be set since it was NULL", "Ehrenberg, C.G.", nomenclaturalTitleField.get(ehrenberg));
226
        assertEquals("Expecting titleChache to be unchaged since it was protecetd", "Ehrenb.", ehrenberg.getTitleCache());
220 227
        assertEquals("Expecting nomenclaturalTitle to be unchanged", "A.M. Monro", nomenclaturalTitleField.get(monro).toString());
221 228

  
222 229
        assertEquals("Turland, Monro", nomenclaturalTitleField.get(turland_monro_protected));
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/AgentServiceImplTest.testUpdateTitleCache.xml
5 5
  <AGENTBASE DTYPE="Team" ID="3" CREATED="2009-03-12 11:24:58.0" UUID="5bff55de-f7cc-44d9-baac-908f52ad0cb8" TITLECACHE="Turland, N.J., A.M. Monro"  PROTECTEDTITLECACHE="true" NOMENCLATURALTITLE="Turland, Monro" PROTECTEDNOMENCLATURALTITLECACHE="true" LIFESPAN_END="00000000" LIFESPAN_START="00000000" PROTECTEDCOLLECTORTITLECACHE="FALSE" HASMOREMEMBERS="FALSE"/>
6 6
  <AGENTBASE DTYPE="Team" ID="4" CREATED="2009-03-12 11:24:58.0" UUID="30ca93d6-b543-4bb9-b6ff-e9ededa65af7" TITLECACHE="Turland, N.J., Monro, A.M." PROTECTEDTITLECACHE="true" NOMENCLATURALTITLE="--to be updated--"         PROTECTEDNOMENCLATURALTITLECACHE="false" LIFESPAN_END="00000000" LIFESPAN_START="00000000" PROTECTEDCOLLECTORTITLECACHE="FALSE" HASMOREMEMBERS="FALSE"/>
7 7
  <AGENTBASE DTYPE="Team" ID="5" CREATED="2009-03-12 11:24:58.0" UUID="a4ca0d37-d78b-4bcc-875e-d4ea5a031089" TITLECACHE="Turland, N.J., Monro, A.M." PROTECTEDTITLECACHE="true"                                                PROTECTEDNOMENCLATURALTITLECACHE="false" LIFESPAN_END="00000000" LIFESPAN_START="00000000" PROTECTEDCOLLECTORTITLECACHE="FALSE" HASMOREMEMBERS="FALSE"/>
8
  <AGENTBASE DTYPE="Person" ID="6" CREATED="2009-03-12 11:24:58.0" UUID="6363ae88-ec57-4b23-8235-6c86fbe59446" TITLECACHE="Ehrenb." PROTECTEDTITLECACHE="true"                               FAMILYNAME="Ehrenberg" INITIALS="C.G." LIFESPAN_END="00000000" PROTECTEDCOLLECTORTITLECACHE="FALSE" LIFESPAN_START="00000000"/>
8 9
  <AGENTBASE_AGENTBASE TEAM_ID="3" TEAMMEMBERS_ID="1" SORTINDEX="0"/>
9 10
  <AGENTBASE_AGENTBASE TEAM_ID="3" TEAMMEMBERS_ID="2" SORTINDEX="1"/>
10 11
  <AGENTBASE_AGENTBASE TEAM_ID="4" TEAMMEMBERS_ID="1" SORTINDEX="0"/>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)