Revision e6d7b501
Added by Andreas Müller almost 7 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/name/BotanicalNameTest.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.cdm.model.agent.Team; |
27 | 27 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.DefaultTermInitializer; |
29 |
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
|
|
29 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
30 | 30 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
31 | 31 |
import eu.etaxonomy.cdm.test.unit.EntityTestBase; |
32 | 32 |
|
... | ... | |
34 | 34 |
public class BotanicalNameTest extends EntityTestBase{ |
35 | 35 |
private static final Logger logger = Logger.getLogger(BotanicalNameTest.class); |
36 | 36 |
|
37 |
private BotanicalName botanicalName1;
|
|
38 |
private BotanicalName botanicalName2; |
|
37 |
private TaxonNameBase botanicalName1;
|
|
38 |
private IBotanicalName botanicalName2;
|
|
39 | 39 |
|
40 | 40 |
@BeforeClass |
41 | 41 |
public static void setUpBeforeClass() { |
... | ... | |
45 | 45 |
|
46 | 46 |
@Before |
47 | 47 |
public void setUp() throws Exception { |
48 |
botanicalName1 = new BotanicalName();
|
|
49 |
botanicalName2 = new BotanicalName();
|
|
48 |
botanicalName1 = TaxonNameFactory.NewBotanicalInstance(null);
|
|
49 |
botanicalName2 = TaxonNameFactory.NewBotanicalInstance(null);
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
/****** TESTS *******************************/ |
... | ... | |
85 | 85 |
String specificEpithet = "specEpi"; |
86 | 86 |
String infraSpecificEpithet = "infraSpecificEpi"; |
87 | 87 |
TeamOrPersonBase<?> combinationAuthorship = Team.NewInstance(); |
88 |
INomenclaturalReference nomenclaturalReference = ReferenceFactory.newArticle();
|
|
88 |
Reference nomenclaturalReference = ReferenceFactory.newArticle(); |
|
89 | 89 |
String nomenclMicroRef = "microRef"; |
90 | 90 |
HomotypicalGroup homotypicalGroup = new HomotypicalGroup(); |
91 |
IBotanicalName fullName = new BotanicalName(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
|
|
91 |
IBotanicalName fullName = TaxonNameFactory.NewBotanicalInstance(rank, genusOrUninomial, infraGenericEpithet, specificEpithet, infraSpecificEpithet, combinationAuthorship, nomenclaturalReference, nomenclMicroRef, homotypicalGroup);
|
|
92 | 92 |
assertEquals(Rank.SPECIALFORM(), fullName.getRank()); |
93 | 93 |
assertEquals("Genus", fullName.getGenusOrUninomial()); |
94 | 94 |
assertEquals("infraGenericEpi", fullName.getInfraGenericEpithet()); |
... | ... | |
161 | 161 |
botanicalName1.setGenusOrUninomial("Aus"); |
162 | 162 |
botanicalName1.setRank(Rank.GENUS()); |
163 | 163 |
botanicalName1.setAnamorphic(true); |
164 |
BotanicalName clone = (BotanicalName)botanicalName1.clone();
|
|
164 |
TaxonNameBase clone = (TaxonNameBase)botanicalName1.clone();
|
|
165 | 165 |
Assert.assertEquals("Anamorphic should be equal", true, clone.isAnamorphic()); |
166 | 166 |
botanicalName1.setAnamorphic(false); |
167 |
clone = (BotanicalName)botanicalName1.clone();
|
|
167 |
clone = (TaxonNameBase)botanicalName1.clone();
|
|
168 | 168 |
Assert.assertEquals("Anamorphic should be equal", false, clone.isAnamorphic()); |
169 | 169 |
} |
170 | 170 |
|
171 | 171 |
@Test |
172 | 172 |
public void beanTests(){ |
173 | 173 |
// #5307 Test that BeanUtils does not fail |
174 |
BeanUtils.getPropertyDescriptors(BotanicalName.class); |
|
174 |
// BeanUtils.getPropertyDescriptors(BotanicalName.class);
|
|
175 | 175 |
BeanUtils.getPropertyDescriptors(TaxonNameBase.class); |
176 |
BeanUtils.getPropertyDescriptors(NonViralName.class); |
|
177 |
BeanUtils.getPropertyDescriptors(ZoologicalName.class); |
|
178 |
BeanUtils.getPropertyDescriptors(ViralName.class); |
|
179 |
BeanUtils.getPropertyDescriptors(CultivarPlantName.class); |
|
176 |
// BeanUtils.getPropertyDescriptors(NonViralName.class);
|
|
177 |
// BeanUtils.getPropertyDescriptors(ZoologicalName.class);
|
|
178 |
// BeanUtils.getPropertyDescriptors(ViralName.class);
|
|
179 |
// BeanUtils.getPropertyDescriptors(CultivarPlantName.class);
|
|
180 | 180 |
} |
181 | 181 |
} |
Also available in: Unified diff
ref #6368 remove TaxonNameBase subclasses