Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.Timeout


  int direction = adj.getScrollDirection();
  int orientation = adj.getScrollOrientation();
        int position = position(oper, orientation);
        long lastChanded = System.currentTimeMillis();
  if(direction != adj.DO_NOT_TOUCH_SCROLL_DIRECTION) {
      Timeout delta = getScrollDeltaTimeout(oper);
      startPushAndWait(oper, direction, orientation);
      while(adj.getScrollDirection() == direction) {
    delta.sleep();
                int curPosition = position(oper, orientation);
                if(curPosition != position) {
                    position = curPosition;
                    lastChanded = System.currentTimeMillis();
                } else {
View Full Code Here


   
    /**
     * Creates a new instance of AppleMenuDriver
     */
    public AppleMenuDriver() {
        super(new Timeout("apple.system.menu.delay", 100),
                new String[] {"org.netbeans.jemmy.operators.JMenuBarOperator"});
    }
View Full Code Here

        super(new Timeout("apple.system.menu.delay", 100),
                new String[] {"org.netbeans.jemmy.operators.JMenuBarOperator"});
    }
   
    public Object pushMenu(ComponentOperator oper, PathChooser chooser) {
        Timeout maxTime = oper.getTimeouts().create("ComponentOperator.WaitComponentTimeout");
        JMenuBar bar = (JMenuBar)(oper.getSource());
        activateMenu(bar);
        MenuElement menuObject;
        maxTime.start();
        while(!chooser.checkPathComponent(0, (menuObject = getSelectedElement(bar)))) {
            pressKey(KeyEvent.VK_RIGHT, 0);
            releaseKey(KeyEvent.VK_RIGHT, 0);
            if(maxTime.expired()) {
                throw(new TimeoutExpiredException("AppleMenuDriver: can not find an appropriate menu!"));
            }
        }
        for(int depth = 1; depth < chooser.getDepth(); depth++) {
            // TODO - wait for menu item
View Full Code Here

    public void scrollToMinimum(ComponentOperator oper, int orientation) {
  startDragging(oper);
  Point pnt = new Point(0, 0);
  drag(oper, pnt);
  Timeout sleepTime = oper.getTimeouts().create("Waiter.TimeDelta");
  while(((JScrollBarOperator)oper).getValue() >
        ((JScrollBarOperator)oper).getMinimum()) {
      sleepTime.sleep();
  }
  drop(oper, pnt);
    }
View Full Code Here

    public void scrollToMaximum(ComponentOperator oper, int orientation) {
  startDragging(oper);
  Point pnt = new Point(oper.getWidth() - 1, oper.getHeight() - 1);
  drag(oper, pnt);
  Timeout sleepTime = oper.getTimeouts().create("Waiter.TimeDelta");
  while(((JScrollBarOperator)oper).getValue() >
        (((JScrollBarOperator)oper).getMaximum() -
         ((JScrollBarOperator)oper).getVisibleAmount())) {
      sleepTime.sleep();
  }
  drop(oper, pnt);
    }
View Full Code Here

                            x = lessButton.getWidth() / 2;
                        } else {
                            return(null);
                        }
                        DriverManager.getMouseDriver(oper).
                            clickMouse(oper, x, y, 1, oper.getDefaultMouseButton(), 0, new Timeout("", 0));
                    }
                    return(null);
                }
            });
    }
View Full Code Here

    }

    public void testAddSourceWizard1() {
        WizardOperator wo = new WizardOperator("Add Data");
        while (!wo.btFinish().isEnabled()) {
            new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
        }
        logger.info("Add image took " + (System.currentTimeMillis() - start) + "ms");
        wo.btFinish().clickMouse();
    }
View Full Code Here

            browseButtonOperator.pushNoBlock();
            JFileChooserOperator fileChooserOperator = new JFileChooserOperator();
            fileChooserOperator.chooseFile(database);
            JButtonOperator okButtonOperator = new JButtonOperator(addDatabaseDialogOperator, "OK", 0);
            okButtonOperator.pushNoBlock();
            new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
        }
        // Used if the database has no index
        //JDialog jd3 = JDialogOperator.waitJDialog("No Index Exists", false, false);
        //JDialogOperator jdo3 = new JDialogOperator(jd3);
        //JButtonOperator jbo3 = new JButtonOperator(jdo3, "Yes", 0);
        new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
        //jbo3.pushNoBlock();
        JButtonOperator jbo4 = new JButtonOperator(hashMainDialogOperator, "OK", 0);
        jbo4.pushNoBlock();
    }
View Full Code Here

        jbo0.pushNoBlock();
        JFileChooserOperator jfco0 = new JFileChooserOperator();
        jfco0.chooseFile(words);
        JTableOperator jto = new JTableOperator(jdo, 0);
        jto.clickOnCell(0, 0);
        new Timeout("pausing", 1000).sleep(); // give it a second to process
        if (Boolean.parseBoolean(System.getProperty("mugen_mode"))) {
            JTabbedPaneOperator jtpo = new JTabbedPaneOperator(jdo);
            jtpo.selectPage("String Extraction");
            JCheckBoxOperator jcbo0 = new JCheckBoxOperator(jtpo, "Arabic (Arabic)");
            jcbo0.doClick();
            JCheckBoxOperator jcbo1 = new JCheckBoxOperator(jtpo, "Han (Chinese, Japanese, Korean)");
            jcbo1.doClick();
            new Timeout("pausing", 1000).sleep(); // give it a second to process
        }
        JButtonOperator jbo2 = new JButtonOperator(jdo, "OK", 0);
        jbo2.pushNoBlock();
        WizardOperator wo = new WizardOperator("Add Data");
        JCheckBoxOperator jbco0 = new JCheckBoxOperator(wo, "Process Unallocated Space");
        if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
            jbco0.doClick();
        }
        new Timeout("pausing", 10000).sleep(); // let things catch up
        wo.btNext().clickMouse();
    }
View Full Code Here

        wo.btNext().clickMouse();
    }

    public void testIngest() {
        logger.info("Ingest 3");
        new Timeout("pausing", 10000).sleep(); // wait for ingest to actually start
        long startIngest = System.currentTimeMillis();
        IngestManager man = IngestManager.getInstance();
        while (man.isIngestRunning()) {
            new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
        }
        logger.log(Level.INFO, "Ingest (including enqueue) took {0}ms", (System.currentTimeMillis() - startIngest));
        // allow keyword search to finish saving artifacts, just in case
        //   but randomize the timing so that we don't always get the same error
        //   consistently, making it seem like default behavior
        Random rand = new Random();
        new Timeout("pausing", 10000 + (rand.nextInt(15000) + 5000)).sleep();
        screenshot("Finished Ingest");

    }
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.Timeout

Copyright © 2018 www.massapicom. 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.