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

Improve test

上级 7314a0f7
...@@ -447,11 +447,15 @@ public class TestTools extends TestBase { ...@@ -447,11 +447,15 @@ 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 {
Socket socket = serverSocket.accept(); while (!stop) {
byte[] data = new byte[1024]; Socket socket = serverSocket.accept();
data[0] = 'x'; byte[] data = new byte[1024];
socket.getOutputStream().write(data); data[0] = 'x';
socket.close(); OutputStream out = socket.getOutputStream();
out.write(data);
out.close();
socket.close();
}
} }
}; };
task.execute(); task.execute();
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论