Package org.jemmy

Examples of org.jemmy.JemmyException


    private class EmptyScroll extends AbstractScroll {

        @Override
        public double position() {
            throw new JemmyException("");
        }
View Full Code Here


            return emptyScroller;
        }

        @Override
        public double maximum() {
            throw new JemmyException("");
        }
View Full Code Here

            throw new JemmyException("");
        }

        @Override
        public double minimum() {
            throw new JemmyException("");
        }
View Full Code Here

            throw new JemmyException("");
        }

        @Override
        public double value() {
            throw new JemmyException("");
        }
View Full Code Here

            try {
                sc = new ServerSocket(connectionPort);
                socket = sc.accept();
                watchdog.interrupt();
            } catch (IOException ex) {
                throw new JemmyException("Can't establish connection with client", ex);
            }
            System.out.println("Connection established!");
            try {
                inputStream = new ObjectInputStream(socket.getInputStream());
                outputStream = new ObjectOutputStream(socket.getOutputStream());
                while(true) {
                    String command = (String)inputStream.readObject();
    //                System.out.println("Got command: " + command);
                    if ("exit".equals(command)) {
                        System.exit(0);
                    }
                    if ("getProperty".equals(command)) {
                        String property = (String)inputStream.readObject();
                        outputStream.writeObject(Environment.getEnvironment().getProperty(property));
                        outputStream.writeObject("OK");
                    }
                    if ("makeAnOperation".equals(command)) {
                        String method = (String)inputStream.readObject();
                        Object[] params = (Object[])inputStream.readObject();
                        Class[] paramClasses = (Class[])inputStream.readObject();
                        Object result = makeAnOperationLocally(method, params,
                                paramClasses);
                        if (result instanceof BufferedImage) {
                            outputStream.writeObject("image");
                            BufferedImage image = BufferedImage.class.cast(result);
                            new PNGEncoder(outputStream, PNGEncoder.COLOR_MODE)
                                    .encode(image, false);
                            //ImageIO.write(image, "png", outputStream);
                        } else {
                            outputStream.writeObject("OK");
                            outputStream.writeObject(result);
                        }
    //                    System.out.println("Command executed");
                    }
                }
            } catch (ClassNotFoundException ex) {
                throw new JemmyException("Socket communication with other " +
                        "JVM failed", ex);
            } catch (IOException ex) {
                Logger.getLogger(RobotExecutor.class.getName())
                        .log(Level.SEVERE, null, ex);
            } finally {
View Full Code Here

                    public void run() {
                        doInitRobot();
                    }
                });
            } catch (InterruptedException ex) {
                throw new JemmyException("Failed to initialize robot", ex);
            } catch (InvocationTargetException ex) {
                throw new JemmyException("Failed to initialize robot", ex);
            }
        }
    }
View Full Code Here

            ClassReference robotClassReverence = new ClassReference("java.awt.Robot");
            robotReference = new ClassReference(robotClassReverence.newInstance(null, null));
            setAutoDelay(autoDelay);
            ready = true;
        } catch (InvocationTargetException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        } catch (IllegalStateException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        } catch (NoSuchMethodException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        } catch (IllegalAccessException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        } catch (ClassNotFoundException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        } catch (InstantiationException e) {
            throw (new JemmyException("Exception during java.awt.Robot accessing", e));
        }
    }
View Full Code Here

        try {
            outputStream.writeObject("exit");
            socket.close();
            connectionEstablished = false;
        } catch (IOException ex) {
            throw new JemmyException("Failed to shutdown connection", ex);
        }
    }
View Full Code Here

        } else if(Keyboard.class.isAssignableFrom(interfaceClass)) {
            return (INTERFACE) new KeyboardImpl(control, awtMap);
        } else if(Drag.class.isAssignableFrom(interfaceClass)) {
            return (INTERFACE) new DragImpl(control, awtMap);
        }
        throw new JemmyException(AWTRobotInputFactory.class.getName() + " does not cupport " + interfaceClass.getName());
    }
View Full Code Here

        }
        throw new JemmyException(AWTRobotInputFactory.class.getName() + " does not cupport " + interfaceClass.getName());
    }

    public <TYPE, INTERFACE extends TypeControlInterface<TYPE>> INTERFACE create(Wrap<?> control, Class<INTERFACE> interfaceClass, Class<TYPE> type) {
        throw new JemmyException(AWTRobotInputFactory.class.getName() + " does not cupport " + interfaceClass.getName());
    }
View Full Code Here

TOP

Related Classes of org.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.