Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.JemmyException


    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


        }
        for(int depth = 1; depth < chooser.getDepth(); depth++) {
            // TODO - wait for menu item
            int elementIndex = getDesiredElementIndex(menuObject, chooser, depth);
            if(elementIndex == -1) {
                throw(new JemmyException("Unable to find menu (menuitem): " + ((DescriptablePathChooser)chooser).getDescription()));
            }
            for(int i = ((depth == 1) ? 0 : 1); i<=elementIndex; i++) {
                pressKey(KeyEvent.VK_DOWN, 0);
                releaseKey(KeyEvent.VK_DOWN, 0);
            }
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

                          PathChooser chooser, int depth, boolean pressMouse) {
        try {
            oper.waitComponentVisible(true);
            oper.waitComponentEnabled();
        } catch(InterruptedException e) {
            throw(new JemmyException("Interrupted!", e));
        }
  if(depth > chooser.getDepth() - 1) {
            if(oper instanceof JMenuOperator) {
                if(((JMenuOperator)oper).isPopupMenuVisible()) {
                    ((JMenuOperator)oper).setPopupMenuVisible(false);
                }
                ((JMenuOperator)oper).setPopupMenuVisible(true);
                waitPopupMenu(oper);
            }
            ((AbstractButtonOperator)oper).doClick();
      return(oper.getSource());
  } else {
            if(((JMenuOperator)oper).isPopupMenuVisible()) {
                ((JMenuOperator)oper).setPopupMenuVisible(false);
            }
            ((JMenuOperator)oper).setPopupMenuVisible(true);
            waitPopupMenu(oper);
        }
  oper.getTimeouts().sleep("JMenuOperator.WaitBeforePopupTimeout");
  JMenuItem item = waitItem(oper, waitPopupMenu(oper), chooser, depth);
  if(item instanceof JMenu) {
      JMenuOperator mo = new JMenuOperator((JMenu)item);
      mo.copyEnvironment(oper);
      Object result = push(mo, null, chooser, depth + 1, false);
            if(result instanceof JMenu) {
                org.netbeans.jemmy.JemmyProperties.getCurrentOutput().printLine("IN HERE" + ((JMenu)result).getText());
                org.netbeans.jemmy.JemmyProperties.getCurrentOutput().printLine("IN HERE" + Boolean.toString(((JMenu)result).isPopupMenuVisible()));
                if(!((JMenu)result).isPopupMenuVisible()) {
                    ((JMenuOperator)oper).setPopupMenuVisible(false);
                }
            } else {
                ((JMenuOperator)oper).setPopupMenuVisible(false);
                waitNoPopupMenu(oper);
            }
            return(result);
  } else {
      JMenuItemOperator mio = new JMenuItemOperator(item);
      mio.copyEnvironment(oper);
            try {
                mio.waitComponentEnabled();
            } catch(InterruptedException e) {
                throw(new JemmyException("Interrupted!", e));
            }
            ((AbstractButtonOperator)mio).doClick();
            ((JMenuOperator)oper).setPopupMenuVisible(false);
            waitNoPopupMenu(oper);
      return(item);
View Full Code Here

           getTimeout("ComponentOperator.WaitStateTimeout"));
  stateWaiter.setOutput(getOutput().createErrorOutput());
  try {
      stateWaiter.waitAction(null);
  } catch(InterruptedException e) {
      throw(new JemmyException("Waiting of \"" + state.getDescription() +
             "\" state has been interrupted!"));
  }
    }
View Full Code Here

            Throwable exception = producer.getException();
            if(exception != null) {
                if(exception instanceof JemmyException) {
                    throw((JemmyException)exception);
                } else {
                    throw(new JemmyException("Exception during " + action.getDescription(),
                                             exception));
                }
            }
      return(result);
  } catch(InterruptedException e) {
      throw(new JemmyException("Interrupted!", e));
  }
    }
View Full Code Here

      ActionProducer noBlockingProducer = new ActionProducer(action, false);
      noBlockingProducer.setOutput(output.createErrorOutput());
      noBlockingProducer.setTimeouts(timeouts);
      noBlockingProducer.produceAction(param);
  } catch(InterruptedException e) {
      throw(new JemmyException("Exception during \"" +
             action.getDescription() +
             "\" execution",
             e));
  }
  if(action.exception != null) {
      throw(new JemmyException("Exception during nonblocking \"" +
             action.getDescription() + "\"",
             action.exception));
  }
    }
View Full Code Here

     * Unlocks Queue and then throw exception.
     * @param e an exception to be thrown.
     */
    protected void unlockAndThrow(Exception e) {
  unlockQueue();
  throw(new JemmyException("Exception during queue locking", 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

     */
    public boolean compare(BufferedImage image, String fileName) {
        try {
            return(comparator.compare(image, loader.load(fileName)));
        } catch(IOException e) {
            throw(new JemmyException("IOException during image loading", e));
        }
    }
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.