Project

General

Profile

« Previous | Next » 

Revision 6701ae84

Added by Andreas Müller about 4 years ago

fix #8881 Use pure last names (without initials) for in-references of taxon names

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/reference/DefaultReferenceCacheStrategyTest.java
33 33
import eu.etaxonomy.cdm.model.reference.IWebPage;
34 34
import eu.etaxonomy.cdm.model.reference.Reference;
35 35
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
36
import eu.etaxonomy.cdm.strategy.cache.agent.TeamDefaultCacheStrategy;
36 37
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
37 38

  
38 39
/**
......
318 319

  
319 320
    }
320 321

  
322
    //https://dev.e-taxonomy.eu/redmine/issues/8881
323
    @Test
324
    public void testInRefAuthor(){
325
        Person person1 = Person.NewInstance("Inauth.", "Inauthor", "A.B.", "Ala Bala");
326
        Person person2 = Person.NewInstance("Twoauth.", "Twoauthor", "C.", "Cla");
327
        Person person3 = Person.NewTitledInstance("Threeauth.");
328
        Team team = Team.NewInstance(person1, person2, person3);
329
        IBook book1 = ReferenceFactory.newBook();
330
        book1.setAbbrevTitle("Acta Inst. Bot. Acad. Sci. URSS");
331
        book1.setVolume("Fasc. 11");
332
        book1.setDatePublished(TimePeriodParser.parseStringVerbatim("1955"));
333
        bookSection1.setTitle("My chapter");
334
        bookSection1.setInBook(book1);
335
        book1.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(1956));
336

  
337
        book1.setAuthorship(person1);
338
        Assert.assertEquals("Unexpected nomencl. reference", "in Inauthor, Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
339
        book1.setAuthorship(team);
340
        Assert.assertEquals("Unexpected nomencl. reference", "in Inauthor, Twoauthor & Threeauth., Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
341
        team.setHasMoreMembers(true);
342
        Assert.assertEquals("Unexpected nomencl. reference", "in Inauthor, Twoauthor, Threeauth. & al., Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
343
        book1.setAuthorship(Team.NewInstance(person1));
344
        Assert.assertEquals("Unexpected nomencl. reference", "in Inauthor, Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
345

  
346
        //for the following the behavior is not yet finally discussed, may change in future
347
        book1.setAuthorship(team);
348
        team.setTitleCache("Teamcache", true);
349
        Assert.assertEquals("Unexpected nomencl. reference", "in Teamcache, Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
350
        team.setTitleCache("Teamc.", true);
351
        Assert.assertEquals("Unexpected nomencl. reference", "in Teamc., Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
352
        book1.setAuthorship(Team.NewInstance());
353
        Assert.assertEquals("Unexpected nomencl. reference", "in "+TeamDefaultCacheStrategy.EMPTY_TEAM+", Acta Inst. Bot. Acad. Sci. URSS Fasc. 11: 248. 1956", bookSection1.getNomenclaturalCitation("248"));
354

  
355
    }
321 356

  
322 357
    @Test
323 358
    public void testBookGetTitleCache1(){

Also available in: Unified diff