summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java')
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java120
1 files changed, 60 insertions, 60 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
index cf52cfb5bd57..a5cbb17829f4 100644
--- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
+++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -67,9 +67,9 @@ import util.AccessibilityTools;
*/
public class _XUserInputInterception extends MultiMethodTest {
public XUserInputInterception oObj = null;
-
+
private XModel m_XModel = null;
-
+
/** the listener 1 for the mouse click test */
private MyMouseClickHandler1 m_MouseListener1 = null;
/** the listener 2 for the mouse click test */
@@ -84,23 +84,23 @@ public class _XUserInputInterception extends MultiMethodTest {
private boolean m_mousePressed1 = false;
/** indicates if the mouseReleased event was called*/
private boolean m_mouseReleased1 = false;
-
+
/** indicates if the mousePressed event was called*/
private boolean m_mousePressed2 = false;
/** indicates if the mouseReleased event was called*/
private boolean m_mouseReleased2 = false;
-
+
/** indicates if the mousePressed event was called*/
private boolean m_keyPressed1 = false;
/** indicates if the mouseReleased event was called*/
private boolean m_keyReleased1 = false;
-
+
/** indicates if the mousePressed event was called*/
private boolean m_keyPressed2 = false;
/** indicates if the mouseReleased event was called*/
private boolean m_keyReleased2 = false;
-
- /** get the object rlation XUserInputInterception.XModel from the
+
+ /** get the object rlation XUserInputInterception.XModel from the
* test environment
*/
protected void before() {
@@ -113,25 +113,25 @@ public class _XUserInputInterception extends MultiMethodTest {
/**
* This test adds two different key listener to the object. <p>
- *
+ *
* Has <b> OK </b> if no exception is thrown.
*/
public void _addKeyHandler() {
-
+
log.println("creating key listener 1");
m_KeyListener1 = new MyKeyHandler1();
-
+
log.println("creating key listener 2");
m_KeyListener2 = new MyKeyHandler2();
-
-
+
+
log.println("adding key listener 1");
oObj.addKeyHandler(m_KeyListener1);
-
+
log.println("adding key listener 2");
oObj.addKeyHandler(m_KeyListener2);
-
+
tRes.tested("addKeyHandler()", true);
}
@@ -149,21 +149,21 @@ public class _XUserInputInterception extends MultiMethodTest {
requiredMethod("addKeyHandler()");
log.println("remove key listener 2");
-
+
oObj.removeKeyHandler(m_KeyListener2);
-
+
log.println("starting thread to check the key listener...");
EventTrigger et = new EventTrigger(m_XModel, EventTriggerType.KEY_TEXT_INTO_DOC);
et.run();
-
+
util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
log.println("key listener thread should be finished.");
-
-
+
+
boolean bOK = m_keyPressed1 & m_keyReleased1 &
! m_keyPressed2 & ! m_keyReleased2;
-
+
if (! bOK){
log.println("The key listener has not the expectd status:");
log.println("listener\texpected\tgot");
@@ -172,16 +172,16 @@ public class _XUserInputInterception extends MultiMethodTest {
log.println("keyPressed2\tfalse\t"+m_keyPressed2);
log.println("keyReleased2\tfalse\t"+m_keyReleased2);
}
-
+
log.println("remove Key listener 1");
oObj.removeKeyHandler(m_KeyListener1);
-
+
tRes.tested("removeKeyHandler()", bOK);
}
/**
* This test adds two different mouse klick listener to the object. <p>
- *
+ *
* Has <b> OK </b> if no exception is thrown.
*/
public void _addMouseClickHandler() {
@@ -189,12 +189,12 @@ public class _XUserInputInterception extends MultiMethodTest {
m_MouseListener1 = new MyMouseClickHandler1();
log.println("creating mouse listener 2");
m_MouseListener2 = new MyMouseClickHandler2();
-
+
log.println("adding mouse listener 1");
oObj.addMouseClickHandler(m_MouseListener1);
log.println("adding mouse listener 2");
oObj.addMouseClickHandler(m_MouseListener2);
-
+
tRes.tested("addMouseClickHandler()", true);
}
@@ -210,22 +210,22 @@ public class _XUserInputInterception extends MultiMethodTest {
*/
public void _removeMouseClickHandler() {
requiredMethod("addMouseClickHandler");
-
+
log.println("remove mouse listener 2");
-
+
oObj.removeMouseClickHandler(m_MouseListener2);
-
+
log.println("starting thread to check the mouse listener...");
EventTrigger et = new EventTrigger(m_XModel, EventTriggerType.MOUSE_KLICK_INTO_DOC);
et.run();
-
+
util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
log.println("mouse listener thread should be finished.");
-
+
boolean bOK = m_mousePressed1 & m_mouseReleased1 &
! m_mousePressed2 & ! m_mouseReleased2;
-
+
if (! bOK){
log.println("The mouse listener has not the expectd status:");
log.println("listener\t\texpected\tgot");
@@ -234,21 +234,21 @@ public class _XUserInputInterception extends MultiMethodTest {
log.println("mousePressed2\tfalse\t\t"+m_mousePressed2);
log.println("mouseReleased2\tfalse\t\t"+m_mouseReleased2);
}
-
+
log.println("remove mouse listener 1");
oObj.removeMouseClickHandler(m_MouseListener1);
-
+
tRes.tested("removeMouseClickHandler()", bOK);
}
-
+
/**
* Forces environment recreation.
*/
protected void after() {
disposeEnvironment();
- }
-
+ }
+
/**
* Listener which added and its method must be called
* on <code>keyPressed</code> and <code>keyReleased</code> call.
@@ -322,7 +322,7 @@ public class _XUserInputInterception extends MultiMethodTest {
"This should not be happen because listener is removed!");
}
}
-
+
/**
* Listener which added and its method must be called
* on <code>mousePressed</code> and <code>mouseReleased</code> call.
@@ -358,7 +358,7 @@ public class _XUserInputInterception extends MultiMethodTest {
log.println("XMouseClickHandler 1: disposing-Event");
}
};
-
+
/**
* Listener which added and removed. Its method must NOT be called
* on <code>mousePressed</code> and <code>mouseReleased</code> call.
@@ -397,14 +397,14 @@ public class _XUserInputInterception extends MultiMethodTest {
" This should not be happen because listener is removed!");
}
};
-
+
/**
* To check the events this class is a thread which click a mouse button and
* press a key with the <CODE>Robot</CODE> class
* @see java.awt.Robot
*/
private class EventTrigger extends Thread{
-
+
/**
* represents a <CODE>AccessibilityTools</CODE>
*/
@@ -418,7 +418,7 @@ public class _XUserInputInterception extends MultiMethodTest {
* represents a <CODE>XModel</CODE> of a document
*/
private XModel xModel = null;
-
+
/**
* Creates an instacne of this class. The parameter <CODE>eType</CODE> represents
* the kind of event wich will be triggert at <CODE>run()</CODE>
@@ -430,17 +430,17 @@ public class _XUserInputInterception extends MultiMethodTest {
this.xModel = model;
this.eventType = eType;
}
-
+
/**
* Triggers the event wich is represented by <CODE>eventType</CODE>
* The scenarios are:
* <ul>
* <li>EventTest.EventTriggerType.MOUSE_KLICK_INTO_DOC
- * which calls
+ * which calls
* <li><CODE>clickIntoDoc</CODE></LI>
* </LI>
* <li>EventTest.EventTriggerType.KEY_TEXT_INTO_DOC
- * which calls
+ * which calls
* <li><CODE>clickIntodoc</CODE></LI>
* <li><CODE>keyIntoDoc</CODE></LI>
* </LI>
@@ -449,7 +449,7 @@ public class _XUserInputInterception extends MultiMethodTest {
public void run(){
switch (this.eventType){
-
+
case EventTriggerType.MOUSE_KLICK_INTO_DOC:
clickIntoDoc();
break;
@@ -457,7 +457,7 @@ public class _XUserInputInterception extends MultiMethodTest {
clickIntoDoc();
keyIntoDoc();
break;
-
+
}
}
/**
@@ -471,14 +471,14 @@ public class _XUserInputInterception extends MultiMethodTest {
try{
util.DesktopTools.bringWindowToFront(xModel);
-
+
XWindow xWindow = at.getCurrentWindow(
- (XMultiServiceFactory) tParam.getMSF(),
+ (XMultiServiceFactory) tParam.getMSF(),
xModel);
-
+
XAccessible xRoot = at.getAccessibleObject(xWindow);
-
-
+
+
XAccessibleContext xPanel = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
XAccessibleComponent xPanelCont = (XAccessibleComponent) UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel);
@@ -504,7 +504,7 @@ public class _XUserInputInterception extends MultiMethodTest {
log.println("could not click into the scroll bar: " + e.toString());
}
}
-
+
/**
* This method press the "A" key. Therefore it uses the <CODE>Robot</CODE>
* class.
@@ -519,21 +519,21 @@ public class _XUserInputInterception extends MultiMethodTest {
} catch (java.awt.AWTException e) {
log.println("couldn't press key");
}
-
+
}
}
-
- /** This interface represents all possible actions which could be used
+
+ /** This interface represents all possible actions which could be used
* in the <CODE>EventTrigger</CODE> class.
* @see EventTest.EventTrigger
- */
+ */
private interface EventTriggerType{
-
+
/** klick the mouse into the scroll bar*/
final public static int MOUSE_KLICK_INTO_DOC = 1;
-
+
/** write some text into a spread sheet*/
final public static int KEY_TEXT_INTO_DOC = 2;
- }
+ }
}