Skip to content

Commit

Permalink
fix apache#195 optimize message unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
github-ygy committed Mar 1, 2019
1 parent 57c5247 commit c176dbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void testIsTimeOut() throws Exception {
MessageFuture messageFuture=new MessageFuture();
messageFuture.setTimeout(TIME_OUT_FIELD);
Assert.assertTrue(!messageFuture.isTimeout());
Thread.sleep(TIME_OUT_FIELD);
Thread.sleep(TIME_OUT_FIELD +1);
Assert.assertTrue(messageFuture.isTimeout());

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ public void testFieldGetSetFromJson() {

@Test
public void testGetNextMessageId() {
Assert.assertEquals(1, RpcMessage.getNextMessageId());
Assert.assertEquals(2, RpcMessage.getNextMessageId());
Assert.assertEquals(3, RpcMessage.getNextMessageId());
Assert.assertEquals(4, RpcMessage.getNextMessageId());
Assert.assertEquals(5, RpcMessage.getNextMessageId());
long startMessageId=RpcMessage.getNextMessageId();
Assert.assertEquals(1+startMessageId, RpcMessage.getNextMessageId());
Assert.assertEquals(2+startMessageId, RpcMessage.getNextMessageId());
Assert.assertEquals(3+startMessageId, RpcMessage.getNextMessageId());
Assert.assertEquals(4+startMessageId, RpcMessage.getNextMessageId());
Assert.assertEquals(5+startMessageId, RpcMessage.getNextMessageId());
}
}

0 comments on commit c176dbe

Please sign in to comment.