Revision e3a4a3ff
Added by Andreas Müller almost 7 years ago
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.model.agent.Person; |
28 | 28 |
import eu.etaxonomy.cdm.model.agent.Team; |
29 | 29 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
30 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
31 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
32 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
30 |
import eu.etaxonomy.cdm.model.name.IBotanicalName;
|
|
31 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
32 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
33 | 33 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
34 | 34 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
35 | 35 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
93 | 93 |
String taxonTitle = taxon.getTitleCache(); |
94 | 94 |
logger.info("Taxon : " + taxonTitle); |
95 | 95 |
|
96 |
TaxonNameBase name = taxon.getName();
|
|
96 |
TaxonName name = taxon.getName(); |
|
97 | 97 |
Assert.assertNotNull(name); |
98 | 98 |
|
99 | 99 |
String nameTitle = name.getTitleCache(); |
... | ... | |
141 | 141 |
public void testCDMEntitySaveLazyNew() { |
142 | 142 |
Team combAuthor = Team.NewInstance(); |
143 | 143 |
combAuthor.addTeamMember(Person.NewTitledInstance("test member")); |
144 |
BotanicalName name = TaxonNameFactory.NewBotanicalInstance(null, "Test1", null, null, null, null, null, null, null); |
|
144 |
IBotanicalName name = TaxonNameFactory.NewBotanicalInstance(null, "Test1", null, null, null, null, null, null, null);
|
|
145 | 145 |
name.setCombinationAuthorship(combAuthor); |
146 | 146 |
Taxon tax1 = Taxon.NewInstance(name, null); |
147 | 147 |
UUID taxonUuid1 = taxonService.save(tax1).getUuid(); |
148 | 148 |
|
149 | 149 |
Taxon taxon = (Taxon)taxonService.find(taxonUuid1); |
150 | 150 |
|
151 |
NonViralName nvn = CdmBase.deproxy(taxon.getName(),NonViralName.class);
|
|
151 |
INonViralName nvn = CdmBase.deproxy(taxon.getName());
|
|
152 | 152 |
String oldTitleCache = nvn.getTitleCache(); |
153 | 153 |
logger.info("Taxon Name Title : " + oldTitleCache); |
154 | 154 |
nvn.setTitleCache(oldTitleCache + ":updated",false); |
155 | 155 |
taxonService.update(taxon); |
156 | 156 |
|
157 | 157 |
Taxon taxonNew = (Taxon)taxonService.find(taxonUuid1); |
158 |
NonViralName nvnNew = CdmBase.deproxy(taxon.getName(),NonViralName.class);
|
|
158 |
INonViralName nvnNew = CdmBase.deproxy(taxon.getName());
|
|
159 | 159 |
logger.info("New Taxon Name Title : " + nvnNew.getTitleCache()); |
160 | 160 |
|
161 | 161 |
Assert.assertTrue("Title caches should not be equal",oldTitleCache.equals(nvnNew.getTitleCache())); |
... | ... | |
164 | 164 |
taxonService.update(taxon); |
165 | 165 |
|
166 | 166 |
Taxon taxonOld = (Taxon)taxonService.find(taxonUuid1); |
167 |
NonViralName nvnOld = CdmBase.deproxy(taxon.getName(),NonViralName.class);
|
|
167 |
INonViralName nvnOld = CdmBase.deproxy(taxon.getName());
|
|
168 | 168 |
logger.info("Old Taxon Name Title : " + nvnNew.getTitleCache()); |
169 | 169 |
|
170 |
Assert.assertEquals("Title caches should be equal",oldTitleCache,nvnOld.getTitleCache()); |
|
170 |
Assert.assertEquals("Title caches should be equal",oldTitleCache, nvnOld.getTitleCache());
|
|
171 | 171 |
} |
172 | 172 |
|
173 | 173 |
@Ignore |
Also available in: Unified diff
ref #6446 merge taxon name subclasses in TaxEditor