import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
private static final InMemoryDOMDataStore store =
new InMemoryDOMDataStore("OPER", storeExecutor);
+ private static final SchemaContext testSchemaContext = TestModel.createTestContext();
+
static {
- store.onGlobalContextUpdated(TestModel.createTestContext());
+ store.onGlobalContextUpdated(testSchemaContext);
}
@Test
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject = getSystem().actorOf(props, "testReadData");
new Within(duration("1 seconds")) {
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject = getSystem().actorOf(props, "testReadDataWhenDataNotFound");
new Within(duration("1 seconds")) {
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject =
getSystem().actorOf(props, "testWriteData");
protected void run() {
subject.tell(new WriteData(TestModel.TEST_PATH,
- ImmutableNodes.containerNode(TestModel.TEST_QNAME)),
+ ImmutableNodes.containerNode(TestModel.TEST_QNAME), TestModel.createTestContext()).toSerializable(),
getRef());
final String out = new ExpectMsg<String>("match hint") {
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, testSchemaContext);
final ActorRef subject =
getSystem().actorOf(props, "testMergeData");
protected void run() {
subject.tell(new MergeData(TestModel.TEST_PATH,
- ImmutableNodes.containerNode(TestModel.TEST_QNAME)),
+ ImmutableNodes.containerNode(TestModel.TEST_QNAME), testSchemaContext).toSerializable(),
getRef());
- final String out = new ExpectMsg<String>("match hint") {
+ final String out = new ExpectMsg<String>(duration("500 milliseconds"), "match hint") {
// do not put code outside this method, will run afterwards
protected String match(Object in) {
if (in instanceof MergeDataReply) {
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject =
getSystem().actorOf(props, "testDeleteData");
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject =
getSystem().actorOf(props, "testReadyTransaction");
new JavaTestKit(getSystem()) {{
final ActorRef shard = getSystem().actorOf(Shard.props("config"));
final Props props =
- ShardTransaction.props(store.newReadWriteTransaction(), shard);
+ ShardTransaction.props(store.newReadWriteTransaction(), shard, TestModel.createTestContext());
final ActorRef subject =
getSystem().actorOf(props, "testCloseTransaction");