new MockClusterWrapper(), new MockConfiguration(), DatastoreContext.newBuilder().build(),
new PrimaryShardInfoFutureCache()) {
@Override
new MockClusterWrapper(), new MockConfiguration(), DatastoreContext.newBuilder().build(),
new PrimaryShardInfoFutureCache()) {
@Override
try {
future.get(5, TimeUnit.SECONDS);
fail("Expected ExecutionException");
} catch (ExecutionException e) {
verifyCohortActors();
try {
future.get(5, TimeUnit.SECONDS);
fail("Expected ExecutionException");
} catch (ExecutionException e) {
verifyCohortActors();
- Throwables.propagateIfInstanceOf(e.getCause(), Exception.class);
- Throwables.propagate(e.getCause());
+ Throwables.propagateIfPossible(e.getCause(), Exception.class);
+ throw new RuntimeException(e.getCause());
TestActorRef<CohortActor> actor = actorFactory.createTestActor(builder.props()
.withDispatcher(Dispatchers.DefaultDispatcherId()), actorFactory.generateActorId("cohort"));
cohortActors.add(actor);
return new CohortInfo(Futures.successful(getSystem().actorSelection(actor.path())), () -> version);
}
TestActorRef<CohortActor> actor = actorFactory.createTestActor(builder.props()
.withDispatcher(Dispatchers.DefaultDispatcherId()), actorFactory.generateActorId("cohort"));
cohortActors.add(actor);
return new CohortInfo(Futures.successful(getSystem().actorSelection(actor.path())), () -> version);
}
Boolean actual = verifySuccessfulFuture(future);
assertEquals("canCommit", expected, actual);
}
Boolean actual = verifySuccessfulFuture(future);
assertEquals("canCommit", expected, actual);
}
private final AtomicInteger abortCount = new AtomicInteger();
private volatile AssertionError assertionError;
private final AtomicInteger abortCount = new AtomicInteger();
private volatile AssertionError assertionError;
if (CanCommitTransaction.isSerializedType(message)) {
canCommitCount.incrementAndGet();
onMessage("CanCommitTransaction", message, CanCommitTransaction.fromSerializable(message),
if (CanCommitTransaction.isSerializedType(message)) {
canCommitCount.incrementAndGet();
onMessage("CanCommitTransaction", message, CanCommitTransaction.fromSerializable(message),
- private void onMessage(String name, Object rawMessage, AbstractThreePhaseCommitMessage actualMessage,
- Class<?> expType, Object reply) {
+ private void onMessage(final String name, final Object rawMessage,
+ final AbstractThreePhaseCommitMessage actualMessage, final Class<?> expType, final Object reply) {
try {
assertNotNull("Unexpected " + name, expType);
assertEquals(name + " type", expType, rawMessage.getClass());
try {
assertNotNull("Unexpected " + name, expType);
assertEquals(name + " type", expType, rawMessage.getClass());