Try to reinstall tests for MoveTaxonOperation (maybe not yet correct)
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 14 Nov 2016 09:57:18 +0000 (10:57 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 14 Nov 2016 09:57:18 +0000 (10:57 +0100)
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/MoveTaxonOperationTest.java

index f69dac0387c3584af40a501cbdd52e8b5189085e..0e61b15b17d8c0a219f9e1e1047542fc535e38a2 100644 (file)
@@ -65,9 +65,9 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTestBase {
        public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
                operation.execute(monitor, info);
                
-//             Assert.assertEquals(newParentTaxon ,taxon.getTaxonomicParent());
-//             Assert.assertEquals(taxon, newParentTaxon.getTaxonomicChildren().toArray(new Taxon[0])[0]);
-//             Assert.assertTrue(oldParentTaxon.getTaxonomicChildrenCount() == 0);
+               Assert.assertEquals(newParentTaxon ,taxon.getTaxonNodes().iterator().next().getParent().getTaxon());
+               Assert.assertEquals(taxon, newParentTaxon.getTaxonNodes().iterator().next().getChildNodes().iterator().next());
+               Assert.assertEquals(0, oldParentTaxon.getTaxonNodes().iterator().next().getChildNodes().size());
        }
 
 
@@ -82,6 +82,12 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTestBase {
 //             Assert.assertEquals(oldParentTaxon ,taxon.getTaxonomicParent());
 //             Assert.assertTrue(newParentTaxon.getTaxonomicChildren().size() == 0);
 //             Assert.assertEquals(taxon, oldParentTaxon.getTaxonomicChildren().toArray(new Taxon[0])[0]);
+
+               Assert.assertEquals(newParentTaxon ,taxon.getTaxonNodes().iterator().next().getParent().getTaxon());
+               Assert.assertEquals(taxon, newParentTaxon.getTaxonNodes().iterator().next().getChildNodes().iterator().next());
+               Assert.assertEquals(0, oldParentTaxon.getTaxonNodes().iterator().next().getChildNodes().size());
+
+       
        }
        
        /**
@@ -92,8 +98,9 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTestBase {
        public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.redo(monitor, info);
                
-//             Assert.assertEquals(newParentTaxon ,taxon.getTaxonomicParent());
-//             Assert.assertEquals(taxon, newParentTaxon.getTaxonomicChildren().toArray(new Taxon[0])[0]);
-//             Assert.assertTrue(oldParentTaxon.getTaxonomicChildrenCount() == 0);
+               Assert.assertEquals(newParentTaxon ,taxon.getTaxonNodes().iterator().next().getParent().getTaxon());
+               Assert.assertEquals(taxon, newParentTaxon.getTaxonNodes().iterator().next().getChildNodes().iterator().next());
+               Assert.assertEquals(0, oldParentTaxon.getTaxonNodes().iterator().next().getChildNodes().size());
+
        }
 }