assertEquals("Wrong piece count in home", 0, home.getFurniture().size());
assertEquals("Wrong wall count in home", 0, home.getWalls().size());
assertEquals("Wrong dimension count in home", 0, home.getDimensionLines().size());
// Check only Paste action is enabled
assertActionsEnabled(controller, false, false, true, false);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
// Check clipboard contains two different data flavors (HomeTransferableList and Image)
assertTrue("Missing home data flavor", clipboard.isDataFlavorAvailable(HomeTransferableList.HOME_FLAVOR));
assertTrue("Missing String flavor", clipboard.isDataFlavorAvailable(DataFlavor.imageFlavor));
// 8. Paste selected items in plan component
runAction(tester, controller, HomePane.ActionType.PASTE);
tester.waitForIdle();
// Check home contains one piece, one wall and one dimension
assertEquals("Wrong piece count in home", 1, home.getFurniture().size());
assertEquals("Wrong wall count in home", 1, home.getWalls().size());
assertEquals("Wrong dimension count in home", 1, home.getDimensionLines().size());
// 9. Transfer focus to furniture table
tester.actionKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK);
// Check furniture table has focus
assertTrue("Table doesn't have the focus", furnitureTable.isFocusOwner());
// Delete selection
runAction(tester, controller, HomePane.ActionType.DELETE);
// Check home contains no piece, one wall and one dimension
assertEquals("Wrong piece count in home", 0, home.getFurniture().size());
assertEquals("Wrong wall count in home", 1, home.getWalls().size());
assertEquals("Wrong dimension count in home", 1, home.getDimensionLines().size());
// Check only Paste action is enabled
assertActionsEnabled(controller, false, false, true, false);
// 10. Paste selected items in furniture table
runAction(tester, controller, HomePane.ActionType.PASTE);
// Check home contains one piece, one wall and one dimension
assertEquals("Wrong piece count in home", 1, home.getFurniture().size());
assertEquals("Wrong wall count in home", 1, home.getWalls().size());
assertEquals("Wrong dimension count in home", 1, home.getDimensionLines().size());
// Check Cut, Copy and Paste actions are enabled
assertActionsEnabled(controller, true, true, true, true);
// 11. Copy selected furniture in clipboard while furniture table has focus
runAction(tester, controller, HomePane.ActionType.COPY);
// Check clipboard contains two different data flavors (HomeTransferableList and String)
assertTrue("Missing home data flavor", clipboard.isDataFlavorAvailable(HomeTransferableList.HOME_FLAVOR));
assertTrue("Missing String flavor", clipboard.isDataFlavorAvailable(DataFlavor.stringFlavor));
}