src/test/java/net/christophermerrill/FancyFxTree/FancyTreeTests.java
@Test
	public void copyMultipleByDragInto()
		{
		createBasicTreeAndData();

		ExampleDataNode target_parent = _model.getNodeByName("1.1");
		ExampleDataNode target_node_1 = _model.getNodeByName("1.1.1");
		ExampleDataNode target_node_2 = _model.getNodeByName("1.1.2");
		ExampleDataNode destination = _model.getNodeByName("1.2.2");

		clickOn(target_node_1.getName());
		press(SHIFT).clickOn(target_node_2.getName()).release(SHIFT);
		press(SHORTCUT);
		drag(target_node_2.getName(), MouseButton.PRIMARY);
		dropTo(destination.getName());
		release(SHORTCUT);
		waitForUiEvents();

		Assertions.assertEquals(2, _operations_handler._drag_count, "2 items should be dragged");
		Assertions.assertTrue(dragListContains(_operations_handler._dragged_items, _model.getNodeByName("1.1.1")), "first item was not dragged");
		Assertions.assertTrue(dragListContains(_operations_handler._dragged_items, _model.getNodeByName("1.1.2")), "second item was not dragged");

		Assertions.assertTrue(target_parent.contains(target_node_1), "orignal #1 was removed");
		Assertions.assertTrue(target_parent.contains(target_node_2), "orignal #2 was removed");

		ExampleDataNode copy_1 = _model.getNodeByName(ExampleDataNode.getCopyName(target_node_1));
		Assertions.assertNotNull(copy_1, "1st node was not copied");
		ExampleDataNode copy_2 = _model.getNodeByName(ExampleDataNode.getCopyName(target_node_2));
		Assertions.assertNotNull(copy_2, "2nd node was not copied");
		Assertions.assertTrue(destination.contains(copy_1), "1st copy is not in destination");
		Assertions.assertTrue(destination.contains(copy_2), "2nd copy is not in destination");
		}
/**
	 * This test passes in isolation but fails when run after certain tests.
	 * Diagnosis reveals that the drag handler (FancyTreeCell) never gets called.
	 * Unable to determine cause.
	 */
This test passes in isolation but fails when run after certain tests.
Diagnosis reveals that the drag handler (FancyTreeCell) never gets called.
Unable to determine cause.
This test passes in isolation but fails when run after certain tests . Diagnosis reveals that the drag handler ( FancyTreeCell ) never gets called . Unable to determine cause .
@Test
	public void copyMultipleByDragInto()
		{
		createBasicTreeAndData();
		ExampleDataNode target_parent = _model.getNodeByName("1.1");
		ExampleDataNode target_node_1 = _model.getNodeByName("1.1.1");
		ExampleDataNode target_node_2 = _model.getNodeByName("1.1.2");
		ExampleDataNode destination = _model.getNodeByName("1.2.2");
		clickOn(target_node_1.getName());
		press(SHIFT).clickOn(target_node_2.getName()).release(SHIFT);
		press(SHORTCUT);
		drag(target_node_2.getName(), MouseButton.PRIMARY);
		dropTo(destination.getName());
		release(SHORTCUT);
		waitForUiEvents();
		Assertions.assertEquals(2, _operations_handler._drag_count, "2 items should be dragged");
		Assertions.assertTrue(dragListContains(_operations_handler._dragged_items, _model.getNodeByName("1.1.1")), "first item was not dragged");
		Assertions.assertTrue(dragListContains(_operations_handler._dragged_items, _model.getNodeByName("1.1.2")), "second item was not dragged");
		Assertions.assertTrue(target_parent.contains(target_node_1), "orignal #1 was removed");
		Assertions.assertTrue(target_parent.contains(target_node_2), "orignal #2 was removed");
		ExampleDataNode copy_1 = _model.getNodeByName(ExampleDataNode.getCopyName(target_node_1));
		Assertions.assertNotNull(copy_1, "1st node was not copied");
		ExampleDataNode copy_2 = _model.getNodeByName(ExampleDataNode.getCopyName(target_node_2));
		Assertions.assertNotNull(copy_2, "2nd node was not copied");
		Assertions.assertTrue(destination.contains(copy_1), "1st copy is not in destination");
		Assertions.assertTrue(destination.contains(copy_2), "2nd copy is not in destination");
		}
@ Test public void copyMultipleByDragInto ( ) { createBasicTreeAndData ( ) ; ExampleDataNode target_parent = _model . getNodeByName ( "1.1" ) ; ExampleDataNode target_node_1 = _model . getNodeByName ( "1.1.1" ) ; ExampleDataNode target_node_2 = _model . getNodeByName ( "1.1.2" ) ; ExampleDataNode destination = _model . getNodeByName ( "1.2.2" ) ; clickOn ( target_node_1 . getName ( ) ) ; press ( SHIFT ) . clickOn ( target_node_2 . getName ( ) ) . release ( SHIFT ) ; press ( SHORTCUT ) ; drag ( target_node_2 . getName ( ) , MouseButton . PRIMARY ) ; dropTo ( destination . getName ( ) ) ; release ( SHORTCUT ) ; waitForUiEvents ( ) ; Assertions . assertEquals ( 2 , _operations_handler . _drag_count , "2 items should be dragged" ) ; Assertions . assertTrue ( dragListContains ( _operations_handler . _dragged_items , _model . getNodeByName ( "1.1.1" ) ) , "first item was not dragged" ) ; Assertions . assertTrue ( dragListContains ( _operations_handler . _dragged_items , _model . getNodeByName ( "1.1.2" ) ) , "second item was not dragged" ) ; Assertions . assertTrue ( target_parent . contains ( target_node_1 ) , "orignal #1 was removed" ) ; Assertions . assertTrue ( target_parent . contains ( target_node_2 ) , "orignal #2 was removed" ) ; ExampleDataNode copy_1 = _model . getNodeByName ( ExampleDataNode . getCopyName ( target_node_1 ) ) ; Assertions . assertNotNull ( copy_1 , "1st node was not copied" ) ; ExampleDataNode copy_2 = _model . getNodeByName ( ExampleDataNode . getCopyName ( target_node_2 ) ) ; Assertions . assertNotNull ( copy_2 , "2nd node was not copied" ) ; Assertions . assertTrue ( destination . contains ( copy_1 ) , "1st copy is not in destination" ) ; Assertions . assertTrue ( destination . contains ( copy_2 ) , "2nd copy is not in destination" ) ; }
This test passes in isolation but fails when run after certain tests.
This test passes in isolation but fails when run after certain tests .