Examples of invokeAndWait()


Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertFalse("Second moved wall not new", selectedItems.contains(movedWall2));
    assertSame("First moved wall not joined to second one", movedWall2, movedWall1.getWallAtEnd());
    assertSame("Second moved wall not joined to first one", movedWall1, movedWall2.getWallAtStart());
   
    // 23. Undo duplication
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.undoButton.doClick();
        }
      });
    // Check piece and walls don't belong to home

Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertFalse("First wall still in home", frame.home.getWalls().contains(movedWall1));
    assertFalse("Second wall still in home", frame.home.getWalls().contains(movedWall2));
    // Check original items are selected
    assertTrue("Original items not selected", selectedItems.equals(frame.home.getSelectedItems()));
    // Redo
    tester.invokeAndWait(new Runnable() {
        public void run() {
          frame.redoButton.doClick();
        }
      });
    // Check piece and walls belong to home

Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertTrue("Tree doesn't have the focus", catalogTree.isFocusOwner());
    // Check Cut, Copy, Paste and Delete actions are disable
    assertActionsEnabled(controller, false, false, false, false);
   
    // 2. Select the first piece of furniture in catalog
    tester.invokeAndWait(new Runnable() {
      public void run() {
        catalogTree.expandRow(0);
        catalogTree.addSelectionInterval(1, 1);
      }
    });

Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertTrue("Plan doesn't have the focus", planComponent.isFocusOwner());
    // Check Cut, Copy and Delete actions are enabled in plan view
    assertActionsEnabled(controller, true, true, false, true);

    // 5. Use Wall creation mode
    tester.invokeAndWait(new Runnable() {
      public void run() {
        controller.getPlanController().setMode(PlanController.Mode.WALL_CREATION);
      }
    });
    // Check Cut, Copy, Paste actions are enabled

Examples of abbot.tester.JComponentTester.invokeAndWait()

    // Check Cut, Copy, Paste actions are disabled during wall drawing
    assertActionsEnabled(controller, false, false, false, false);   
    tester.actionClick(planComponent, 100, 25, InputEvent.BUTTON1_MASK, 2);

    // 6. Use Dimension creation mode
    tester.invokeAndWait(new Runnable() {
      public void run() {
        controller.getPlanController().setMode(PlanController.Mode.DIMENSION_LINE_CREATION);
      }
    });
    // Check Cut, Copy, Paste actions are enabled

Examples of abbot.tester.JComponentTester.invokeAndWait()

    tester.actionClick(planComponent, 25, 35);
    // Check Cut, Copy, Paste actions are disabled during dimension line drawing
    assertActionsEnabled(controller, false, false, false, false);   
    tester.actionClick(planComponent, 100, 35, InputEvent.BUTTON1_MASK, 2);
    // Use Selection mode
    tester.invokeAndWait(new Runnable() {
        public void run() {
          controller.getPlanController().setMode(PlanController.Mode.SELECTION);
        }
      });
    // Check Cut, Copy and Delete actions are enabled

Examples of abbot.tester.JComponentTester.invokeAndWait()

    tester.waitForIdle();
    // Add a piece of furniture to home
    List<CatalogPieceOfFurniture> selectedPieces = Arrays.asList(
        new CatalogPieceOfFurniture [] {preferences.getFurnitureCatalog().getCategories().get(0).getFurniture().get(0)});
    controller.getFurnitureCatalogController().setSelectedFurniture(selectedPieces);
    tester.invokeAndWait(new Runnable() {
      public void run() {
        runAction(controller, HomePane.ActionType.ADD_HOME_FURNITURE);
      }
    });
    // Check home contains one piece

Examples of abbot.tester.JComponentTester.invokeAndWait()

    // 3. Change dialog box values
    planPrintedCheckBox.setSelected(false);
    // Click on Ok in dialog box
    final JOptionPane pageSetupOptionPane = (JOptionPane)TestUtilities.findComponent(
        pageSetupDialog, JOptionPane.class);
    tester.invokeAndWait(new Runnable() {
        public void run() {
          // Select Ok option to hide dialog box in Event Dispatch Thread
          pageSetupOptionPane.setValue(JOptionPane.OK_OPTION);
        }
      });

Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertTrue("Next button is disabled", nextButton.isEnabled());
    assertEquals("Printable component doesn't display first page", 0, printableComponent.getPage());
    assertEquals("Wrong printable component page count", 2, printableComponent.getPageCount());
   
    // 6. Click on next page button
    tester.invokeAndWait(new Runnable() {
        public void run() {
          nextButton.doClick();
        }
      });
    // Check if buttons are enabled and if printable component displays the second page

Examples of abbot.tester.JComponentTester.invokeAndWait()

    assertEquals("Printable component doesn't display second page", 1, printableComponent.getPage());
   
    // Click on Ok in dialog box
    final JOptionPane printPreviewOptionPane = (JOptionPane)TestUtilities.findComponent(
        printPreviewDialog, JOptionPane.class);
    tester.invokeAndWait(new Runnable() {
        public void run() {
          // Select Ok option to hide dialog box in Event Dispatch Thread
          printPreviewOptionPane.setValue(JOptionPane.OK_OPTION);
        }
      });
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.