提交 d4636a49 authored 作者: Thomas Mueller's avatar Thomas Mueller

Improve test

上级 7314a0f7
...@@ -447,12 +447,16 @@ public class TestTools extends TestBase { ...@@ -447,12 +447,16 @@ public class TestTools extends TestBase {
Task task = new Task() { Task task = new Task() {
@Override @Override
public void call() throws Exception { public void call() throws Exception {
while (!stop) {
Socket socket = serverSocket.accept(); Socket socket = serverSocket.accept();
byte[] data = new byte[1024]; byte[] data = new byte[1024];
data[0] = 'x'; data[0] = 'x';
socket.getOutputStream().write(data); OutputStream out = socket.getOutputStream();
out.write(data);
out.close();
socket.close(); socket.close();
} }
}
}; };
task.execute(); task.execute();
Thread.sleep(100); Thread.sleep(100);
...@@ -463,7 +467,7 @@ public class TestTools extends TestBase { ...@@ -463,7 +467,7 @@ public class TestTools extends TestBase {
assertEquals(ErrorCode.CONNECTION_BROKEN_1, e.getErrorCode()); assertEquals(ErrorCode.CONNECTION_BROKEN_1, e.getErrorCode());
} }
serverSocket.close(); serverSocket.close();
task.get(); task.getException();
} }
private void testDeleteFiles() throws SQLException { private void testDeleteFiles() throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论