/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.navigation.navigator.TreeNodeDropAdapter.MovingType;
+import eu.etaxonomy.taxeditor.navigation.navigator.e4.TreeNodeDropAdapterE4.MovingType;
import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
/**
private static TaxonNode oldParentTaxonNode;
private static TaxonNode newParentTaxonNode;
private static TaxonNode taxonNode;
-
+
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
-
+
taxon = Taxon.NewInstance(null, null);
oldParentTaxon = Taxon.NewInstance(null, null);
newParentTaxon = Taxon.NewInstance(null, null);
-
+
tree = Classification.NewInstance(null);
oldParentTaxonNode = tree.addChildTaxon(oldParentTaxon, null, null);
newParentTaxonNode = tree.addChildTaxon(newParentTaxon, null, null);
-
+
taxonNode = oldParentTaxonNode.addChildTaxon(taxon, null, null);
-
+
Set<UUID> taxonNodeUuidSet = new HashSet<UUID>();
//TODO ??
IConversationEnabled conversationEnabled = null;
taxonNodeUuidSet.add(taxonNode.getUuid());
- operation = new MoveTaxonOperation("Move Taxon To Different Parent",
- undoContext, taxonNodeUuidSet, newParentTaxonNode, postOperation,
+ operation = new MoveTaxonOperation("Move Taxon To Different Parent",
+ undoContext, taxonNodeUuidSet, newParentTaxonNode, postOperation,
conversationEnabled, MovingType.CHILD);
}
/**
* Test method for {@link eu.etaxonomy.taxeditor.navigation.operation.MoveTaxonOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
- * @throws ExecutionException
+ * @throws ExecutionException
*/
@Test
public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
operation.execute(monitor, info);
-
+
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());
/**
* Test method for {@link eu.etaxonomy.taxeditor.navigation.operation.MoveTaxonOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
- * @throws ExecutionException
+ * @throws ExecutionException
*/
@Test
public void testUndoIProgressMonitorIAdaptable() throws ExecutionException {
operation.undo(monitor, info);
-
+
Assert.assertEquals(oldParentTaxon ,taxon.getTaxonNodes().iterator().next().getParent().getTaxon());
Assert.assertEquals(0, newParentTaxon.getTaxonNodes().iterator().next().getChildNodes().size());
Assert.assertEquals(taxon, oldParentTaxon.getTaxonNodes().iterator().next().getChildNodes().iterator().next());
}
-
+
/**
* Test method for {@link eu.etaxonomy.taxeditor.navigation.operation.MoveTaxonOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
- * @throws ExecutionException
+ * @throws ExecutionException
*/
@Test
public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
operation.redo(monitor, info);
-
+
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());