Project

General

Profile

« Previous | Next » 

Revision 71b9b632

Added by Andreas Müller almost 3 years ago

ref #4311 first implementation for TeamOrPersonBase.collectorTitle

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/PersonDefaultCacheStrategyTest.java
45 45
		person2.setFamilyName("P2FN");
46 46
		person2.setGivenName("P2GN");
47 47
		person2.setSuffix("P2Suff");
48
		person2.setCollectorTitle("P2CT");
48 49

  
49 50
		person3 = Person.NewInstance(); //empty person
50 51
	}
......
72 73
		Assert.assertEquals("Person3 title should start with Person#0", "Person#0", person3.getNomenclaturalTitle().substring(0, 8));
73 74
	}
74 75

  
76
   @Test
77
    public final void testGetCollectorTitleCache(){
78
        Assert.assertNotNull("person1 collector title cache must not to be null", person1.getCollectorTitleCache());
79
        Assert.assertEquals("Person1 collector title cache should be taken from titleCache", "P1FN, P.", person1.getCollectorTitleCache());
80
        person1.setSuffix(null);
81
        Assert.assertEquals("Person1 collector title cache should be taken from titleCache", "P1FN, P.", person1.getCollectorTitleCache());
82
        //peson2
83
        Assert.assertEquals("Person2 collector title cache should be P2CT", "P2CT", person2.getCollectorTitleCache());
84
        //person3
85
        Assert.assertNotNull("person3 collector title cache must not to be null", person3.getCollectorTitleCache());
86
        Assert.assertTrue("Person3 collector title cache must not be empty", StringUtils.isNotBlank(person3.getCollectorTitleCache()));
87
        //don't take to serious, may be also something different, but not empty
88
        Assert.assertEquals("Person3 title should start with Person#0", "Person#0", person3.getCollectorTitleCache().substring(0, 8));
89
    }
90

  
75 91
	@Test
76 92
	public final void testGetTitleCacheAdaptedFromOldVersion(){
77 93
	    Assert.assertNotNull("person1 title cache must not to be null", person1.getTitleCache());

Also available in: Unified diff