Project

General

Profile

« Previous | Next » 

Revision ca6a3e36

Added by Andreas Müller over 2 years ago

fix testMakeTaxonNodeAHeterotypicSynonymOfAnotherTaxonNode by handling result differently

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
454 454
        TaxonDeletionConfigurator conf = new TaxonDeletionConfigurator();
455 455
        conf.setDeleteSynonymsIfPossible(false);
456 456
        conf.setDeleteNameIfPossible(false);
457
        DeleteResult result = taxonService.isDeletable(oldTaxon.getUuid(), conf);
457
        DeleteResult taxonDeleteResult = taxonService.isDeletable(oldTaxon.getUuid(), conf);
458 458

  
459

  
460
        if (result.isOk()){
459
        DeleteResult result;
460
        if (taxonDeleteResult.isOk()){
461 461
        	 result = taxonService.deleteTaxon(oldTaxon.getUuid(), conf, classification.getUuid());
462 462
        }else{
463
        	result.setStatus(Status.OK);
464 463
        	TaxonNodeDeletionConfigurator config = new TaxonNodeDeletionConfigurator();
465 464
        	config.setDeleteElement(false);
466 465
        	conf.setTaxonNodeConfig(config);
467
        	result.includeResult(deleteTaxonNode(oldTaxonNode, conf));
466
        	result = deleteTaxonNode(oldTaxonNode, conf);
467
        	result.getRelatedObjects().addAll(taxonDeleteResult.getRelatedObjects());  //we want to know what causes that the taxon can not be deleted
468
        	result.getExceptions().addAll(taxonDeleteResult.getExceptions()); //same for the exceptions
468 469
        }
469 470

  
470 471
        result.addUpdatedObject(newAcceptedTaxon);

Also available in: Unified diff