Revision 06cfae86
Added by Katja Luther over 8 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TermServiceImplTest.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.cdm.model.common.TermType; |
33 | 33 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
34 | 34 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
35 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
|
35 | 36 |
import eu.etaxonomy.cdm.model.name.Rank; |
36 | 37 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; |
38 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
37 | 39 |
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest; |
38 | 40 |
|
39 | 41 |
/** |
... | ... | |
51 | 53 |
@SpringBeanByType |
52 | 54 |
private IVocabularyService vocabularyService; |
53 | 55 |
|
56 |
@SpringBeanByType |
|
57 |
private ITaxonService taxonService; |
|
58 |
|
|
54 | 59 |
/* ************************* TESTS *************************************************/ |
55 | 60 |
|
56 | 61 |
/** |
... | ... | |
190 | 195 |
|
191 | 196 |
|
192 | 197 |
@Test |
198 |
@Ignore |
|
193 | 199 |
public void testDeleteTerms(){ |
194 | 200 |
final String[] tableNames = new String[]{ |
195 | 201 |
"DefinedTermBase","Representation"}; |
... | ... | |
218 | 224 |
termBase = termService.load(termUUID); |
219 | 225 |
assertNull(termBase); |
220 | 226 |
|
227 |
|
|
228 |
//TermVocabulary<DefinedTerm> voc = TermVocabulary.NewInstance(TermType.Feature, "TestFeatures", null, null, null); |
|
229 |
voc.addTerm(DefinedTerm.NewDnaMarkerInstance("test", "marker", "t")); |
|
230 |
vocUUID = vocabularyService.save(voc).getUuid(); |
|
231 |
|
|
232 |
voc = vocabularyService.find(vocUUID); |
|
233 |
terms = voc.getTerms(); |
|
234 |
termBase =terms.iterator().next(); |
|
235 |
termUUID = termBase.getUuid(); |
|
236 |
termBase = termService.load(termUUID); |
|
237 |
BotanicalName testName = BotanicalName.NewInstance(Rank.SPECIES()); |
|
238 |
Taxon testTaxon = Taxon.NewInstance(testName,null); |
|
239 |
testTaxon.addIdentifier("Test", (DefinedTerm) termBase); |
|
240 |
taxonService.save(testTaxon); |
|
241 |
termService.delete(termBase, null); |
|
242 |
//commitAndStartNewTransaction(tableNames); |
|
243 |
termBase = termService.load(termUUID); |
|
244 |
assertNotNull(termBase); |
|
221 | 245 |
} |
222 | 246 |
|
223 | 247 |
/* (non-Javadoc) |
Also available in: Unified diff
fix #5104 and #5328