ShardIdentifier.builder().memberName("member-1")
.shardName("inventory").type("operational").build();
- private final ShardContext shardContext = new ShardContext();
+ private final DatastoreContext datastoreContext = new DatastoreContext();
@BeforeClass
public static void staticSetup() {
store.onGlobalContextUpdated(testSchemaContext);
}
+ private ActorRef createShard(){
+ return getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new DatastoreContext(), TestModel.createTestContext()));
+ }
+
@Test(expected = ReadFailedException.class)
public void testNegativeReadWithReadOnlyTransactionClosed()
throws Throwable {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadOnlyTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,
public void testNegativeReadWithReadWriteTransactionClosed()
throws Throwable {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,
public void testNegativeExistsWithReadWriteTransactionClosed()
throws Throwable {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,
public void testNegativeWriteWithTransactionReady() throws Exception {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newWriteOnlyTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,
public void testNegativeReadWriteWithTransactionReady() throws Exception {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,
public void testNegativeMergeTransactionReady() throws Exception {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props, "testNegativeMergeTransactionReady");
public void testNegativeDeleteDataWhenTransactionReady() throws Exception {
- final ActorRef shard =
- getSystem().actorOf(Shard.props(SHARD_IDENTIFIER, Collections.EMPTY_MAP, new ShardContext()));
+ final ActorRef shard = createShard();
final Props props = ShardTransaction.props(store.newReadWriteTransaction(), shard,
- testSchemaContext, shardContext);
+ testSchemaContext, datastoreContext,SHARD_IDENTIFIER.toString());
final TestActorRef<ShardTransaction> subject = TestActorRef
.create(getSystem(), props,