Skip to content

Commit

Permalink
[ISSUE #5095] Add some remoting test
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhimins committed Oct 9, 2022
1 parent 9f225ac commit 2456c14
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,8 @@ public void operationComplete(final ResponseFuture responseFuture) {
public void testProcessRequestCommand() throws InterruptedException {
final Semaphore semaphore = new Semaphore(0);
RemotingCommand request = RemotingCommand.createRequestCommand(1, null);
ResponseFuture responseFuture = new ResponseFuture(null, 1, request, 3000, new InvokeCallback() {
@Override
public void operationComplete(final ResponseFuture responseFuture) {
assertThat(semaphore.availablePermits()).isEqualTo(0);
}
}, new SemaphoreReleaseOnlyOnce(semaphore));
ResponseFuture responseFuture = new ResponseFuture(null, 1, request, 3000,
responseFuture1 -> assertThat(semaphore.availablePermits()).isEqualTo(0), new SemaphoreReleaseOnlyOnce(semaphore));

remotingAbstract.responseTable.putIfAbsent(1, responseFuture);
RemotingCommand response = RemotingCommand.createResponseCommand(0, "Foo");
Expand Down

0 comments on commit 2456c14

Please sign in to comment.