|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--PGUIRobotSlave
PGUI - PhOSCo GUI Testing Copyright (C) 2000 Mike Calder-Smith, mike@gmot.demon.co.uk Guillemot Design Ltd - www.PhOSCo.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The PhOSCo GUI Test Robot is a very easy to use tool for testing the Graphical User Interface (GUI) behaviour of Java applications. It consists of two programs and one helper class:
For documentation, see the PGUI user documentation .
This is a very initial release with minimal testing, but does work. Please let the author know of any problems. Improvements and adaptations welcomed.
This code requires Java 1.3 to compile, and the availability of the com.sun.image.codec.jpeg extensions from the Sun JDK 1.3 or JRE.
This is the helper class for inclusion in instrumented applications that are to be tested using PGUIRobot. This classs traps AWTEvents and sends Datagrams describing them and user test commands to the PGUICapture tool.
Inner Class Summary | |
private class |
PGUIRobotSlave.ListenToRobbie
Class to listen for messages from Robot |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
boolean |
beTold
Robot Commmand flag |
(package private) byte[] |
bufPGUI
PGUI Capture/Robot Instrumentation Datagram Packet Buffer |
(package private) static java.lang.String |
copyr
Copyright |
(package private) java.net.DatagramPacket |
dpcktPGUI
PGUI Capture/Robot Instrumentation Datagram Packet |
(package private) java.net.DatagramSocket |
dsPGUI
PGUI Capture/Robot Instrumentation Datagram Socket |
boolean |
goforit
Activity flag |
(package private) int |
height
Test Application Screen Window height |
(package private) int |
lastKeyEvent
Last Key flag |
(package private) boolean |
listeningPGUI
AWTEvent listening flag |
protected static java.io.PrintStream |
log
Log file |
(package private) PGUIRobotSlave.ListenToRobbie |
ltr
Robot Listener Thread |
(package private) static int |
NOTRELEASED
Key Event Type |
(package private) boolean |
readyPGUI
PGUI Capture/Robot Datagram Ready Flag |
(package private) static int |
RELEASED
Key Event Type |
(package private) java.awt.Dimension |
screenSize
Screen Dimension |
(package private) int |
sox
Test Application Screen Window top left x |
(package private) int |
soy
Test Application Screen Window top left y |
(package private) javax.swing.JFrame |
upThere
Parent Frame |
(package private) static java.lang.String |
version
Version |
(package private) int |
width
Test Application Screen Window width |
Fields inherited from class java.awt.Component |
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
PGUIRobotSlave(javax.swing.JFrame parent)
Constructor |
Method Summary | |
private void |
captureDialog(java.awt.AWTEvent trigger)
Provide a user dialog which can be used to save areas of the screen, save files, run setup processes, and so on. |
void |
eventDispatched(java.awt.AWTEvent e)
Inspect AWTEvent and send appropriate Datagram |
private java.lang.String |
getFileName(java.lang.String dlgHdr)
Get a file name |
private int |
getKeyCode(java.lang.String dmsg)
Get Keycode from Datagram message |
java.lang.String |
getRobbie()
Listen for datagram from Robot |
void |
screenChange(javax.swing.JFrame parent)
|
void |
sendPGUI(java.lang.String msg)
Send Datagram Packet to PGUICapture. |
void |
trilby(java.lang.String cmd)
Perform Robot command |
private java.lang.String |
writeJPEG(java.awt.image.BufferedImage bi)
Save an Image in a JPEG file. |
Methods inherited from class java.awt.Component |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
static java.lang.String version
static java.lang.String copyr
java.awt.Dimension screenSize
java.net.DatagramSocket dsPGUI
byte[] bufPGUI
java.net.DatagramPacket dpcktPGUI
boolean readyPGUI
boolean listeningPGUI
javax.swing.JFrame upThere
public boolean goforit
public boolean beTold
int lastKeyEvent
static final int RELEASED
static final int NOTRELEASED
PGUIRobotSlave.ListenToRobbie ltr
int sox
int soy
int width
int height
protected static java.io.PrintStream log
Constructor Detail |
public PGUIRobotSlave(javax.swing.JFrame parent)
JFrame
- Parent FrameMethod Detail |
public void eventDispatched(java.awt.AWTEvent e)
eventDispatched
in interface java.awt.event.AWTEventListener
AWTEvent
- private int getKeyCode(java.lang.String dmsg)
String
- Datagram messagepublic void sendPGUI(java.lang.String msg)
String
- Message to send in packetprivate void captureDialog(java.awt.AWTEvent trigger)
AWTEvent
- Triggering eventprivate java.lang.String writeJPEG(java.awt.image.BufferedImage bi)
BufferedImage
- Image to be saved to JPEG fileprivate java.lang.String getFileName(java.lang.String dlgHdr)
String
- Dialog Titlepublic void screenChange(javax.swing.JFrame parent)
public java.lang.String getRobbie()
public void trilby(java.lang.String cmd)
String
- command
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |