本文整理汇总了Java中test.java.awt.regtesthelpers.AbstractTest.fail方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractTest.fail方法的具体用法?Java AbstractTest.fail怎么用?Java AbstractTest.fail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.java.awt.regtesthelpers.AbstractTest
的用法示例。
在下文中一共展示了AbstractTest.fail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: traceEvent
import test.java.awt.regtesthelpers.AbstractTest; //导入方法依赖的package包/类
private static void traceEvent(String message, AWTEvent e){
AbstractTest.fail(message + " " + e.toString());
}