More tightening of shard state action tests

This commit adds some additional assertions that test success is not
falsely indicated by adding assertions that success / failure methods
are not incorrectly invoked in failure / success scenarios.
This commit is contained in:
Jason Tedor 2016-01-17 10:36:24 -05:00
parent cf3c0ed049
commit 386d2ab86a
1 changed files with 16 additions and 0 deletions

View File

@ -140,6 +140,13 @@ public class ShardStateActionTests extends ESTestCase {
success.set(true);
latch.countDown();
}
@Override
public void onShardFailedFailure(Exception e) {
success.set(false);
latch.countDown();
assert false;
}
});
CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear();
@ -181,6 +188,13 @@ public class ShardStateActionTests extends ESTestCase {
success.set(true);
latch.countDown();
}
@Override
public void onShardFailedFailure(Exception e) {
success.set(false);
latch.countDown();
assert false;
}
});
latch.await();
@ -224,6 +238,7 @@ public class ShardStateActionTests extends ESTestCase {
success.set(false);
exception.set(e);
latch.countDown();
assert false;
}
});
@ -251,6 +266,7 @@ public class ShardStateActionTests extends ESTestCase {
shardStateAction.shardFailed(getRandomShardRouting(index), indexUUID, "test", getSimulatedFailure(), new ShardStateAction.Listener() {
@Override
public void onSuccess() {
failure.set(false);
assert false;
}