Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.JemmyException


    public boolean compare(String fileName1, String fileName2) {
        try {
            return(comparator.compare(loader.load(fileName1),
                                      loader.load(fileName2)));
        } catch(IOException e) {
            throw(new JemmyException("IOException during image loading", e));
        }
    }
View Full Code Here


                JemmyProperties.getCurrentOutput().
                    printErrLine("ATTENTION! you are using Jemmy built by Java earlier then 1.4, under " +
                                 "Java 1.4. \nImpossible to create JSpinnerDriver");
                return(createEmptyDriver());
            } catch(Exception e) {
                throw(new JemmyException("Impossible to create JSpinnerDriver although java version is " +
                                         System.getProperty("java.version"),
                                         e));
            }
        } else {
            return(createEmptyDriver());
View Full Code Here

        //end of 1.5 workaround
        try {
            return((JMenuItem)waiter.waitAction(null));
        } catch(InterruptedException e) {
            action.stop();
            throw(new JemmyException("Waiting has been interrupted", e));
        }
    }
View Full Code Here

                if(element instanceof JMenu) {
                    JMenuOperator subMenuOper = new JMenuOperator((JMenu)element);
                    subMenuOper.copyEnvironment(env);
                    mousePressed = inTheMiddle(subMenuOper, mousePressed);
                } else {
                    throw(new JemmyException("Menu path too long"));
                }
            }
        }
View Full Code Here

                          PathChooser chooser, int depth, boolean pressMouse) {
        try {
            oper.waitComponentVisible(true);
            oper.waitComponentEnabled();
        } catch(InterruptedException e) {
            throw(new JemmyException("Interrupted!", e));
        }
  MouseDriver mDriver = DriverManager.getMouseDriver(oper);
        //mDriver.enterMouse(oper);
        //use enhanced algorithm instead
        smartMove(lastItem, oper);
  if(depth > chooser.getDepth() - 1) {
            if(oper instanceof JMenuOperator &&
               menuBar != null && getSelectedElement(menuBar) != null) {
                //mDriver.enterMouse(oper);
            } else {
                DriverManager.getButtonDriver(oper).push(oper);
            }
      return(oper.getSource());
  }
  if(pressMouse && !((JMenuOperator)oper).isPopupMenuVisible() &&
           !(menuBar != null && getSelectedElement(menuBar) != null)) {
      DriverManager.getButtonDriver(oper).push(oper);
  }
  oper.getTimeouts().sleep("JMenuOperator.WaitBeforePopupTimeout");
  JMenuItem item = waitItem(oper, waitPopupMenu(oper), chooser, depth);
        mDriver.exitMouse(oper);
  if(item instanceof JMenu) {
      JMenuOperator mo = new JMenuOperator((JMenu)item);
      mo.copyEnvironment(oper);
      return(push(mo, oper, null, chooser, depth + 1, false));
  } else {
      JMenuItemOperator mio = new JMenuItemOperator(item);
      mio.copyEnvironment(oper);
            try {
                mio.waitComponentEnabled();
            } catch(InterruptedException e) {
                throw(new JemmyException("Interrupted!", e));
            }
            //move here first
            smartMove(oper, mio);
      DriverManager.getButtonDriver(oper).push(mio);
      return(item);
View Full Code Here

  waiter.setOutput(oper.getOutput().createErrorOutput());
  waiter.setTimeouts(oper.getTimeouts());
  try {
      return((JMenuItem)waiter.waitAction(null));
  } catch(InterruptedException e) {
      throw(new JemmyException("Waiting has been interrupted", e));
  }
    }
View Full Code Here

    public DefaultVisualizer cloneThis() {
        try {
            return((DefaultVisualizer)super.clone());
        } catch(CloneNotSupportedException e) {
            //that's impossible
            throw(new JemmyException("Even impossible happens :)", e));
        }
    }
View Full Code Here

                    invokeMethod("matches",
                                 new Object[] {match, (caption == null) ? "" : caption},
                                 new Class[]  {String.class, Class.forName("java.lang.CharSequence")});
                return(((Boolean)result).booleanValue());
            } catch(InvocationTargetException e) {
                throw(new JemmyException("Exception during regexpr using",
                                         e));
            } catch(ClassNotFoundException e) {
                throw(new JemmyException("Exception during regexpr using",
                                         e));
            } catch(NoSuchMethodException e) {
                throw(new JemmyException("Exception during regexpr using",
                                         e));
            } catch(IllegalAccessException e) {
                throw(new JemmyException("Exception during regexpr using",
                                         e));
            }
        } else {
            return(parse(new String(caption), new String(match)));
        }
View Full Code Here

     */
    public static BufferedImage getImage(Rectangle rect) {
        try {
            return(new Robot().createScreenCapture(rect));
        } catch(AWTException e) {
            throw(new JemmyException("Exception during screen capturing", e));
        }
    }
View Full Code Here

        return(true);
    }

    void checkEquality(byte[] b1, byte[] b2) {
        if(!compare(b1, b2)) {
            throw(new JemmyException("Format error"));
        }
    }
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.JemmyException

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.