import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class ShardTransactionTest extends AbstractActorTest {
private static final ShardIdentifier SHARD_IDENTIFIER =
ShardIdentifier.create("inventory", MEMBER_NAME, "config");
+ private static final SchemaContext TEST_MODEL = TestModel.createTestContext();
private DatastoreContext datastoreContext = DatastoreContext.newBuilder().persistent(false).build();
@Before
public void setUp() {
shard = actorFactory.createTestActor(Shard.builder().id(SHARD_IDENTIFIER).datastoreContext(datastoreContext)
- .schemaContext(TestModel.createTestContext()).props()
+ .schemaContextProvider(() -> TEST_MODEL).props()
.withDispatcher(Dispatchers.DefaultDispatcherId()));
ShardTestKit.waitUntilLeader(shard);
store = shard.underlyingActor().getDataStore();
final AbstractShardDataTreeTransaction<?> transaction, final String name) {
Props props = ShardTransaction.props(type, transaction, shard, datastoreContext,
shard.underlyingActor().getShardMBean());
- return actorFactory.createActor(props, name);
+ return actorFactory.createActorNoVerify(props, name);
}
private ReadOnlyShardDataTreeTransaction readOnlyTransaction() {
watcher.expectMsgClass(duration("5 seconds"), Terminated.class);
if (failure != null) {
- Throwables.propagateIfInstanceOf(failure.cause(), Exception.class);
- Throwables.propagate(failure.cause());
+ Throwables.propagateIfPossible(failure.cause(), Exception.class);
+ throw new RuntimeException(failure.cause());
}
}
};
watcher.expectMsgClass(duration("5 seconds"), Terminated.class);
if (failure != null) {
- Throwables.propagateIfInstanceOf(failure.cause(), Exception.class);
- Throwables.propagate(failure.cause());
+ Throwables.throwIfInstanceOf(failure.cause(), Exception.class);
+ Throwables.throwIfUnchecked(failure.cause());
+ throw new RuntimeException(failure.cause());
}
}
};