提交 52e9d252 authored 作者: Thomas Mueller's avatar Thomas Mueller

Make the tests work on Raspberry Pi

上级 aee669ac
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
package org.h2.test.unit; package org.h2.test.unit;
import java.awt.Button; import java.awt.Button;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -142,20 +143,26 @@ public class TestTools extends TestBase { ...@@ -142,20 +143,26 @@ public class TestTools extends TestBase {
lastUrl = "-"; lastUrl = "-";
// double-click prevention is 100 ms // double-click prevention is 100 ms
Thread.sleep(200); Thread.sleep(200);
MouseEvent me = new MouseEvent(new Button(), 0, 0, 0, 0, 0, 0, try {
false, MouseEvent.BUTTON1); MouseEvent me = new MouseEvent(new Button(), 0, 0, 0, 0, 0, 0,
c.mouseClicked(me); false, MouseEvent.BUTTON1);
assertContains(lastUrl, ":9002"); c.mouseClicked(me);
lastUrl = "-"; assertContains(lastUrl, ":9002");
// no delay - ignore because it looks like a double click lastUrl = "-";
c.mouseClicked(me); // no delay - ignore because it looks like a double click
assertEquals("-", lastUrl); c.mouseClicked(me);
// open the window assertEquals("-", lastUrl);
c.actionPerformed(new ActionEvent(this, 0, "status")); // open the window
c.actionPerformed(new ActionEvent(this, 0, "exit")); c.actionPerformed(new ActionEvent(this, 0, "status"));
c.actionPerformed(new ActionEvent(this, 0, "exit"));
// check if the service was stopped
c.runTool("-webPort", "9002"); // check if the service was stopped
c.runTool("-webPort", "9002");
} catch (HeadlessException e) {
// ignore
}
c.shutdown(); c.shutdown();
// trying to use the same port for two services should fail, // trying to use the same port for two services should fail,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论