CreateNewReceivingAddressAction extends MultiBitSubmitAction { @Override public void actionPerformed(ActionEvent e) { if (abort()) { return; } mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setEnabled(false); try { CreateNewReceivingAddressDialog createNewReceivingAddressDialog = new CreateNewReceivingAddressDialog(super.bitcoinController, mainFrame, receiveBitcoinPanel); createNewReceivingAddressDialog.setVisible(true); } finally { setEnabled(true); mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } if (receiveBitcoinPanel != null && receiveBitcoinPanel.getLabelTextArea() != null) { receiveBitcoinPanel.getLabelTextArea().requestFocusInWindow(); } } CreateNewReceivingAddressAction(BitcoinController bitcoinController, MultiBitFrame mainFrame,
            ReceiveBitcoinPanel receiveBitcoinPanel); @Override void actionPerformed(ActionEvent e);  }
@Test public void testNoWalletSelected() throws Exception { String runFunctionalTests = System.getProperty(Constants.RUN_FUNCTIONAL_TESTS_PARAMETER); if (Boolean.TRUE.toString().equalsIgnoreCase(runFunctionalTests)) { final CreateControllers.Controllers controllers = CreateControllers.createControllers(); final BitcoinController controller = controllers.bitcoinController; assertTrue("There was an active wallet when there should not be", controller.getModel().thereIsNoActiveWallet()); ColorAndFontConstants.init(); FontSizer.INSTANCE.initialise(controller); ReceiveBitcoinPanel receiveBitcoinPanel = new ReceiveBitcoinPanel(controller, null); CreateNewReceivingAddressAction createNewReceivingAddressAction = receiveBitcoinPanel .getCreateNewReceivingAddressAction(); assertNotNull("createNewReceivingAddressAction was not created successfully", createNewReceivingAddressAction); createNewReceivingAddressAction.actionPerformed(null); Object[] messages = MessageManager.INSTANCE.getMessages().toArray(); assertTrue("There were no messages but there should have been", messages != null && messages.length > 0); assertEquals("Wrong message after receive bitcoin confirm with no active wallet", ResetTransactionsSubmitActionTest.EXPECTED_NO_WALLET_IS_SELECTED, ((Message) messages[messages.length - 1]).getText()); } }