+ Await.result(future, Duration.create(3, TimeUnit.SECONDS));
+ }
+
+ @Test(expected = ReadFailedException.class)
+ public void testNegativeExistsWithReadWriteTransactionClosed()
+ throws Throwable {
+
+ final ActorRef shard = createShard();
+ final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
+ testSchemaContext, datastoreContext, shardStats, "txn",
+ DataStoreVersions.CURRENT_VERSION);
+
+ final TestActorRef<ShardTransaction> subject = TestActorRef
+ .create(getSystem(), props,
+ "testNegativeExistsWithReadWriteTransactionClosed");
+
+ ShardTransactionMessages.DataExists dataExists =
+ ShardTransactionMessages.DataExists.newBuilder()
+ .setInstanceIdentifierPathArguments(
+ NormalizedNodeMessages.InstanceIdentifier.newBuilder()
+ .build()
+ ).build();
+
+ Future<Object> future =
+ akka.pattern.Patterns.ask(subject, dataExists, 3000);
+ Await.result(future, Duration.create(3, TimeUnit.SECONDS));