本文整理汇总了Java中test.java.awt.regtesthelpers.AbstractTest类的典型用法代码示例。如果您正苦于以下问题:Java AbstractTest类的具体用法?Java AbstractTest怎么用?Java AbstractTest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractTest类属于test.java.awt.regtesthelpers包,在下文中一共展示了AbstractTest类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
public static void main(String []s)
{
final Dialog fd = new Dialog(new Frame(), true);
Timer t = new Timer();
t.schedule(new TimerTask() {
public void run() {
System.out.println("RUNNING TASK");
fd.setVisible(false);
fd.dispose();
System.out.println("FINISHING TASK");
}
}, 3000L);
fd.setVisible(true);
t.cancel();
Util.waitForIdle(null);
AbstractTest.pass();
}
示例2: traceMouse
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
private void traceMouse(String k, MouseEvent e){
long eventTime = e.getWhen();
long currTime = System.currentTimeMillis();
long diff = currTime - eventTime;
Sysout.println(k + " diff is " + diff + ", event is "+ e);
if (diff < 0){
AbstractTest.fail(k + " diff is " + diff + ", event = "+e);
}
}
示例3: testComponent
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
private static void testComponent(final Component comp){
Runnable action = new Runnable(){
public void run(){
Util.clickOnComp(comp, robot);
Util.waitForIdle(robot);
}
};
if (! Util.trackFocusGained(comp, action, REASONABLE_PATH_TIME, true)){
AbstractTest.fail("Focus didn't come to " + comp);
}
testKeys();
Util.waitForIdle(robot);
}
示例4: traceKey
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
private void traceKey(String k, KeyEvent e){
long eventTime = e.getWhen();
long currTime = System.currentTimeMillis();
long diff = currTime - eventTime;
Sysout.println(k + " diff is " + diff + ", event is "+ e);
if (diff < 0 ||
diff > REASONABLE_PATH_TIME)
{
AbstractTest.fail(k + " diff is " + diff + ", event = "+e);
}
}
示例5: start
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
public void start ()
{
JButton jButton = new JButton();
this.setSize(200, 200);
this.addMouseWheelListener(new MouseWheelListener() {
public void mouseWheelMoved(MouseWheelEvent e)
{
System.out.println("Wheel moved on APPLET : "+e);
actualEvents++;
}
});
this.add(jButton);
this.setVisible(true);
this.validate();
Util.waitForIdle(robot);
Util.pointOnComp(jButton, robot);
Util.waitForIdle(robot);
for (int i = 0; i < MOVE_COUNT; i++){
robot.mouseWheel(1);
robot.delay(10);
}
for (int i = 0; i < MOVE_COUNT; i++){
robot.mouseWheel(-1);
robot.delay(10);
}
Util.waitForIdle(robot);
//Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
//result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
}
}
示例6: main
import test.java.awt.regtesthelpers.AbstractTest; //导入依赖的package包/类
public static void main(String []s)
{
JFrame frame = new JFrame("A test frame");
frame.setSize(200, 200);
frame.addMouseWheelListener(new MouseWheelListener() {
public void mouseWheelMoved(MouseWheelEvent e)
{
System.out.println("Wheel moved on FRAME : "+e);
actualEvents++;
}
});
frame.setVisible(true);
Util.waitForIdle(robot);
Util.pointOnComp(frame, robot);
Util.waitForIdle(robot);
for (int i = 0; i < MOVE_COUNT; i++){
robot.mouseWheel(1);
robot.delay(10);
}
for (int i = 0; i < MOVE_COUNT; i++){
robot.mouseWheel(-1);
robot.delay(10);
}
Util.waitForIdle(robot);
//Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
//result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
}
}