Project

General

Profile

« Previous | Next » 

Revision 6d4b8d16

Added by Andreas Müller about 13 years ago

implemented parsing and new handling for "unranked" ranks #2141

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategyTest.java
137 137

  
138 138
		//unranked taxa
139 139
		String unrankedCache;
140
		BotanicalName unrankedName = BotanicalName.NewInstance(Rank.UNRANKED());
140
		BotanicalName unrankedName = BotanicalName.NewInstance(Rank.INFRASPECIFICTAXON());
141 141
		unrankedName.setGenusOrUninomial("Genus");
142 142
		NonViralNameDefaultCacheStrategy<BotanicalName> strategy = NonViralNameDefaultCacheStrategy.NewInstance();
143 143
			//infraspecific
......
145 145
		unrankedName.setSpecificEpithet("species");
146 146
		unrankedCache = strategy.getNameCache(unrankedName);
147 147
		
148
		Assert.assertEquals("Correct unranked cache expected", "Genus species [unranked] infraspecific", unrankedCache);
148
		Assert.assertEquals("Correct unranked cache expected", "Genus species [infraspec.] infraspecific", unrankedCache);
149 149
		
150 150
			//infrageneric
151
		unrankedName.setRank(Rank.INFRAGENERICTAXON());
151 152
		unrankedName.setInfraSpecificEpithet(null);
152 153
		unrankedName.setSpecificEpithet(null);
153 154
		unrankedName.setInfraGenericEpithet("Infrageneric");
154 155
		unrankedCache = strategy.getNameCache(unrankedName);
155
		Assert.assertEquals("Correct unranked cache expected", "Genus [unranked] Infrageneric", unrankedCache);
156
		Assert.assertEquals("Correct unranked cache expected", "Genus [infragen.] Infrageneric", unrankedCache);
156 157
		
157 158
		
158 159
	}
......
173 174
		assertEquals("Name cache should be Lepidocaryum (Infralepi) tenue var. tenue", "Lepidocaryum (Infralepi) tenue var. tenue", botName.getNameCache());
174 175
		
175 176
		botName.setInfraGenericEpithet(" ");
177
		//Note: This test may fail if aspectj doesn't work correctly
176 178
		assertEquals("Empty infrageneric epithet must be neglegted", "Lepidocaryum tenue var. tenue", botName.getNameCache());
177 179
	}
178 180

  
......
197 199
		String atomizedAuthorCache = strategy.getBasionymStart()+ basAuthor.getNomenclaturalTitle()+strategy.getBasionymEnd()+strategy.getBasionymAuthorCombinationAuthorSeperator()+exAuthor.getNomenclaturalTitle();
198 200
		assertEquals(atomizedAuthorCache, speciesName.getAuthorshipCache());
199 201
		String atomizedTitleCache = speciesNameString + " "+ strategy.getBasionymStart()+ basAuthor.getNomenclaturalTitle()+strategy.getBasionymEnd()+strategy.getBasionymAuthorCombinationAuthorSeperator()+exAuthor.getNomenclaturalTitle();
202
		//Note: This test may fail if aspectj doesn't work correctly
200 203
		assertEquals(atomizedTitleCache, speciesName.getTitleCache());
201 204
		assertEquals(atomizedTitleCache, speciesName.getFullTitleCache());	
202 205
	}
......
211 214
		Assert.assertEquals("Should be Abies alba L.", "Abies alba L.", speciesName.getTitleCache());
212 215
		
213 216
		speciesName.setBinomHybrid(true);
217
		//Note: This test may fail if aspectj doesn't work correctly
214 218
		Assert.assertEquals("Should be Abies ?alba L.", "Abies ?alba L.", speciesName.getTitleCache());
215 219
		speciesName.setMonomHybrid(true);
216 220
		Assert.assertEquals("Should be '?Abies ?alba L.'", "?Abies ?alba L.", speciesName.getTitleCache());

Also available in: Unified diff