Bug 2682 - Switch sal-binding-dom-it to sal-test-model 43/15343/4
authorMichal Rehak <mirehak@cisco.com>
Thu, 19 Feb 2015 12:39:06 +0000 (13:39 +0100)
committerMichal Rehak <mirehak@cisco.com>
Thu, 19 Feb 2015 12:39:06 +0000 (13:39 +0100)
* Migration to sal-test-model

Change-Id: If46014ec4cc8b3311a7766bcb2cb9a61b9e71592
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Martin Bobak <mbobak@cisco.com>
Signed-off-by: Michal Rehak <mirehak@cisco.com>
16 files changed:
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ConcurrentImplicitCreateTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug02Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug03Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DeleteNestedAugmentationListenParentTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/FlagsSerializationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/PutAugmentationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/WriteParentListenAugmentTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/WriteParentReadChildTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/BrokerIntegrationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/ChangeOriginatedInDomBrokerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerMountPointTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerRpcTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java
opendaylight/md-sal/sal-test-model/src/main/yang/opendaylight-of-migration-test-model.yang [new file with mode: 0644]

index aefc53b..7135660 100644 (file)
@@ -17,11 +17,10 @@ import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
@@ -32,11 +31,11 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 @SuppressWarnings("deprecation")
 public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
 
-    private static final NodeKey NODE_FOO_KEY = new NodeKey(new NodeId("foo"));
-    private static final NodeKey NODE_BAR_KEY = new NodeKey(new NodeId("foo"));
-    private static InstanceIdentifier<Nodes> NODES_PATH = InstanceIdentifier.builder(Nodes.class).build();
-    private static InstanceIdentifier<Node> NODE_FOO_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
-    private static InstanceIdentifier<Node> NODE_BAR_PATH = NODES_PATH.child(Node.class, NODE_FOO_KEY);
+    private static final TopLevelListKey FOO_KEY = new TopLevelListKey("foo");
+    private static final TopLevelListKey BAR_KEY = new TopLevelListKey("bar");
+    private static InstanceIdentifier<Top> TOP_PATH = InstanceIdentifier.builder(Top.class).build();
+    private static InstanceIdentifier<TopLevelList> FOO_PATH = TOP_PATH.child(TopLevelList.class, FOO_KEY);
+    private static InstanceIdentifier<TopLevelList> BAR_PATH = TOP_PATH.child(TopLevelList.class, BAR_KEY);
 
     @Test
     public void testConcurrentCreate() throws InterruptedException, ExecutionException {
@@ -44,8 +43,8 @@ public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
         DataModificationTransaction fooTx = baDataService.beginTransaction();
         DataModificationTransaction barTx = baDataService.beginTransaction();
 
-        fooTx.putOperationalData(NODE_FOO_PATH, new NodeBuilder().setKey(NODE_FOO_KEY).build());
-        barTx.putOperationalData(NODE_BAR_PATH, new NodeBuilder().setKey(NODE_BAR_KEY).build());
+        fooTx.putOperationalData(FOO_PATH, new TopLevelListBuilder().setKey(FOO_KEY).build());
+        barTx.putOperationalData(BAR_PATH, new TopLevelListBuilder().setKey(BAR_KEY).build());
 
         Future<RpcResult<TransactionStatus>> fooFuture = fooTx.commit();
         Future<RpcResult<TransactionStatus>> barFuture = barTx.commit();
index 2b51713..3ac2b0d 100644 (file)
@@ -22,87 +22,75 @@ import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ContainerWithUses;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUses;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUsesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ListViaUsesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 import com.google.common.util.concurrent.SettableFuture;
 
-/*
- * FIXME: THis test should be moved to compat test-suite and rewriten
- * to use sal-test-model
+/**
+ * FIXME: THis test should be moved to compat test-suite
  */
 @SuppressWarnings("deprecation")
 public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
 
-    private static final NodeKey NODE_0_KEY = new NodeKey(new NodeId("test:0"));
-    private static final NodeKey NODE_1_KEY = new NodeKey(new NodeId("test:1"));
+    private static final TopLevelListKey TOP_LEVEL_LIST_0_KEY = new TopLevelListKey("test:0");
+    private static final TopLevelListKey TOP_LEVEL_LIST_1_KEY = new TopLevelListKey("test:1");
 
-    public static final InstanceIdentifier<Flow> DEEP_WILDCARDED_PATH = InstanceIdentifier.builder(Nodes.class)
-            .child(Node.class) //
-            .augmentation(FlowCapableNode.class) //
-            .child(Table.class) //
-            .child(Flow.class) //
+    protected static final InstanceIdentifier<ListViaUses> DEEP_WILDCARDED_PATH = InstanceIdentifier
+            .builder(Top.class)
+            .child(TopLevelList.class) //
+            .augmentation(TreeComplexUsesAugment.class) //
+            .child(ListViaUses.class) //
             .build();
 
-    private static final TableKey TABLE_0_KEY = new TableKey((short) 0);
-    private static final TableFeaturesKey TABLE_FEATURES_KEY = new TableFeaturesKey((short) 0);
-
-    private static final InstanceIdentifier<Table> NODE_0_TABLE_PATH = InstanceIdentifier.builder(Nodes.class)
-            .child(Node.class, NODE_0_KEY) //
-            .augmentation(FlowCapableNode.class) //
-            .child(Table.class, TABLE_0_KEY) //
+    private static final InstanceIdentifier<TreeComplexUsesAugment> NODE_0_TCU_PATH = InstanceIdentifier
+            .builder(Top.class)
+            .child(TopLevelList.class, TOP_LEVEL_LIST_0_KEY) //
+            .augmentation(TreeComplexUsesAugment.class) //
             .build();
 
-    private static final InstanceIdentifier<Table> NODE_1_TABLE_PATH = InstanceIdentifier.builder(Nodes.class)
-            .child(Node.class, NODE_1_KEY) //
-            .augmentation(FlowCapableNode.class) //
-            .child(Table.class, TABLE_0_KEY) //
+    private static final InstanceIdentifier<TreeComplexUsesAugment> NODE_1_TCU_PATH = InstanceIdentifier
+            .builder(Top.class)
+            .child(TopLevelList.class, TOP_LEVEL_LIST_1_KEY) //
+            .augmentation(TreeComplexUsesAugment.class) //
             .build();
 
-    private static final FlowKey FLOW_KEY = new FlowKey(new FlowId("test"));
 
-    private static final InstanceIdentifier<Flow> NODE_0_FLOW_PATH = NODE_0_TABLE_PATH.child(Flow.class, FLOW_KEY);
+    private static final ListViaUsesKey LIST_VIA_USES_KEY = new ListViaUsesKey("test");
+
+    private static final InstanceIdentifier<ListViaUses> NODE_0_LVU_PATH = NODE_0_TCU_PATH.child(ListViaUses.class, LIST_VIA_USES_KEY);
 
-    private static final InstanceIdentifier<Flow> NODE_1_FLOW_PATH = NODE_1_TABLE_PATH.child(Flow.class, FLOW_KEY);
+    private static final InstanceIdentifier<ListViaUses> NODE_1_LVU_PATH = NODE_1_TCU_PATH.child(ListViaUses.class, LIST_VIA_USES_KEY);
 
-    private static final InstanceIdentifier<TableFeatures> NODE_0_TABLE_FEATURES_PATH =
-            NODE_0_TABLE_PATH.child(TableFeatures.class, TABLE_FEATURES_KEY);
+    private static final InstanceIdentifier<ContainerWithUses> NODE_0_CWU_PATH =
+            NODE_0_TCU_PATH.child(ContainerWithUses.class);
 
-    private static final TableFeatures TABLE_FEATURES = new TableFeaturesBuilder()//
-            .setKey(TABLE_FEATURES_KEY) //
-            .setName("Foo") //
-            .setMaxEntries(1000L) //
+    private static final ContainerWithUses CWU= new ContainerWithUsesBuilder()//
+            .setLeafFromGrouping("some container value") //
             .build();
 
-    private static final Flow FLOW = new FlowBuilder() //
-            .setKey(FLOW_KEY) //
-            .setBarrier(true) //
-            .setStrict(true) //
+    private static final ListViaUses LVU = new ListViaUsesBuilder() //
+            .setKey(LIST_VIA_USES_KEY) //
+            .setName("john")
             .build();
 
     @Test
-    public void testSepareteWrites() throws InterruptedException, TimeoutException, ExecutionException {
+    public void testSeparateWrites() throws InterruptedException, TimeoutException, ExecutionException {
 
         DataProviderService dataBroker = testContext.getBindingDataBroker();
 
         final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> eventFuture = SettableFuture.create();
         dataBroker.registerDataChangeListener(DEEP_WILDCARDED_PATH, new DataChangeListener() {
-
             @Override
             public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> dataChangeEvent) {
                 eventFuture.set(dataChangeEvent);
@@ -110,9 +98,9 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
         });
 
         DataModificationTransaction transaction = dataBroker.beginTransaction();
-        transaction.putOperationalData(NODE_0_TABLE_FEATURES_PATH, TABLE_FEATURES);
-        transaction.putOperationalData(NODE_0_FLOW_PATH, FLOW);
-        transaction.putOperationalData(NODE_1_FLOW_PATH, FLOW);
+        transaction.putOperationalData(NODE_0_CWU_PATH, CWU);
+        transaction.putOperationalData(NODE_0_LVU_PATH, LVU);
+        transaction.putOperationalData(NODE_1_LVU_PATH, LVU);
         transaction.commit().get();
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> event = eventFuture.get(1000, TimeUnit.MILLISECONDS);
@@ -127,29 +115,26 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
 
         final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> eventFuture = SettableFuture.create();
         dataBroker.registerDataChangeListener(DEEP_WILDCARDED_PATH, new DataChangeListener() {
-
             @Override
             public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> dataChangeEvent) {
                 eventFuture.set(dataChangeEvent);
             }
         });
 
-        DataModificationTransaction tableTx = dataBroker.beginTransaction();
-        tableTx.putOperationalData(NODE_0_TABLE_FEATURES_PATH, TABLE_FEATURES);
-        tableTx.commit().get();
+        DataModificationTransaction cwuTx = dataBroker.beginTransaction();
+        cwuTx.putOperationalData(NODE_0_CWU_PATH, CWU);
+        cwuTx.commit().get();
 
         assertFalse(eventFuture.isDone());
 
-        DataModificationTransaction flowTx = dataBroker.beginTransaction();
+        DataModificationTransaction lvuTx = dataBroker.beginTransaction();
 
-        Table table = new TableBuilder() //
-                .setKey(TABLE_0_KEY) //
-                .setFlow(Collections.singletonList(FLOW)) //
-                .build();
+        TreeComplexUsesAugment tcua = new TreeComplexUsesAugmentBuilder()
+                .setListViaUses(Collections.singletonList(LVU)).build();
 
-        flowTx.putOperationalData(NODE_0_TABLE_PATH, table);
-        flowTx.putOperationalData(NODE_1_FLOW_PATH, FLOW);
-        flowTx.commit().get();
+        lvuTx.putOperationalData(NODE_0_TCU_PATH, tcua);
+        lvuTx.putOperationalData(NODE_1_LVU_PATH, LVU);
+        lvuTx.commit().get();
 
         validateEvent(eventFuture.get(1000, TimeUnit.MILLISECONDS));
     }
@@ -161,7 +146,7 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
 
         // We wrote initial state NODE_0_FLOW
         DataModificationTransaction transaction = dataBroker.beginTransaction();
-        transaction.putOperationalData(NODE_0_FLOW_PATH, FLOW);
+        transaction.putOperationalData(NODE_0_LVU_PATH, LVU);
         transaction.commit().get();
 
         // We registered DataChangeListener
@@ -176,23 +161,23 @@ public class WildcardedDataChangeListenerTest extends AbstractDataServiceTest {
         assertFalse(eventFuture.isDone());
 
         DataModificationTransaction secondTx = dataBroker.beginTransaction();
-        secondTx.putOperationalData(NODE_0_FLOW_PATH, FLOW);
-        secondTx.putOperationalData(NODE_1_FLOW_PATH, FLOW);
+        secondTx.putOperationalData(NODE_0_LVU_PATH, LVU);
+        secondTx.putOperationalData(NODE_1_LVU_PATH, LVU);
         secondTx.commit().get();
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> event = (eventFuture.get(1000, TimeUnit.MILLISECONDS));
         assertNotNull(event);
         // Data change should contains NODE_1 Flow - which was added
-        assertTrue(event.getCreatedOperationalData().containsKey(NODE_1_FLOW_PATH));
+        assertTrue(event.getCreatedOperationalData().containsKey(NODE_1_LVU_PATH));
         // Data change must not containe NODE_0 Flow which was replaced with same value.
-        assertFalse(event.getUpdatedOperationalData().containsKey(NODE_0_FLOW_PATH));
+        assertFalse(event.getUpdatedOperationalData().containsKey(NODE_0_LVU_PATH));
     }
 
     private static void validateEvent(final DataChangeEvent<InstanceIdentifier<?>, DataObject> event) {
         assertNotNull(event);
-        assertTrue(event.getCreatedOperationalData().containsKey(NODE_1_FLOW_PATH));
-        assertTrue(event.getCreatedOperationalData().containsKey(NODE_0_FLOW_PATH));
-        assertFalse(event.getCreatedOperationalData().containsKey(NODE_0_TABLE_FEATURES_PATH));
+        assertTrue(event.getCreatedOperationalData().containsKey(NODE_1_LVU_PATH));
+        assertTrue(event.getCreatedOperationalData().containsKey(NODE_0_LVU_PATH));
+        assertFalse(event.getCreatedOperationalData().containsKey(NODE_0_CWU_PATH));
     }
 
-}
+}
\ No newline at end of file
index bddbc4e..d85cb7a 100644 (file)
@@ -21,9 +21,9 @@ import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.TopBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
@@ -33,7 +33,7 @@ import com.google.common.util.concurrent.MoreExecutors;
 @SuppressWarnings("deprecation")
 public class DOMCodecBug02Test extends AbstractDataServiceTest {
 
-    private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
+    private static final InstanceIdentifier<Top> TOP_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
             .toInstance();
 
     /**
@@ -66,10 +66,10 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
                 .submit(new Callable<Future<RpcResult<TransactionStatus>>>() {
                     @Override
                     public Future<RpcResult<TransactionStatus>> call() throws Exception {
-                        NodesBuilder nodesBuilder = new NodesBuilder();
-                        nodesBuilder.setNode(Collections.<Node> emptyList());
+                        TopBuilder topBuilder = new TopBuilder();
+                        topBuilder.setTopLevelList(Collections.<TopLevelList> emptyList());
                         DataModificationTransaction transaction = baDataService.beginTransaction();
-                        transaction.putOperationalData(NODES_INSTANCE_ID_BA, nodesBuilder.build());
+                        transaction.putOperationalData(TOP_INSTANCE_ID_BA, topBuilder.build());
                         return transaction.commit();
                     }
                 });
@@ -77,13 +77,13 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
         RpcResult<TransactionStatus> result = future.get().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Nodes nodes = checkForNodes();
-        assertNotNull(nodes);
+        Top top = checkForTop();
+        assertNotNull(top);
 
     }
 
-    private Nodes checkForNodes() {
-        return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
+    private Top checkForTop() {
+        return (Top) baDataService.readOperationalData(TOP_INSTANCE_ID_BA);
 
     }
 
index c07125a..ba4a024 100644 (file)
@@ -22,22 +22,20 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.SupportType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.CustomEnum;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.Cont2;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.Cont2Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.cont2.Contlist1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.cont2.Contlist1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -49,42 +47,42 @@ import com.google.common.util.concurrent.SettableFuture;
 @SuppressWarnings("deprecation")
 public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataChangeListener {
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
-    private static final String NODE_ID = "openflow:1";
+    private static final QName TOP_LEVEL_LIST_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
+    private static final String TOP_LEVEL_LIST_NAME = "tll:foo";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TOP_LEVEL_LIST_NAME);
 
-    private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
-            NODE_ID);
+    private static final Map<QName, Object> TLL_KEY_BI = Collections.<QName, Object> singletonMap(TOP_LEVEL_LIST_NAME_QNAME,
+            TOP_LEVEL_LIST_NAME);
 
-    private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
+    private static final InstanceIdentifier<Top> TOP_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
             .toInstance();
 
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = NODES_INSTANCE_ID_BA.child(Node.class, NODE_KEY);
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = TOP_INSTANCE_ID_BA.child(TopLevelList.class, TLL_KEY);
 
 
-    private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = //
-            NODES_INSTANCE_ID_BA.builder() //
-            .child(Node.class, NODE_KEY) //
-            .augmentation(FlowCapableNode.class) //
-            .child(SupportedActions.class)
+    private static final InstanceIdentifier<Cont2> CONT2_INSTANCE_ID_BA = //
+            TOP_INSTANCE_ID_BA.builder() //
+            .child(TopLevelList.class, TLL_KEY) //
+            .augmentation(TllComplexAugment.class) //
+            .child(Cont2.class)
             .toInstance();
 
 
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier NODE_INSTANCE_ID_BI = //
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier TLL_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-            .node(Nodes.QNAME) //
-            .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
+            .node(Top.QNAME) //
+            .nodeWithKey(TopLevelList.QNAME, TLL_KEY_BI) //
             .toInstance();
-    private static final QName SUPPORTED_ACTIONS_QNAME = QName.create(FlowCapableNode.QNAME, SupportedActions.QNAME.getLocalName());
+    private static final QName CONT2_QNAME = QName.create(TllComplexAugment.QNAME, Cont2.QNAME.getLocalName());
 
 
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier SUPPORTED_ACTIONS_INSTANCE_ID_BI = //
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier CONT2_INSTANCE_ID_BI = //
             org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-                    .node(Nodes.QNAME) //
-                    .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
-                    .node(SUPPORTED_ACTIONS_QNAME) //
+                    .node(Top.QNAME) //
+                    .nodeWithKey(TopLevelList.QNAME, TLL_KEY_BI) //
+                    .node(CONT2_QNAME) //
                     .toInstance();
 
     private final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> receivedChangeEvent = SettableFuture.create();
@@ -100,24 +98,22 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
     public void testAugmentSerialization() throws Exception {
 
 
-        baDataService.registerDataChangeListener(NODES_INSTANCE_ID_BA, this);
+        baDataService.registerDataChangeListener(TOP_INSTANCE_ID_BA, this);
 
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setId(new NodeId(NODE_ID));
-        nodeBuilder.setKey(NODE_KEY);
+        TopLevelListBuilder tllBuilder = new TopLevelListBuilder();
+        tllBuilder.setKey(TLL_KEY);
         DataModificationTransaction transaction = baDataService.beginTransaction();
 
 
-        FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
-        fnub.setHardware("Hardware Foo");
-        fnub.setManufacturer("Manufacturer Foo");
-        fnub.setSerialNumber("Serial Foo");
-        fnub.setDescription("Description Foo");
-        fnub.setSoftware("JUnit emulated");
-        FlowCapableNode fnu = fnub.build();
-        nodeBuilder.addAugmentation(FlowCapableNode.class, fnu);
-        Node original = nodeBuilder.build();
-        transaction.putOperationalData(NODE_INSTANCE_ID_BA, original);
+        TllComplexAugmentBuilder tllcab = new TllComplexAugmentBuilder();
+        tllcab.setAttrStr1("Hardware Foo");
+        tllcab.setAttrStr2("Manufacturer Foo");
+        tllcab.setAttrStr3("Serial Foo");
+        tllcab.setAttrStr4("Description Foo");
+        TllComplexAugment tlca = tllcab.build();
+        tllBuilder.addAugmentation(TllComplexAugment.class, tlca);
+        TopLevelList original = tllBuilder.build();
+        transaction.putOperationalData(TLL_INSTANCE_ID_BA, original);
 
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
@@ -125,13 +121,13 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
         DataChangeEvent<InstanceIdentifier<?>, DataObject> potential = receivedChangeEvent.get(1000,TimeUnit.MILLISECONDS);
         assertNotNull(potential);
 
-        verifyNodes((Nodes) potential.getUpdatedOperationalSubtree(),original);
-        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
-        Nodes nodes = checkForNodes();
-        verifyNodes(nodes,original);
+        verifyTll((Top) potential.getUpdatedOperationalSubtree(),original);
+        assertBindingIndependentVersion(TLL_INSTANCE_ID_BI);
+        Top top = checkForTop();
+        verifyTll(top,original);
 
         testAddingNodeConnector();
-        testNodeRemove();
+        testTllRemove();
 
     }
 
@@ -139,69 +135,66 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
     public void testAugmentNestedSerialization() throws Exception {
         DataModificationTransaction transaction = baDataService.beginTransaction();
 
-        SupportedActionsBuilder actions = new SupportedActionsBuilder();
-        ActionTypeBuilder action = new ActionTypeBuilder();
-        action.setAction("foo-action");
-        action.setSupportState(SupportType.Native);
-        List<ActionType> actionTypes = Collections.singletonList(action.build());
-        actions.setActionType(actionTypes );
+        Cont2Builder cont2b = new Cont2Builder();
+        Contlist1Builder cl1b = new Contlist1Builder();
+        cl1b.setAttrStr("foo-action");
+        cl1b.setAttrEnum(CustomEnum.Type1);
+        List<Contlist1> contlists = Collections.singletonList(cl1b.build());
+        cont2b.setContlist1(contlists);
 
-        transaction.putOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BA, actions.build());
+        transaction.putOperationalData(CONT2_INSTANCE_ID_BA, cont2b.build());
         RpcResult<TransactionStatus> putResult = transaction.commit().get();
         assertNotNull(putResult);
         assertEquals(TransactionStatus.COMMITED, putResult.getResult());
-        SupportedActions readedTable = (SupportedActions) baDataService.readOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BA);
+        Cont2 readedTable = (Cont2) baDataService.readOperationalData(CONT2_INSTANCE_ID_BA);
         assertNotNull(readedTable);
 
-        CompositeNode biSupportedActions = biDataService.readOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BI);
+        CompositeNode biSupportedActions = biDataService.readOperationalData(CONT2_INSTANCE_ID_BI);
         assertNotNull(biSupportedActions);
 
     }
 
     private void testAddingNodeConnector() throws Exception {
-
-        NodeConnectorId ncId = new NodeConnectorId("openflow:1:bar");
-        NodeConnectorKey nodeKey = new NodeConnectorKey(ncId );
-        InstanceIdentifier<NodeConnector> ncInstanceId = NODE_INSTANCE_ID_BA.child(NodeConnector.class, nodeKey);
-        NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
-        ncBuilder.setId(ncId);
-        ncBuilder.setKey(nodeKey);
-        NodeConnector connector = ncBuilder.build();
+        NestedListKey nlKey = new NestedListKey("test:0:0");
+        InstanceIdentifier<NestedList> ncInstanceId = TLL_INSTANCE_ID_BA.child(NestedList.class, nlKey);
+        NestedListBuilder nlBuilder = new NestedListBuilder();
+        nlBuilder.setKey(nlKey);
+        NestedList nestedList = nlBuilder.build();
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        transaction.putOperationalData(ncInstanceId, connector);
+        transaction.putOperationalData(ncInstanceId, nestedList);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-        assertNotNull(node);
-        assertNotNull(node.getNodeConnector());
-        assertFalse(node.getNodeConnector().isEmpty());
-        NodeConnector readedNc = node.getNodeConnector().get(0);
-        assertNotNull(readedNc);
+        TopLevelList tll = (TopLevelList) baDataService.readOperationalData(TLL_INSTANCE_ID_BA);
+        assertNotNull(tll);
+        assertNotNull(tll.getNestedList());
+        assertFalse(tll.getNestedList().isEmpty());
+        NestedList readedNl = tll.getNestedList().get(0);
+        assertNotNull(readedNl);
     }
 
-    private void testNodeRemove() throws Exception {
+    private void testTllRemove() throws Exception {
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        transaction.removeOperationalData(NODE_INSTANCE_ID_BA);
+        transaction.removeOperationalData(TLL_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-        assertNull(node);
+        TopLevelList tll = (TopLevelList) baDataService.readOperationalData(TLL_INSTANCE_ID_BA);
+        assertNull(tll);
     }
 
-    private void verifyNodes(final Nodes nodes,final Node original) {
-        assertNotNull(nodes);
-        assertNotNull(nodes.getNode());
-        assertEquals(1, nodes.getNode().size());
-        Node readedNode = nodes.getNode().get(0);
-        assertEquals(original.getId(), readedNode.getId());
+    private void verifyTll(final Top top,final TopLevelList original) {
+        assertNotNull(top);
+        assertNotNull(top.getTopLevelList());
+        assertEquals(1, top.getTopLevelList().size());
+        TopLevelList readedNode = top.getTopLevelList().get(0);
+        assertEquals(original.getName(), readedNode.getName());
         assertEquals(original.getKey(), readedNode.getKey());
 
-        FlowCapableNode fnu = original.getAugmentation(FlowCapableNode.class);
-        FlowCapableNode readedAugment = readedNode.getAugmentation(FlowCapableNode.class);
+        TllComplexAugment fnu = original.getAugmentation(TllComplexAugment.class);
+        TllComplexAugment readedAugment = readedNode.getAugmentation(TllComplexAugment.class);
         assertNotNull(fnu);
-        assertEquals(fnu.getDescription(), readedAugment.getDescription());
-        assertEquals(fnu.getSerialNumber(), readedAugment.getSerialNumber());
+        assertEquals(fnu.getAttrStr2(), readedAugment.getAttrStr2());
+        assertEquals(fnu.getAttrStr3(), readedAugment.getAttrStr3());
 
     }
 
@@ -211,8 +204,8 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
         assertNotNull(node);
     }
 
-    private Nodes checkForNodes() {
-        return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
+    private Top checkForTop() {
+        return (Top) baDataService.readOperationalData(TOP_INSTANCE_ID_BA);
     }
 
     @Override
index 735138a..40d4591 100644 (file)
@@ -9,21 +9,17 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsDataBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatisticsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.List11SimpleAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.List11SimpleAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -32,20 +28,20 @@ import com.google.common.util.concurrent.SettableFuture;
 @SuppressWarnings("deprecation")
 public class DeleteNestedAugmentationListenParentTest extends AbstractDataServiceTest {
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId("foo"));
+    private static final TopLevelListKey FOO_KEY = new TopLevelListKey("foo");
 
-    private static final TableKey TABLE_KEY = new TableKey((short) 0);
+    private static final List1Key LIST1_KEY = new List1Key("one");
 
-    private static final FlowKey FLOW_KEY = new FlowKey(new FlowId("100"));
+    private static final List11Key LIST11_KEY = new List11Key(100);
 
-    private static final InstanceIdentifier<FlowCapableNode> NODE_AUGMENT_PATH = InstanceIdentifier.builder(Nodes.class)
-            .child(Node.class,NODE_KEY)
-            .augmentation(FlowCapableNode.class)
+    private static final InstanceIdentifier<TllComplexAugment> TLL_COMPLEX_AUGMENT_PATH = InstanceIdentifier.builder(Top.class)
+            .child(TopLevelList.class,FOO_KEY)
+            .augmentation(TllComplexAugment.class)
             .build();
 
-    private static final InstanceIdentifier<Flow> FLOW_PATH = NODE_AUGMENT_PATH.builder()
-            .child(Table.class,TABLE_KEY)
-            .child(Flow.class,FLOW_KEY)
+    private static final InstanceIdentifier<List11> LIST11_PATH = TLL_COMPLEX_AUGMENT_PATH.builder()
+            .child(List1.class,LIST1_KEY)
+            .child(List11.class,LIST11_KEY)
             .build();
 
 
@@ -53,12 +49,12 @@ public class DeleteNestedAugmentationListenParentTest extends AbstractDataServic
     public void deleteChildListenParent() throws InterruptedException, ExecutionException {
         DataModificationTransaction initTx = baDataService.beginTransaction();
 
-        initTx.putOperationalData(FLOW_PATH, flow());
+        initTx.putOperationalData(LIST11_PATH, createList11());
         initTx.commit().get();
 
         final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> event = SettableFuture.create();
 
-        baDataService.registerDataChangeListener(FLOW_PATH, new DataChangeListener() {
+        baDataService.registerDataChangeListener(LIST11_PATH, new DataChangeListener() {
 
             @Override
             public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
@@ -67,23 +63,19 @@ public class DeleteNestedAugmentationListenParentTest extends AbstractDataServic
         });
 
         DataModificationTransaction deleteTx = baDataService.beginTransaction();
-        deleteTx.removeOperationalData(FLOW_PATH.augmentation(FlowStatisticsData.class));
+        deleteTx.removeOperationalData(LIST11_PATH.augmentation(List11SimpleAugment.class));
         deleteTx.commit().get();
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedEvent = event.get();
-        assertFalse(receivedEvent.getRemovedOperationalData().contains(NODE_AUGMENT_PATH));
+        assertFalse(receivedEvent.getRemovedOperationalData().contains(TLL_COMPLEX_AUGMENT_PATH));
     }
 
-    private Flow flow() {
-        FlowBuilder builder = new FlowBuilder()
-            .setKey(FLOW_KEY)
-            .addAugmentation(FlowStatisticsData.class,new FlowStatisticsDataBuilder()
-                    .setFlowStatistics(new FlowStatisticsBuilder().build())
-                    .build())
-            .setBarrier(true)
-            .setMatch(new MatchBuilder()
-            .build())
-        ;
+    private List11 createList11() {
+        List11Builder builder = new List11Builder()
+            .setKey(LIST11_KEY)
+            .addAugmentation(List11SimpleAugment.class,new List11SimpleAugmentBuilder()
+                    .setAttrStr2("bad").build())
+            .setAttrStr("good");
         return builder.build();
     }
 
index 7143352..9ad46bb 100644 (file)
@@ -11,39 +11,20 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.BitFlags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -54,41 +35,36 @@ import com.google.common.collect.ImmutableSet;
 
 @SuppressWarnings("deprecation")
 public class FlagsSerializationTest extends AbstractDataServiceTest {
-
-    private static final String FLOW_ID = "1234";
-    private static final short TABLE_ID = (short)0;
-    private static final String NODE_ID = "node:1";
-
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
-    private static final FlowKey FLOW_KEY = new FlowKey(new FlowId(FLOW_ID));
-    private static final TableKey TABLE_KEY = new TableKey(TABLE_ID);
-
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
-            .child(Node.class, NODE_KEY).toInstance();
-
-    private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-            NODE_INSTANCE_ID_BA.builder() //
-            .augmentation(FlowCapableNode.class)
-            .child(Table.class,TABLE_KEY)
-            .child(Flow.class, FLOW_KEY) //
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey("foo");
+    private static final List11Key LIST11_KEY = new List11Key(1234);
+    private static final List1Key LIST1_KEY = new List1Key("1");
+
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
+            .child(TopLevelList.class, TLL_KEY).toInstance();
+
+    private static final InstanceIdentifier<? extends DataObject> LIST11_INSTANCE_ID_BA = //
+            TLL_INSTANCE_ID_BA.builder() //
+            .augmentation(TllComplexAugment.class)
+            .child(List1.class,LIST1_KEY)
+            .child(List11.class, LIST11_KEY) //
             .toInstance();
-    private static final QName FLOW_FLAGS_QNAME = QName.create(Flow.QNAME, "flags");
+    private static final QName LIST11_FLAGS_QNAME = QName.create(List11.QNAME, "flags");
 
     @Test
     public void testIndirectGeneration() throws Exception {
 
-        FlowModFlags checkOverlapFlags = new FlowModFlags(true,false,false,false,false);
-        ImmutableSet<String> domCheckOverlapFlags = ImmutableSet.<String>of("CHECK_OVERLAP");
+        BitFlags checkOverlapFlags = new BitFlags(true,false,false,false,false);
+        ImmutableSet<String> domCheckOverlapFlags = ImmutableSet.<String>of("FLAG_FIVE");
         testFlags(checkOverlapFlags,domCheckOverlapFlags);
 
 
 
-        FlowModFlags allFalseFlags = new FlowModFlags(false,false,false,false,false);
+        BitFlags allFalseFlags = new BitFlags(false,false,false,false,false);
         ImmutableSet<String> domAllFalseFlags = ImmutableSet.<String>of();
         testFlags(allFalseFlags,domAllFalseFlags);
 
-        FlowModFlags allTrueFlags = new FlowModFlags(true,true,true,true,true);
-        ImmutableSet<String> domAllTrueFlags = ImmutableSet.<String>of("CHECK_OVERLAP","NO_BYT_COUNTS", "NO_PKT_COUNTS", "RESET_COUNTS", "SEND_FLOW_REM");
+        BitFlags allTrueFlags = new BitFlags(true,true,true,true,true);
+        ImmutableSet<String> domAllTrueFlags = ImmutableSet.<String>of("FLAG_ONE","FLAG_TWO","FLAG_THREE","FLAG_FOUR","FLAG_FIVE");
         testFlags(allTrueFlags,domAllTrueFlags);
 
         testFlags(null,null);
@@ -97,14 +73,14 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
 
     }
 
-    private void testFlags(final FlowModFlags flagsToTest, final ImmutableSet<String> domFlags) throws Exception {
-        Flow flow = createFlow(flagsToTest);
-        assertNotNull(flow);
+    private void testFlags(final BitFlags flagsToTest, final ImmutableSet<String> domFlags) throws Exception {
+        List11 list11 = createList11(flagsToTest);
+        assertNotNull(list11);
 
-        CompositeNode domFlow = biDataService.readConfigurationData(mappingService.toDataDom(FLOW_INSTANCE_ID_BA));
+        CompositeNode domList11 = biDataService.readConfigurationData(mappingService.toDataDom(LIST11_INSTANCE_ID_BA));
 
-        assertNotNull(domFlow);
-        org.opendaylight.yangtools.yang.data.api.Node<?> readedFlags = domFlow.getFirstSimpleByName(FLOW_FLAGS_QNAME);
+        assertNotNull(domList11);
+        org.opendaylight.yangtools.yang.data.api.Node<?> readedFlags = domList11.getFirstSimpleByName(LIST11_FLAGS_QNAME);
 
         if(domFlags != null) {
             assertNotNull(readedFlags);
@@ -112,55 +88,30 @@ public class FlagsSerializationTest extends AbstractDataServiceTest {
         } else {
             assertNull(readedFlags);
         }
-        assertEquals(flagsToTest, flow.getFlags());
+        assertEquals(flagsToTest, list11.getFlags());
 
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        transaction.removeConfigurationData(FLOW_INSTANCE_ID_BA);
+        transaction.removeConfigurationData(LIST11_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
     }
 
-    private Flow createFlow(final FlowModFlags flagsToTest) throws Exception {
+    private List11 createList11(final BitFlags flagsToTest) throws Exception {
 
         DataModificationTransaction modification = baDataService.beginTransaction();
 
-        FlowBuilder flow = new FlowBuilder();
-        MatchBuilder match = new MatchBuilder();
-        VlanMatchBuilder vlanBuilder = new VlanMatchBuilder();
-        VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
-        VlanId vlanId = new VlanId(10);
-        vlanBuilder.setVlanId(vlanIdBuilder.setVlanId(vlanId).build());
-        match.setVlanMatch(vlanBuilder.build());
-
-        flow.setKey(FLOW_KEY);
-        flow.setMatch(match.build());
-
-        flow.setFlags(flagsToTest);
-
-        InstructionsBuilder instructions = new InstructionsBuilder();
-        InstructionBuilder instruction = new InstructionBuilder();
-
-        instruction.setOrder(10);
-        ApplyActionsBuilder applyActions = new ApplyActionsBuilder();
-        List<Action> actionList = new ArrayList<>();
-        PopMplsActionBuilder popMplsAction = new PopMplsActionBuilder();
-        popMplsAction.setEthernetType(34);
-        actionList.add(new ActionBuilder().setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsAction.build()).build()).setOrder(10).build());
-
-        applyActions.setAction(actionList );
-
-        instruction.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(applyActions.build()).build());
+        List11Builder list11b = new List11Builder();
 
+        list11b.setKey(LIST11_KEY);
+        list11b.setAttrStr("list:1:1");
 
-        List<Instruction> instructionList = Collections.<Instruction>singletonList(instruction.build());
-        instructions.setInstruction(instructionList );
+        list11b.setFlags(flagsToTest);
 
-        flow.setInstructions(instructions.build());
-        modification.putConfigurationData(FLOW_INSTANCE_ID_BA, flow.build());
+        modification.putConfigurationData(LIST11_INSTANCE_ID_BA, list11b.build());
         RpcResult<TransactionStatus> ret = modification.commit().get();
         assertNotNull(ret);
         assertEquals(TransactionStatus.COMMITED, ret.getResult());
-        return (Flow) baDataService.readConfigurationData(FLOW_INSTANCE_ID_BA);
+        return (List11) baDataService.readConfigurationData(LIST11_INSTANCE_ID_BA);
     }
 }
index 767ccaa..9bf6c4d 100644 (file)
@@ -23,19 +23,18 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.NestedListSimpleAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.NestedListSimpleAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.top.level.list.NestedListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -47,35 +46,35 @@ import com.google.common.util.concurrent.SettableFuture;
 @SuppressWarnings("deprecation")
 public class PutAugmentationTest extends AbstractDataServiceTest implements DataChangeListener {
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
-    private static final String NODE_ID = "openflow:1";
+    private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
+    private static final String TLL_NAME = "foo";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TLL_NAME);
 
-    private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
-            NODE_ID);
+    private static final Map<QName, Object> TLL_KEY_BI = Collections.<QName, Object> singletonMap(TLL_NAME_QNAME,
+            TLL_NAME);
 
-    private static final InstanceIdentifier<Nodes> NODES_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
+    private static final InstanceIdentifier<Top> TOP_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
             .toInstance();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = //
-            NODES_INSTANCE_ID_BA.builder() //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = //
+            TOP_INSTANCE_ID_BA.builder() //
+            .child(TopLevelList.class, TLL_KEY).toInstance();
 
-    private static final InstanceIdentifier<FlowCapableNode> ALL_FLOW_CAPABLE_NODES = //
-            NODES_INSTANCE_ID_BA.builder() //
-            .child(Node.class) //
-            .augmentation(FlowCapableNode.class) //
+    private static final InstanceIdentifier<TllComplexAugment> ALL_TCA = //
+            TOP_INSTANCE_ID_BA.builder() //
+            .child(TopLevelList.class) //
+            .augmentation(TllComplexAugment.class) //
             .build();
 
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier NODE_INSTANCE_ID_BI = //
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier TLL_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-            .node(Nodes.QNAME) //
-            .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
+            .node(Top.QNAME) //
+            .nodeWithKey(TopLevelList.QNAME, TLL_KEY_BI) //
             .toInstance();
-    private static final InstanceIdentifier<FlowCapableNode> FLOW_AUGMENTATION_PATH =
-            NODE_INSTANCE_ID_BA.builder() //
-            .augmentation(FlowCapableNode.class) //
+    private static final InstanceIdentifier<TllComplexAugment> TCA_AUGMENTATION_PATH =
+            TLL_INSTANCE_ID_BA.builder() //
+            .augmentation(TllComplexAugment.class) //
             .build();
 
     private SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> lastReceivedChangeEvent;
@@ -89,32 +88,28 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
     @Ignore
     public void putNodeAndAugmentation() throws Exception {
         lastReceivedChangeEvent = SettableFuture.create();
-        baDataService.registerDataChangeListener(ALL_FLOW_CAPABLE_NODES, this);
+        baDataService.registerDataChangeListener(ALL_TCA, this);
 
 
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setId(new NodeId(NODE_ID));
-        nodeBuilder.setKey(NODE_KEY);
+        TopLevelListBuilder nodeBuilder = new TopLevelListBuilder();
+        nodeBuilder.setKey(TLL_KEY);
         DataModificationTransaction baseTransaction = baDataService.beginTransaction();
-        baseTransaction.putOperationalData(NODE_INSTANCE_ID_BA, nodeBuilder.build());
+        baseTransaction.putOperationalData(TLL_INSTANCE_ID_BA, nodeBuilder.build());
         RpcResult<TransactionStatus> result = baseTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-        assertNotNull(node);
-        assertEquals(NODE_KEY, node.getKey());
-
-        FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
-        fnub.setHardware("Hardware Foo");
-        fnub.setManufacturer("Manufacturer Foo");
-        fnub.setSerialNumber("Serial Foo");
-        fnub.setDescription("Description Foo");
-        fnub.setSoftware("JUnit emulated");
-        FlowCapableNode fnu = fnub.build();
-        InstanceIdentifier<FlowCapableNode> augmentIdentifier = NODE_INSTANCE_ID_BA
-                .augmentation(FlowCapableNode.class);
+        TopLevelList tll = (TopLevelList) baDataService.readOperationalData(TLL_INSTANCE_ID_BA);
+        assertNotNull(tll);
+        assertEquals(TLL_KEY, tll.getKey());
+
+        TllComplexAugmentBuilder tcab = new TllComplexAugmentBuilder();
+        tcab.setAttrStr1("FooFoo");
+        tcab.setAttrStr2("BarBar");
+        TllComplexAugment tca = tcab.build();
+        InstanceIdentifier<TreeComplexUsesAugment> augmentIdentifier = TLL_INSTANCE_ID_BA
+                .augmentation(TreeComplexUsesAugment.class);
         DataModificationTransaction augmentedTransaction = baDataService.beginTransaction();
-        augmentedTransaction.putOperationalData(augmentIdentifier, fnu);
+        augmentedTransaction.putOperationalData(augmentIdentifier, tca);
 
 
         lastReceivedChangeEvent = SettableFuture.create();
@@ -123,102 +118,98 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> potential = lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS);
         assertNotNull(potential);
-        assertTrue(potential.getCreatedOperationalData().containsKey(FLOW_AUGMENTATION_PATH));
+        assertTrue(potential.getCreatedOperationalData().containsKey(TCA_AUGMENTATION_PATH));
 
         lastReceivedChangeEvent = SettableFuture.create();
 
-        Node augmentedNode = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-        assertNotNull(node);
-        assertEquals(NODE_KEY, augmentedNode.getKey());
+        TopLevelList augmentedTll = (TopLevelList) baDataService.readOperationalData(TLL_INSTANCE_ID_BA);
+        assertNotNull(tll);
+        assertEquals(TLL_KEY, augmentedTll.getKey());
         System.out.println("Before assertion");
-        assertNotNull(augmentedNode.getAugmentation(FlowCapableNode.class));
-        FlowCapableNode readedAugmentation = augmentedNode.getAugmentation(FlowCapableNode.class);
-        assertEquals(fnu.getDescription(), readedAugmentation.getDescription());
-        assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
-        testNodeRemove();
-        assertTrue(lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS).getRemovedOperationalData().contains(FLOW_AUGMENTATION_PATH));
+        assertNotNull(augmentedTll.getAugmentation(TllComplexAugment.class));
+        TllComplexAugment readedAugmentation = augmentedTll.getAugmentation(TllComplexAugment.class);
+        assertEquals(tca.getAttrStr2(), readedAugmentation.getAttrStr2());
+        assertBindingIndependentVersion(TLL_INSTANCE_ID_BI);
+        testTllRemove();
+        assertTrue(lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS).getRemovedOperationalData().contains(TCA_AUGMENTATION_PATH));
     }
 
     @Test
     @Ignore
     public void putNodeWithAugmentation() throws Exception {
         lastReceivedChangeEvent = SettableFuture.create();
-        baDataService.registerDataChangeListener(ALL_FLOW_CAPABLE_NODES, this);
-
-        NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setId(new NodeId(NODE_ID));
-        nodeBuilder.setKey(NODE_KEY);
-        FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
-        fnub.setHardware("Hardware Foo");
-        fnub.setManufacturer("Manufacturer Foo");
-        fnub.setSerialNumber("Serial Foo");
-        fnub.setDescription("Description Foo");
-        fnub.setSoftware("JUnit emulated");
-        FlowCapableNode fnu = fnub.build();
-
-        nodeBuilder.addAugmentation(FlowCapableNode.class, fnu);
+        baDataService.registerDataChangeListener(ALL_TCA, this);
+
+        TopLevelListBuilder nodeBuilder = new TopLevelListBuilder();
+        nodeBuilder.setKey(TLL_KEY);
+        TllComplexAugmentBuilder tcab = new TllComplexAugmentBuilder();
+        tcab.setAttrStr1("FooFoo");
+        tcab.setAttrStr2("BarBar");
+        TllComplexAugment tca = tcab.build();
+
+        nodeBuilder.addAugmentation(TreeComplexUsesAugment.class, tca);
         DataModificationTransaction baseTransaction = baDataService.beginTransaction();
-        baseTransaction.putOperationalData(NODE_INSTANCE_ID_BA, nodeBuilder.build());
+        baseTransaction.putOperationalData(TLL_INSTANCE_ID_BA, nodeBuilder.build());
         RpcResult<TransactionStatus> result = baseTransaction.commit().get();
 
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> potential = lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS);
         assertNotNull(potential);
-        assertTrue(potential.getCreatedOperationalData().containsKey(FLOW_AUGMENTATION_PATH));
+        assertTrue(potential.getCreatedOperationalData().containsKey(TCA_AUGMENTATION_PATH));
         lastReceivedChangeEvent = SettableFuture.create();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(
-                NODE_INSTANCE_ID_BA.augmentation(FlowCapableNode.class));
+        TllComplexAugment readedAugmentation = (TllComplexAugment) baDataService.readOperationalData(
+                TLL_INSTANCE_ID_BA.augmentation(TllComplexAugment.class));
         assertNotNull(readedAugmentation);
 
-        assertEquals(fnu.getHardware(), readedAugmentation.getHardware());
+        assertEquals(tca.getAttrStr1(), readedAugmentation.getAttrStr1());
 
         testPutNodeConnectorWithAugmentation();
         lastReceivedChangeEvent = SettableFuture.create();
-        testNodeRemove();
+        testTllRemove();
 
-        assertTrue(lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS).getRemovedOperationalData().contains(FLOW_AUGMENTATION_PATH));
+        assertTrue(lastReceivedChangeEvent.get(1000,TimeUnit.MILLISECONDS).getRemovedOperationalData().contains(TCA_AUGMENTATION_PATH));
     }
 
     private void testPutNodeConnectorWithAugmentation() throws Exception {
-        NodeConnectorKey ncKey = new NodeConnectorKey(new NodeConnectorId("test:0:0"));
-        InstanceIdentifier<NodeConnector> ncPath = NODE_INSTANCE_ID_BA
-                .child(NodeConnector.class, ncKey);
-        InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = ncPath
-                .augmentation(FlowCapableNodeConnector.class);
+        NestedListKey ncKey = new NestedListKey("test:0:0");
+        InstanceIdentifier<NestedList> ncPath = TLL_INSTANCE_ID_BA
+                .child(NestedList.class, ncKey);
+        InstanceIdentifier<NestedListSimpleAugment> ncAugmentPath = ncPath
+                .augmentation(NestedListSimpleAugment.class);
 
-        NodeConnectorBuilder nc = new NodeConnectorBuilder();
+        NestedListBuilder nc = new NestedListBuilder();
         nc.setKey(ncKey);
 
-        FlowCapableNodeConnectorBuilder fncb = new FlowCapableNodeConnectorBuilder();
-        fncb.setName("Baz");
-        nc.addAugmentation(FlowCapableNodeConnector.class, fncb.build());
+        NestedListSimpleAugmentBuilder fncb = new NestedListSimpleAugmentBuilder();
+        fncb.setType("Baz");
+        nc.addAugmentation(NestedListSimpleAugment.class, fncb.build());
 
         DataModificationTransaction baseTransaction = baDataService.beginTransaction();
         baseTransaction.putOperationalData(ncPath, nc.build());
         RpcResult<TransactionStatus> result = baseTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        FlowCapableNodeConnector readedAugmentation = (FlowCapableNodeConnector) baDataService
+        NestedListSimpleAugment readedAugmentation = (NestedListSimpleAugment) baDataService
                 .readOperationalData(ncAugmentPath);
         assertNotNull(readedAugmentation);
-        assertEquals(fncb.getName(), readedAugmentation.getName());
+        assertEquals(fncb.getType(), readedAugmentation.getType());
     }
 
-    private void testNodeRemove() throws Exception {
+    private void testTllRemove() throws Exception {
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        transaction.removeOperationalData(NODE_INSTANCE_ID_BA);
+        transaction.removeOperationalData(TLL_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
-        assertNull(node);
+        TopLevelList tll = (TopLevelList) baDataService.readOperationalData(TLL_INSTANCE_ID_BA);
+        assertNull(tll);
     }
 
-    private void assertBindingIndependentVersion(final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier nodeId) {
-        CompositeNode node = biDataService.readOperationalData(nodeId);
-        assertNotNull(node);
+    private void assertBindingIndependentVersion(final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tllId) {
+        CompositeNode tll = biDataService.readOperationalData(tllId);
+        assertNotNull(tll);
     }
 
     @Override
index b09ba39..0f9051d 100644 (file)
@@ -18,13 +18,13 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -34,17 +34,17 @@ import com.google.common.util.concurrent.SettableFuture;
 @SuppressWarnings("deprecation")
 public class WriteParentListenAugmentTest extends AbstractDataServiceTest {
 
-    private static final String NODE_ID = "node:1";
+    private static final String TLL_NAME = "foo";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TLL_NAME);
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
+            .child(TopLevelList.class, TLL_KEY).toInstance();
 
-    private static final InstanceIdentifier<FlowCapableNode> AUGMENT_WILDCARDED_PATH = InstanceIdentifier
-            .builder(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class).toInstance();
+    private static final InstanceIdentifier<TreeComplexUsesAugment> AUGMENT_WILDCARDED_PATH = InstanceIdentifier
+            .builder(Top.class).child(TopLevelList.class).augmentation(TreeComplexUsesAugment.class).toInstance();
 
-    private static final InstanceIdentifier<FlowCapableNode> AUGMENT_NODE_PATH = InstanceIdentifier
-            .builder(Nodes.class).child(Node.class, NODE_KEY).augmentation(FlowCapableNode.class).toInstance();
+    private static final InstanceIdentifier<TreeComplexUsesAugment> AUGMENT_TLL_PATH = InstanceIdentifier
+            .builder(Top.class).child(TopLevelList.class, TLL_KEY).augmentation(TreeComplexUsesAugment.class).toInstance();
 
     @Test
     public void writeNodeListenAugment() throws Exception {
@@ -62,29 +62,29 @@ public class WriteParentListenAugmentTest extends AbstractDataServiceTest {
 
         DataModificationTransaction modification = baDataService.beginTransaction();
 
-        Node node = new NodeBuilder() //
-                .setKey(NODE_KEY) //
-                .addAugmentation(FlowCapableNode.class, flowCapableNode("one")).build();
-        modification.putOperationalData(NODE_INSTANCE_ID_BA, node);
+        TopLevelList tll = new TopLevelListBuilder() //
+                .setKey(TLL_KEY) //
+                .addAugmentation(TreeComplexUsesAugment.class, treeComplexUsesAugment("one")).build();
+        modification.putOperationalData(TLL_INSTANCE_ID_BA, tll);
         modification.commit().get();
 
         DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedEvent = event.get(1000, TimeUnit.MILLISECONDS);
-        assertTrue(receivedEvent.getCreatedOperationalData().containsKey(AUGMENT_NODE_PATH));
+        assertTrue(receivedEvent.getCreatedOperationalData().containsKey(AUGMENT_TLL_PATH));
 
         dclRegistration.close();
 
         DataModificationTransaction mod2 = baDataService.beginTransaction();
-        mod2.putOperationalData(AUGMENT_NODE_PATH, flowCapableNode("two"));
+        mod2.putOperationalData(AUGMENT_TLL_PATH, treeComplexUsesAugment("two"));
         mod2.commit().get();
 
-        FlowCapableNode readedAug = (FlowCapableNode) baDataService.readOperationalData(AUGMENT_NODE_PATH);
-        assertEquals("two", readedAug.getDescription());
+        TreeComplexUsesAugment readedAug = (TreeComplexUsesAugment) baDataService.readOperationalData(AUGMENT_TLL_PATH);
+        assertEquals("two", readedAug.getContainerWithUses().getLeafFromGrouping());
 
     }
 
-    private FlowCapableNode flowCapableNode(final String description) {
-        return new FlowCapableNodeBuilder() //
-                .setDescription(description) //
+    private TreeComplexUsesAugment treeComplexUsesAugment(final String value) {
+        return new TreeComplexUsesAugmentBuilder() //
+                .setContainerWithUses(new ContainerWithUsesBuilder().setLeafFromGrouping(value).build()) //
                 .build();
     }
 }
\ No newline at end of file
index ad02d9a..7941f4d 100644 (file)
@@ -16,24 +16,16 @@ import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -43,23 +35,23 @@ import com.google.common.collect.ImmutableList;
 @SuppressWarnings("deprecation")
 public class WriteParentReadChildTest extends AbstractDataServiceTest {
 
-    private static final String FLOW_ID = "1234";
-    private static final short TABLE_ID = (short) 0;
-    private static final String NODE_ID = "node:1";
+    private static final int LIST11_ID = 1234;
+    private static final String LIST1_NAME = "bar";
+    private static final String TLL_NAME = "foo";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
-    private static final FlowKey FLOW_KEY = new FlowKey(new FlowId(FLOW_ID));
-    private static final TableKey TABLE_KEY = new TableKey(TABLE_ID);
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TLL_NAME);
+    private static final List11Key LIST11_KEY = new List11Key(LIST11_ID);
+    private static final List1Key LIST1_KEY = new List1Key(LIST1_NAME);
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
+            .child(TopLevelList.class, TLL_KEY).toInstance();
 
-    private static final InstanceIdentifier<Table> TABLE_INSTANCE_ID_BA = //
-            NODE_INSTANCE_ID_BA.builder() //
-            .augmentation(FlowCapableNode.class).child(Table.class, TABLE_KEY).build();
+    private static final InstanceIdentifier<List1> LIST1_INSTANCE_ID_BA = //
+            TLL_INSTANCE_ID_BA.builder() //
+            .augmentation(TllComplexAugment.class).child(List1.class, LIST1_KEY).build();
 
-    private static final InstanceIdentifier<? extends DataObject> FLOW_INSTANCE_ID_BA = //
-            TABLE_INSTANCE_ID_BA.child(Flow.class, FLOW_KEY);
+    private static final InstanceIdentifier<? extends DataObject> LIST11_INSTANCE_ID_BA = //
+            LIST1_INSTANCE_ID_BA.child(List11.class, LIST11_KEY);
     /**
      *
      * The scenario tests writing parent node, which also contains child items
@@ -70,43 +62,33 @@ public class WriteParentReadChildTest extends AbstractDataServiceTest {
      * @throws Exception
      */
     @Test
-    public void writeTableReadFlow() throws Exception {
+    public void writeParentReadChild() throws Exception {
 
         DataModificationTransaction modification = baDataService.beginTransaction();
 
-        Flow flow = new FlowBuilder() //
-                .setKey(FLOW_KEY) //
-                .setMatch(new MatchBuilder() //
-                        .setVlanMatch(new VlanMatchBuilder() //
-                                .setVlanId(new VlanIdBuilder() //
-                                        .setVlanId(new VlanId(10)) //
-                                        .build()) //
-                                .build()) //
-                        .build()) //
-                        .setInstructions(new InstructionsBuilder() //
-                            .setInstruction(ImmutableList.<Instruction>builder() //
-                                    .build()) //
-                        .build()) //
+        List11 list11 = new List11Builder() //
+                .setKey(LIST11_KEY) //
+                .setAttrStr("primary")
                 .build();
 
-        Table table = new TableBuilder()
-            .setKey(TABLE_KEY)
-            .setFlow(ImmutableList.of(flow))
+        List1 list1 = new List1Builder()
+            .setKey(LIST1_KEY)
+            .setList11(ImmutableList.of(list11))
         .build();
 
-        modification.putConfigurationData(TABLE_INSTANCE_ID_BA, table);
+        modification.putConfigurationData(LIST1_INSTANCE_ID_BA, list1);
         RpcResult<TransactionStatus> ret = modification.commit().get();
         assertNotNull(ret);
         assertEquals(TransactionStatus.COMMITED, ret.getResult());
 
-        DataObject readedTable = baDataService.readConfigurationData(TABLE_INSTANCE_ID_BA);
-        assertNotNull("Readed table should not be nul.", readedTable);
-        assertTrue(readedTable instanceof Table);
+        DataObject readList1 = baDataService.readConfigurationData(LIST1_INSTANCE_ID_BA);
+        assertNotNull("Readed table should not be nul.", readList1);
+        assertTrue(readList1 instanceof List1);
 
-        DataObject readedFlow = baDataService.readConfigurationData(FLOW_INSTANCE_ID_BA);
-        assertNotNull("Readed flow should not be null.",readedFlow);
-        assertTrue(readedFlow instanceof Flow);
-        assertEquals(flow, readedFlow);
+        DataObject readList11 = baDataService.readConfigurationData(LIST11_INSTANCE_ID_BA);
+        assertNotNull("Readed flow should not be null.",readList11);
+        assertTrue(readList11 instanceof List11);
+        assertEquals(list11, readList11);
 
     }
 }
index 481a7dd..3027eaa 100644 (file)
@@ -17,12 +17,10 @@ import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -31,16 +29,23 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 @SuppressWarnings("deprecation")
 public class BrokerIntegrationTest extends AbstractDataServiceTest {
 
+    private static final TopLevelListKey TLL_FOO_KEY = new TopLevelListKey("foo");
+    private static final TopLevelListKey TLL_BAR_KEY = new TopLevelListKey("bar");
+    private static final TopLevelListKey TLL_BAZ_KEY = new TopLevelListKey("baz");
+    private static final InstanceIdentifier<Top> TOP_PATH = InstanceIdentifier.builder(Top.class).build();
+    private static final InstanceIdentifier<TopLevelList> FOO_PATH = TOP_PATH.child(TopLevelList.class, TLL_FOO_KEY);
+    private static final InstanceIdentifier<TopLevelList> BAR_PATH = TOP_PATH.child(TopLevelList.class, TLL_BAR_KEY);
+    private static final InstanceIdentifier<TopLevelList> BAZ_PATH = TOP_PATH.child(TopLevelList.class, TLL_BAZ_KEY);
+
     @Test
     public void simpleModifyOperation() throws Exception {
 
-        NodeRef node1 = createNodeRef("0");
-        DataObject node = baDataService.readConfigurationData(node1.getValue());
-        assertNull(node);
-        Node nodeData1 = createNode("0");
+        DataObject tllFoo = baDataService.readConfigurationData(FOO_PATH);
+        assertNull(tllFoo);
+        TopLevelList tllFooData = createTll(TLL_FOO_KEY);
 
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        transaction.putConfigurationData(node1.getValue(), nodeData1);
+        transaction.putConfigurationData(FOO_PATH, tllFooData);
         Future<RpcResult<TransactionStatus>> commitResult = transaction.commit();
         assertNotNull(commitResult);
 
@@ -50,29 +55,26 @@ public class BrokerIntegrationTest extends AbstractDataServiceTest {
         assertNotNull(result.getResult());
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Node readedData = (Node) baDataService.readConfigurationData(node1.getValue());
+        TopLevelList readedData = (TopLevelList) baDataService.readConfigurationData(FOO_PATH);
         assertNotNull(readedData);
-        assertEquals(nodeData1.getKey(), readedData.getKey());
+        assertEquals(tllFooData.getKey(), readedData.getKey());
 
-        NodeRef nodeFoo = createNodeRef("foo");
-        NodeRef nodeBar = createNodeRef("bar");
-        Node nodeFooData = createNode("foo");
-        Node nodeBarData = createNode("bar");
+        TopLevelList nodeBarData = createTll(TLL_BAR_KEY);
+        TopLevelList nodeBazData = createTll(TLL_BAZ_KEY);
 
         DataModificationTransaction insertMoreTr = baDataService.beginTransaction();
-        insertMoreTr.putConfigurationData(nodeFoo.getValue(), nodeFooData);
-        insertMoreTr.putConfigurationData(nodeBar.getValue(), nodeBarData);
+        insertMoreTr.putConfigurationData(BAR_PATH, nodeBarData);
+        insertMoreTr.putConfigurationData(BAZ_PATH, nodeBazData);
         RpcResult<TransactionStatus> result2 = insertMoreTr.commit().get();
 
         assertNotNull(result2);
         assertNotNull(result2.getResult());
         assertEquals(TransactionStatus.COMMITED, result.getResult());
 
-        Nodes allNodes = (Nodes) baDataService.readConfigurationData(InstanceIdentifier.builder(Nodes.class)
-                .toInstance());
-        assertNotNull(allNodes);
-        assertNotNull(allNodes.getNode());
-        assertEquals(3, allNodes.getNode().size());
+        Top top = (Top) baDataService.readConfigurationData(TOP_PATH);
+        assertNotNull(top);
+        assertNotNull(top.getTopLevelList());
+        assertEquals(3, top.getTopLevelList().size());
 
         /**
          * We create transaction no 2
@@ -85,7 +87,7 @@ public class BrokerIntegrationTest extends AbstractDataServiceTest {
          * We remove node 1
          *
          */
-        removalTransaction.removeConfigurationData(node1.getValue());
+        removalTransaction.removeConfigurationData(BAR_PATH);
 
         /**
          * We commit transaction
@@ -99,21 +101,13 @@ public class BrokerIntegrationTest extends AbstractDataServiceTest {
         assertNotNull(result3.getResult());
         assertEquals(TransactionStatus.COMMITED, result2.getResult());
 
-        DataObject readedData2 = baDataService.readConfigurationData(node1.getValue());
+        DataObject readedData2 = baDataService.readConfigurationData(BAR_PATH);
         assertNull(readedData2);
     }
 
-    private static NodeRef createNodeRef(final String string) {
-        NodeKey key = new NodeKey(new NodeId(string));
-        InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class).child(Node.class, key)
-                .toInstance();
-        return new NodeRef(path);
-    }
-
-    private static Node createNode(final String string) {
-        NodeBuilder ret = new NodeBuilder();
-        ret.setId(new NodeId(string));
-        ret.setKey(new NodeKey(ret.getId()));
+    private static TopLevelList createTll(final TopLevelListKey key) {
+        TopLevelListBuilder ret = new TopLevelListBuilder();
+        ret.setKey(key);
         return ret.build();
     }
 }
index a3b0819..5a436c8 100644 (file)
@@ -11,9 +11,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
-import java.util.ArrayList;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
@@ -23,34 +21,17 @@ import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.core.api.data.DataModificationTransaction;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpVersion;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List12Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List12Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -59,6 +40,7 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.SettableFuture;
 
@@ -68,74 +50,67 @@ public class ChangeOriginatedInDomBrokerTest extends AbstractDataServiceTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(ChangeOriginatedInDomBrokerTest.class);
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
-    private static final QName FLOW_ID_QNAME = QName.create(Flow.QNAME, "id");
-    private static final QName TABLE_ID_QNAME = QName.create(Table.QNAME, "id");
+    private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
+    private static final QName LIST1_ATTR_STR_QNAME = QName.create(List1.QNAME, "attr-str");
 
-    private static final String NODE_ID = "node:1";
-    private static final FlowId FLOW_ID = new FlowId("1234");
-    private static final Short TABLE_ID = Short.valueOf((short) 0);
+    private static final String TLL_NAME = "1";
+    private static final int LIST11_ATTR_INT = 1234;
+    private static final String LIST1_ATTR_STR = "foo:foo";
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
-    private static final FlowKey FLOW_KEY = new FlowKey(FLOW_ID);
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TLL_NAME);
+    private static final List1Key LIST1_KEY = new List1Key(LIST1_ATTR_STR);
+    private static final List11Key LIST11_KEY = new List11Key(LIST11_ATTR_INT);
 
     private final SettableFuture<DataChangeEvent<InstanceIdentifier<?>, DataObject>> modificationCapture = SettableFuture.create();
 
-    private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
-            NODE_ID);
+    private static final Map<QName, Object> TLL_KEY_BI = Collections.<QName, Object> singletonMap(TLL_NAME_QNAME,
+            TLL_NAME);
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
-            .child(Node.class, NODE_KEY).toInstance();
+    private static final InstanceIdentifier<TopLevelList> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
+            .child(TopLevelList.class, TLL_KEY).toInstance();
 
-    private static final Map<QName, Object> FLOW_KEY_BI = //
-    ImmutableMap.<QName, Object> of(FLOW_ID_QNAME, FLOW_ID.getValue());
+    private static final Map<QName, Object> LIST1_KEY_BI = //
+    ImmutableMap.<QName, Object> of(LIST1_ATTR_STR_QNAME, LIST1_ATTR_STR);;
 
-    private static final Map<QName, Object> TABLE_KEY_BI = //
-    ImmutableMap.<QName, Object> of(TABLE_ID_QNAME, TABLE_ID);;
-
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier FLOW_INSTANCE_ID_BI = //
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier LIST1_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-            .node(Nodes.QNAME) //
-            .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
-            .nodeWithKey(Table.QNAME, TABLE_KEY_BI) //
-            .nodeWithKey(Flow.QNAME, FLOW_KEY_BI) //
+            .node(Top.QNAME) //
+            .nodeWithKey(TopLevelList.QNAME, TLL_KEY_BI) //
+            .nodeWithKey(List1.QNAME, LIST1_KEY_BI) //
             .toInstance();
-    private static final TableKey TABLE_KEY_BA = new TableKey((short) 0);
 
-    private static final InstanceIdentifier<Flow> FLOWS_PATH_BA = //
+    private static final InstanceIdentifier<List1> LIST1_PATH_BA = //
             NODE_INSTANCE_ID_BA.builder() //
-            .augmentation(FlowCapableNode.class) //
-            .child(Table.class, TABLE_KEY_BA) //
-            .child(Flow.class) //
+            .augmentation(TllComplexAugment.class) //
+            .child(List1.class, LIST1_KEY) //
             .toInstance();
 
-    private static final InstanceIdentifier<Flow> FLOW_INSTANCE_ID_BA = //
-    FLOWS_PATH_BA.firstIdentifierOf(Table.class).child(Flow.class, FLOW_KEY);
-
     @Test
     public void simpleModifyOperation() throws Exception {
 
-        assertNull(biDataService.readConfigurationData(FLOW_INSTANCE_ID_BI));
+        assertNull(biDataService.readConfigurationData(LIST1_INSTANCE_ID_BI));
 
         registerChangeListener();
 
-        CompositeNode domflow = createTestFlow();
+        CompositeNode domflow = createTestList1();
         DataModificationTransaction biTransaction = biDataService.beginTransaction();
-        biTransaction.putConfigurationData(FLOW_INSTANCE_ID_BI, domflow);
+        biTransaction.putConfigurationData(LIST1_INSTANCE_ID_BI, domflow);
         RpcResult<TransactionStatus> biResult = biTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, biResult.getResult());
         DataChangeEvent<InstanceIdentifier<?>, DataObject> event = modificationCapture.get(1000,TimeUnit.MILLISECONDS);
         assertNotNull(event);
         LOG.info("Created Configuration :{}",event.getCreatedConfigurationData());
-        Flow flow = (Flow) event.getCreatedConfigurationData().get(FLOW_INSTANCE_ID_BA);
-        assertNotNull(flow);
-        assertNotNull(flow.getMatch());
+        List1 list1 = (List1) event.getCreatedConfigurationData().get(LIST1_PATH_BA);
+        assertNotNull(list1);
+        assertNotNull(list1.getAttrStr());
+        assertNotNull(list1.getList11());
+        assertNotNull(list1.getList12());
         assertEquals(TransactionStatus.COMMITED, biResult.getResult());
 
     }
 
     private void registerChangeListener() {
-        baDataService.registerDataChangeListener(FLOWS_PATH_BA, new DataChangeListener() {
+        baDataService.registerDataChangeListener(LIST1_PATH_BA, new DataChangeListener() {
 
             @Override
             public void onDataChanged(final DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
@@ -145,61 +120,18 @@ public class ChangeOriginatedInDomBrokerTest extends AbstractDataServiceTest {
         });
     }
 
-    private CompositeNode createTestFlow() {
-        FlowBuilder flow = new FlowBuilder();
-        flow.setKey(FLOW_KEY);
-        Short tableId = 0;
-        flow.setTableId(tableId);
-        MatchBuilder match = new MatchBuilder();
-        match.setIpMatch(new IpMatchBuilder().setIpProto(IpVersion.Ipv4).build());
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        // ipv4Match.setIpv4Destination(new Ipv4Prefix(cliInput.get(4)));
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
-        ipv4Match.setIpv4Destination(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-        flow.setMatch(match.build());
-
-
-
-        // Create a drop action
-        /*
-         * Note: We are mishandling drop actions DropAction dropAction = new
-         * DropActionBuilder().build(); ActionBuilder ab = new ActionBuilder();
-         * ab.setAction(dropAction);
-         */
-
-        DecNwTtl decNwTtl = new DecNwTtlBuilder().build();
-        ActionBuilder ab = new ActionBuilder();
-        ActionKey actionKey = new ActionKey(0);
-        ab.setKey(actionKey );
-        ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
-
-        // Add our drop action to a list
-        List<Action> actionList = new ArrayList<Action>();
-        actionList.add(ab.build());
-
-        // Create an Apply Action
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();
-        aab.setAction(actionList);
-
-        // Wrap our Apply Action in an Instruction
-        InstructionBuilder ib = new InstructionBuilder();
-        ib.setOrder(0);
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
-
-        // Put our Instruction in a list of Instructions
-        InstructionsBuilder isb = new InstructionsBuilder();
-        List<Instruction> instructions = new ArrayList<Instruction>();
-        instructions.add(ib.build());
-        isb.setInstruction(instructions);
-
-        // Add our instructions to the flow
-        flow.setInstructions(isb.build());
-
-        flow.setPriority(2);
-        flow.setFlowName("Foo Name");
-        CompositeNode domFlow = mappingService.toDataDom(flow.build());
-        return domFlow;
+    private CompositeNode createTestList1() {
+        List1Builder l1b = new List1Builder();
+        List11Builder l11b = new List11Builder();
+        List12Builder l12b = new List12Builder();
+        l11b.setKey(LIST11_KEY);
+        l11b.setAttrStr("foo:foo:foo");
+        l12b.setKey(new List12Key(321));
+        l12b.setAttrStr("foo:foo:bar");
+        l1b.setKey(LIST1_KEY);
+        l1b.setList11(ImmutableList.of(l11b.build()));
+        l1b.setList12(ImmutableList.of(l12b.build()));
+        CompositeNode domList1 = mappingService.toDataDom(l1b.build());
+        return domList1;
     }
 }
index d87470a..f199d71 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.controller.sal.binding.test.connect.dom;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
-import java.math.BigInteger;
 import java.util.Collections;
 import java.util.Map;
 
@@ -23,16 +22,16 @@ import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactor
 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.List11SimpleAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.TllComplexAugment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.List1Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.aug.grouping.list1.List11Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.top.top.level.list.list1.list1._1.Cont;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
@@ -43,39 +42,45 @@ import com.google.common.util.concurrent.MoreExecutors;
 @SuppressWarnings("deprecation")
 public class CrossBrokerMountPointTest {
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
-    private static final String NODE_ID = "node:1";
+    private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
+    private static final String TLL_NAME = "foo:1";
+
+    private static final TopLevelListKey TLL_KEY = new TopLevelListKey(TLL_NAME);
 
-    private static final NodeKey NODE_KEY = new NodeKey(new NodeId(NODE_ID));
+    private static final Map<QName, Object> TLL_KEY_BI = Collections.<QName, Object> singletonMap(TLL_NAME_QNAME,
+            TLL_NAME);
 
-    private static final Map<QName, Object> NODE_KEY_BI = Collections.<QName, Object> singletonMap(NODE_ID_QNAME,
-            NODE_ID);
+    private static final InstanceIdentifier<TopLevelList> TLL_INSTANCE_ID_BA = InstanceIdentifier.builder(Top.class) //
+            .child(TopLevelList.class, TLL_KEY).build();
 
-    private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier.builder(Nodes.class) //
-            .child(Node.class, NODE_KEY).toInstance();
-    private static GroupKey GROUP_KEY = new GroupKey(new GroupId(0L));
+    private static final List1Key LIST1_KEY = new List1Key("foo");
+    private static final List11Key LIST11_KEY = new List11Key(1);
 
-    private static final InstanceIdentifier<GroupStatistics> GROUP_STATISTICS_ID_BA = NODE_INSTANCE_ID_BA
-            .builder().augmentation(FlowCapableNode.class) //
-            .child(Group.class, GROUP_KEY) //
-            .augmentation(NodeGroupStatistics.class) //
-            .child(GroupStatistics.class) //
-            .toInstance();
+    private static final InstanceIdentifier<Cont> AUG_CONT_ID_BA = TLL_INSTANCE_ID_BA
+            .builder().augmentation(TllComplexAugment.class) //
+            .child(List1.class, LIST1_KEY) //
+            .child(List11.class, LIST11_KEY) //
+            .augmentation(List11SimpleAugment.class) //
+            .child(Cont.class) //
+            .build();
 
-    private static final QName AUGMENTED_GROUP_STATISTICS = QName.create(NodeGroupStatistics.QNAME,
-            GroupStatistics.QNAME.getLocalName());
+    private static final QName AUG_CONT = QName.create(List11.QNAME,
+            Cont.QNAME.getLocalName());
 
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier NODE_INSTANCE_ID_BI = //
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier TLL_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder() //
-            .node(Nodes.QNAME) //
-            .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
-            .toInstance();
+            .node(Top.QNAME) //
+            .nodeWithKey(TopLevelList.QNAME, TLL_KEY_BI) //
+            .build();
 
     private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier GROUP_STATISTICS_ID_BI = org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
             //
-            .builder(NODE_INSTANCE_ID_BI)
-            .nodeWithKey(QName.create(FlowCapableNode.QNAME, "group"), QName.create(FlowCapableNode.QNAME, "group-id"),
-                    0L).node(AUGMENTED_GROUP_STATISTICS).toInstance();
+            .builder(TLL_INSTANCE_ID_BI)
+            .nodeWithKey(QName.create(TllComplexAugment.QNAME, "list1"), QName.create(TllComplexAugment.QNAME, "attr-str"),
+                    LIST1_KEY.getAttrStr())
+            .nodeWithKey(QName.create(TllComplexAugment.QNAME, "list1-1"), QName.create(TllComplexAugment.QNAME, "attr-int"),
+                    LIST11_KEY.getAttrInt())
+            .node(AUG_CONT).build();
 
     private BindingTestContext testContext;
     private MountProviderService bindingMountPointService;
@@ -102,14 +107,14 @@ public class CrossBrokerMountPointTest {
     @Test
     public void testMountPoint() {
 
-        testContext.getBindingDataBroker().readOperationalData(NODE_INSTANCE_ID_BA);
+        testContext.getBindingDataBroker().readOperationalData(TLL_INSTANCE_ID_BA);
 
-        MountProvisionInstance domMountPoint = domMountPointService.createMountPoint(NODE_INSTANCE_ID_BI);
+        MountProvisionInstance domMountPoint = domMountPointService.createMountPoint(TLL_INSTANCE_ID_BI);
         assertNotNull(domMountPoint);
-        MountProviderInstance bindingMountPoint = bindingMountPointService.getMountPoint(NODE_INSTANCE_ID_BA);
+        MountProviderInstance bindingMountPoint = bindingMountPointService.getMountPoint(TLL_INSTANCE_ID_BA);
         assertNotNull(bindingMountPoint);
 
-        final BigInteger packetCount = BigInteger.valueOf(500L);
+        final Integer attrIntalue = 500;
 
 
         DataReader<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode> simpleReader = new DataReader<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode>() {
@@ -125,9 +130,9 @@ public class CrossBrokerMountPointTest {
                 if (arg0.equals(GROUP_STATISTICS_ID_BI)) {
                     ImmutableCompositeNode data = ImmutableCompositeNode
                             .builder()
-                            .setQName(AUGMENTED_GROUP_STATISTICS)
-                            .addLeaf(QName.create(AUGMENTED_GROUP_STATISTICS, "packet-count"), packetCount) //
-                            .toInstance();
+                            .setQName(AUG_CONT)
+                            .addLeaf(QName.create(AUG_CONT, "attr-int"), attrIntalue) //
+                            .build();
 
                     return data;
                 }
@@ -135,10 +140,10 @@ public class CrossBrokerMountPointTest {
             }
 
         };
-        domMountPoint.registerOperationalReader(NODE_INSTANCE_ID_BI, simpleReader);
+        domMountPoint.registerOperationalReader(TLL_INSTANCE_ID_BI, simpleReader);
 
-        GroupStatistics data = (GroupStatistics) bindingMountPoint.readOperationalData(GROUP_STATISTICS_ID_BA);
+        Cont data = (Cont) bindingMountPoint.readOperationalData(AUG_CONT_ID_BA);
         assertNotNull(data);
-        assertEquals(packetCount,data.getPacketCount().getValue());
+        assertEquals(attrIntalue ,data.getAttrInt());
     }
 }
index ba75d57..83c2f88 100644 (file)
@@ -12,11 +12,10 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
-import java.math.BigInteger;
-import java.util.Collections;
-import java.util.Set;
-import java.util.concurrent.Future;
-
+import com.google.common.collect.ImmutableSet;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -25,19 +24,15 @@ import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactor
 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
 import org.opendaylight.controller.sal.core.api.RpcImplementation;
 import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlowRemoved;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.OpendaylightOfMigrationTestModelService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.rpc.routing.rev140701.TestContext;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -45,38 +40,31 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.impl.CompositeNodeTOImpl;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.MoreExecutors;
+import java.util.Collections;
+import java.util.Set;
+import java.util.concurrent.Future;
 
 public class CrossBrokerRpcTest {
 
-    protected RpcProviderRegistry baRpcRegistry;
-    protected RpcProvisionRegistry biRpcRegistry;
+    protected RpcProviderRegistry providerRegistry;
+    protected RpcProvisionRegistry provisionRegistry;
     private BindingTestContext testContext;
     private RpcImplementation biRpcInvoker;
-    private MessageCapturingFlowService flowService;
+    private MessageCapturingFlowService knockService;
 
-    public static final NodeId NODE_A = new NodeId("a");
-    public static final NodeId NODE_B = new NodeId("b");
-    public static final NodeId NODE_C = new NodeId("c");
-    public static final NodeId NODE_D = new NodeId("d");
+    public static final TopLevelListKey NODE_A = new TopLevelListKey("a");
+    public static final TopLevelListKey NODE_B = new TopLevelListKey("b");
+    public static final TopLevelListKey NODE_C = new TopLevelListKey("c");
 
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
-    private static final QName ADD_FLOW_QNAME = QName.create(NodeFlowRemoved.QNAME, "add-flow");
+    private static final QName NODE_ID_QNAME = QName.create(TopLevelList.QNAME, "name");
+    private static final QName KNOCK_KNOCK_QNAME = QName.create(KnockKnockOutput.QNAME, "knock-knock");
 
-    public static final InstanceIdentifier<Node> BA_NODE_A_ID = createBANodeIdentifier(NODE_A);
-    public static final InstanceIdentifier<Node> BA_NODE_B_ID = createBANodeIdentifier(NODE_B);
-    public static final InstanceIdentifier<Node> BA_NODE_C_ID = createBANodeIdentifier(NODE_C);
-    public static final InstanceIdentifier<Node> BA_NODE_D_ID = createBANodeIdentifier(NODE_D);
+    public static final InstanceIdentifier<Top> NODES_PATH = InstanceIdentifier.builder(Top.class).build();
+    public static final InstanceIdentifier<TopLevelList> BA_NODE_A_ID = NODES_PATH.child(TopLevelList.class, NODE_A);
+    public static final InstanceIdentifier<TopLevelList> BA_NODE_B_ID = NODES_PATH.child(TopLevelList.class, NODE_B);
+    public static final InstanceIdentifier<TopLevelList> BA_NODE_C_ID = NODES_PATH.child(TopLevelList.class, NODE_C);
 
-    public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_NODE_A_ID = createBINodeIdentifier(NODE_A);
-    public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_NODE_B_ID = createBINodeIdentifier(NODE_B);
     public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_NODE_C_ID = createBINodeIdentifier(NODE_C);
-    public static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_NODE_D_ID = createBINodeIdentifier(NODE_D);
-
 
 
     @Before
@@ -87,48 +75,49 @@ public class CrossBrokerRpcTest {
         testContext = testFactory.getTestContext();
 
         testContext.start();
-        baRpcRegistry = testContext.getBindingRpcRegistry();
-        biRpcRegistry = testContext.getDomRpcRegistry();
+        providerRegistry = testContext.getBindingRpcRegistry();
+        provisionRegistry = testContext.getDomRpcRegistry();
         biRpcInvoker = testContext.getDomRpcInvoker();
-        assertNotNull(baRpcRegistry);
-        assertNotNull(biRpcRegistry);
+        assertNotNull(providerRegistry);
+        assertNotNull(provisionRegistry);
 
-        flowService = MessageCapturingFlowService.create(baRpcRegistry);
+        knockService = MessageCapturingFlowService.create(providerRegistry);
 
     }
 
     @Test
     public void bindingRoutedRpcProvider_DomInvokerTest() throws Exception {
 
-        flowService//
-                .registerPath(NodeContext.class, BA_NODE_A_ID) //
-                .registerPath(NodeContext.class, BA_NODE_B_ID) //
-                .setAddFlowResult(addFlowResult(true, 10));
+        knockService//
+                .registerPath(TestContext.class, BA_NODE_A_ID) //
+                .registerPath(TestContext.class, BA_NODE_B_ID) //
+                .setKnockKnockResult(knockResult(true, "open"));
 
-        SalFlowService baFlowInvoker = baRpcRegistry.getRpcService(SalFlowService.class);
-        assertNotSame(flowService, baFlowInvoker);
+        OpendaylightOfMigrationTestModelService baKnockInvoker =
+                providerRegistry.getRpcService(OpendaylightOfMigrationTestModelService.class);
+        assertNotSame(knockService, baKnockInvoker);
 
-        AddFlowInput addFlowA = addFlow(BA_NODE_A_ID) //
-                .setPriority(100).setBarrier(true).build();
+        KnockKnockInput knockKnockA = knockKnock(BA_NODE_A_ID) //
+                .setQuestion("who's there?").build();
 
-        CompositeNode addFlowDom = toDomRpc(ADD_FLOW_QNAME, addFlowA);
-        assertNotNull(addFlowDom);
-        RpcResult<CompositeNode> domResult = biRpcInvoker.invokeRpc(ADD_FLOW_QNAME, addFlowDom).get();
+        CompositeNode knockKnockDom = toDomRpc(KNOCK_KNOCK_QNAME, knockKnockA);
+        assertNotNull(knockKnockDom);
+        RpcResult<CompositeNode> domResult = biRpcInvoker.invokeRpc(KNOCK_KNOCK_QNAME, knockKnockDom).get();
         assertNotNull(domResult);
         assertTrue("DOM result is successful.", domResult.isSuccessful());
-        assertTrue("Bidning Add Flow RPC was captured.", flowService.getReceivedAddFlows().containsKey(BA_NODE_A_ID));
-        assertEquals(addFlowA, flowService.getReceivedAddFlows().get(BA_NODE_A_ID).iterator().next());
+        assertTrue("Bidning Add Flow RPC was captured.", knockService.getReceivedKnocks().containsKey(BA_NODE_A_ID));
+        assertEquals(knockKnockA, knockService.getReceivedKnocks().get(BA_NODE_A_ID).iterator().next());
     }
 
     @Test
     public void bindingRpcInvoker_DomRoutedProviderTest() throws Exception {
-        AddFlowOutputBuilder builder = new AddFlowOutputBuilder();
-        builder.setTransactionId(new TransactionId(BigInteger.valueOf(10)));
-        final AddFlowOutput output = builder.build();
-        org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration registration = biRpcRegistry.addRoutedRpcImplementation(ADD_FLOW_QNAME, new RpcImplementation() {
+        KnockKnockOutputBuilder builder = new KnockKnockOutputBuilder();
+        builder.setAnswer("open");
+        final KnockKnockOutput output = builder.build();
+        org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration registration = provisionRegistry.addRoutedRpcImplementation(KNOCK_KNOCK_QNAME, new RpcImplementation() {
             @Override
             public Set<QName> getSupportedRpcs() {
-                return ImmutableSet.of(ADD_FLOW_QNAME);
+                return ImmutableSet.of(KNOCK_KNOCK_QNAME);
             }
 
             @Override
@@ -137,12 +126,14 @@ public class CrossBrokerRpcTest {
                 return Futures.immediateFuture(RpcResultBuilder.<CompositeNode>success(result).build());
             }
         });
-        registration.registerPath(NodeContext.QNAME, BI_NODE_C_ID);
+        registration.registerPath(TestContext.QNAME, BI_NODE_C_ID);
+
 
-        SalFlowService baFlowInvoker = baRpcRegistry.getRpcService(SalFlowService.class);
-        Future<RpcResult<AddFlowOutput>> baResult = baFlowInvoker.addFlow(addFlow(BA_NODE_C_ID).setPriority(500).build());
+        OpendaylightOfMigrationTestModelService baKnockInvoker =
+                providerRegistry.getRpcService(OpendaylightOfMigrationTestModelService.class);
+        Future<RpcResult<KnockKnockOutput>> baResult = baKnockInvoker.knockKnock((knockKnock(BA_NODE_C_ID).setQuestion("Who's there?").build()));
         assertNotNull(baResult);
-        assertEquals(output,baResult.get().getResult());
+        assertEquals(output, baResult.get().getResult());
     }
 
     private CompositeNode toDomRpcInput(DataObject addFlowA) {
@@ -154,30 +145,26 @@ public class CrossBrokerRpcTest {
         testContext.close();
     }
 
-    private static InstanceIdentifier<Node> createBANodeIdentifier(NodeId node) {
-        return InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(node)).toInstance();
-    }
-
-    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBINodeIdentifier(NodeId node) {
-        return org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder().node(Nodes.QNAME)
-                .nodeWithKey(Node.QNAME, NODE_ID_QNAME, node.getValue()).toInstance();
+    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBINodeIdentifier(TopLevelListKey listKey) {
+        return org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder().node(Top.QNAME)
+                .nodeWithKey(TopLevelList.QNAME, NODE_ID_QNAME, listKey.getName()).toInstance();
     }
 
-    private Future<RpcResult<AddFlowOutput>> addFlowResult(boolean success, long xid) {
-        AddFlowOutput output = new AddFlowOutputBuilder() //
-                .setTransactionId(new TransactionId(BigInteger.valueOf(xid))).build();
-        RpcResult<AddFlowOutput> result = RpcResultBuilder.<AddFlowOutput>status(success).withResult(output).build();
+    private Future<RpcResult<KnockKnockOutput>> knockResult(boolean success, String answer) {
+        KnockKnockOutput output = new KnockKnockOutputBuilder() //
+                .setAnswer(answer).build();
+        RpcResult<KnockKnockOutput> result = RpcResultBuilder.<KnockKnockOutput>status(success).withResult(output).build();
         return Futures.immediateFuture(result);
     }
 
-    private static AddFlowInputBuilder addFlow(InstanceIdentifier<Node> nodeId) {
-        AddFlowInputBuilder builder = new AddFlowInputBuilder();
-        builder.setNode(new NodeRef(nodeId));
+    private static KnockKnockInputBuilder knockKnock(InstanceIdentifier<TopLevelList> listId) {
+        KnockKnockInputBuilder builder = new KnockKnockInputBuilder();
+        builder.setKnockerId(listId);
         return builder;
     }
 
-    private CompositeNode toDomRpc(QName rpcName, AddFlowInput addFlowA) {
+    private CompositeNode toDomRpc(QName rpcName, KnockKnockInput knockInput) {
         return new CompositeNodeTOImpl(rpcName, null,
-                Collections.<org.opendaylight.yangtools.yang.data.api.Node<?>> singletonList(toDomRpcInput(addFlowA)));
+                Collections.<org.opendaylight.yangtools.yang.data.api.Node<?>>singletonList(toDomRpcInput(knockInput)));
     }
 }
index 7d616ca..7595ec0 100644 (file)
@@ -28,12 +28,11 @@ import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
 import org.opendaylight.controller.sal.core.api.RpcImplementation;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.bi.ba.rpcservice.rev140701.OpendaylightTestRpcServiceService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.bi.ba.rpcservice.rev140701.RockTheHouseInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.Top;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -64,11 +63,11 @@ public class DOMRpcServiceTestBugfix560 {
     private final static QName RPC_NAME = QName.create(RPC_SERVICE_NAMESPACE,
             REVISION_DATE, "rock-the-house");
 
-    private static final NodeId MOUNT_NODE = new NodeId("id");
-    private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
+    private static final String TLL_NAME = "id";
+    private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
 
-    private static final InstanceIdentifier<Node> BA_MOUNT_ID = createBANodeIdentifier(MOUNT_NODE);
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID = createBINodeIdentifier(MOUNT_NODE);
+    private static final InstanceIdentifier<TopLevelList> BA_MOUNT_ID = createBATllIdentifier(TLL_NAME);
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID = createBITllIdentifier(TLL_NAME);
 
     private BindingTestContext testContext;
     private MountProvisionService domMountPointService;
@@ -104,18 +103,18 @@ public class DOMRpcServiceTestBugfix560 {
         schemaContext = mountSchemaContext;
     }
 
-    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBINodeIdentifier(
-            final NodeId mountNode) {
+    private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBITllIdentifier(
+            final String mount) {
         return org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
-                .builder().node(Nodes.QNAME)
-                .nodeWithKey(Node.QNAME, NODE_ID_QNAME, mountNode.getValue())
+                .builder().node(Top.QNAME)
+                .nodeWithKey(TopLevelList.QNAME, TLL_NAME_QNAME, mount)
                 .toInstance();
     }
 
-    private static InstanceIdentifier<Node> createBANodeIdentifier(
-            final NodeId mountNode) {
-        return InstanceIdentifier.builder(Nodes.class)
-                .child(Node.class, new NodeKey(mountNode)).toInstance();
+    private static InstanceIdentifier<TopLevelList> createBATllIdentifier(
+            final String mount) {
+        return InstanceIdentifier.builder(Top.class)
+                .child(TopLevelList.class, new TopLevelListKey(mount)).toInstance();
     }
 
     @SuppressWarnings("deprecation")
index 47e7965..0f93897 100644 (file)
@@ -11,15 +11,11 @@ import static org.junit.Assert.assertNotNull;
 
 import java.util.concurrent.Future;
 
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.OpendaylightOfMigrationTestModelService;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -27,76 +23,28 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Multimap;
 
-public class MessageCapturingFlowService implements SalFlowService, AutoCloseable {
-
-    private Future<RpcResult<AddFlowOutput>> addFlowResult;
-    private Future<RpcResult<RemoveFlowOutput>> removeFlowResult;
-    private Future<RpcResult<UpdateFlowOutput>> updateFlowResult;
-
-    private final Multimap<InstanceIdentifier<?>, AddFlowInput> receivedAddFlows = HashMultimap.create();
-    private final Multimap<InstanceIdentifier<?>, RemoveFlowInput> receivedRemoveFlows = HashMultimap.create();
-    private final Multimap<InstanceIdentifier<?>, UpdateFlowInput> receivedUpdateFlows = HashMultimap.create();
-    private RoutedRpcRegistration<SalFlowService> registration;
-
-    @Override
-    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput arg0) {
-        receivedAddFlows.put(arg0.getNode().getValue(), arg0);
-        return addFlowResult;
-    }
-
-    @Override
-    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput arg0) {
-        receivedRemoveFlows.put(arg0.getNode().getValue(), arg0);
-        return removeFlowResult;
-    }
-
-    @Override
-    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput arg0) {
-        receivedUpdateFlows.put(arg0.getNode().getValue(), arg0);
-        return updateFlowResult;
-    }
-
-    public Future<RpcResult<AddFlowOutput>> getAddFlowResult() {
-        return addFlowResult;
-    }
+public class MessageCapturingFlowService implements OpendaylightOfMigrationTestModelService, AutoCloseable {
 
-    public MessageCapturingFlowService setAddFlowResult(Future<RpcResult<AddFlowOutput>> addFlowResult) {
-        this.addFlowResult = addFlowResult;
-        return this;
-    }
+    private Future<RpcResult<KnockKnockOutput>> knockKnockResult;
 
-    public Future<RpcResult<RemoveFlowOutput>> getRemoveFlowResult() {
-        return removeFlowResult;
-    }
-
-    public MessageCapturingFlowService setRemoveFlowResult(Future<RpcResult<RemoveFlowOutput>> removeFlowResult) {
-        this.removeFlowResult = removeFlowResult;
-        return this;
-    }
+    private final Multimap<InstanceIdentifier<?>, KnockKnockInput> receivedKnocks = HashMultimap.create();
+    private RoutedRpcRegistration<OpendaylightOfMigrationTestModelService> registration;
 
-    public Future<RpcResult<UpdateFlowOutput>> getUpdateFlowResult() {
-        return updateFlowResult;
+    public Future<RpcResult<KnockKnockOutput>> getKnockKnockResult() {
+        return knockKnockResult;
     }
 
-    public MessageCapturingFlowService setUpdateFlowResult(Future<RpcResult<UpdateFlowOutput>> updateFlowResult) {
-        this.updateFlowResult = updateFlowResult;
+    public MessageCapturingFlowService setKnockKnockResult(Future<RpcResult<KnockKnockOutput>> kkOutput) {
+        this.knockKnockResult = kkOutput;
         return this;
     }
 
-    public Multimap<InstanceIdentifier<?>, AddFlowInput> getReceivedAddFlows() {
-        return receivedAddFlows;
-    }
-
-    public Multimap<InstanceIdentifier<?>, RemoveFlowInput> getReceivedRemoveFlows() {
-        return receivedRemoveFlows;
-    }
-
-    public Multimap<InstanceIdentifier<?>, UpdateFlowInput> getReceivedUpdateFlows() {
-        return receivedUpdateFlows;
+    public Multimap<InstanceIdentifier<?>, KnockKnockInput> getReceivedKnocks() {
+        return receivedKnocks;
     }
 
     public MessageCapturingFlowService registerTo(RpcProviderRegistry registry) {
-        registration = registry.addRoutedRpcImplementation(SalFlowService.class, this);
+        registration = registry.addRoutedRpcImplementation(OpendaylightOfMigrationTestModelService.class, this);
         assertNotNull(registration);
         return this;
     }
@@ -125,5 +73,11 @@ public class MessageCapturingFlowService implements SalFlowService, AutoCloseabl
         return ret;
     }
 
+    @Override
+    public Future<RpcResult<KnockKnockOutput>> knockKnock(KnockKnockInput input) {
+        receivedKnocks.put(input.getKnockerId(), input);
+        return knockKnockResult;
+    }
+
 
 }
diff --git a/opendaylight/md-sal/sal-test-model/src/main/yang/opendaylight-of-migration-test-model.yang b/opendaylight/md-sal/sal-test-model/src/main/yang/opendaylight-of-migration-test-model.yang
new file mode 100644 (file)
index 0000000..24ff5dd
--- /dev/null
@@ -0,0 +1,156 @@
+module opendaylight-of-migration-test-model {
+
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:of-migration-test-model";
+    prefix of-migration-test;
+
+    import opendaylight-mdsal-list-test {prefix test;}
+    import yang-ext {prefix ext;}
+    import opendaylight-mdsal-augment-test {prefix aug;}
+    import opendaylight-test-routed-rpc {prefix routed;}
+
+    description
+        "This module contains a collection of YANG definitions used for
+        test cases that used to depend on flow model.";
+
+    revision 2015-02-10 {
+    }
+
+    typedef bit-flags {
+        type bits {
+            bit FLAG_ONE;
+            bit FLAG_TWO;
+            bit FLAG_THREE;
+            bit FLAG_FOUR;
+            bit FLAG_FIVE;
+        }
+    }
+
+    typedef custom-enum {
+        type enumeration {
+            enum type1;
+            enum type2;
+            enum type3;
+        }
+    }
+
+    grouping enum-grouping {
+        leaf attr-enum {
+            type custom-enum;
+        }
+    }
+
+    grouping aug-grouping {
+        container cont1 {
+            leaf attr-str {
+                type string;
+            }
+        }
+
+        container cont2 {
+            list contlist1 {
+                key "attr-str";
+
+                leaf attr-str {
+                    type string;
+                }
+
+                uses enum-grouping;
+            }
+        }
+
+        leaf attr-str1 {
+            type string;
+        }
+
+        leaf attr-str2 {
+            type string;
+        }
+
+        leaf attr-str3 {
+            type string;
+        }
+
+        leaf attr-str4 {
+            type string;
+        }
+
+        list list1 {
+            key "attr-str";
+            leaf attr-str {
+                type string;
+            }
+
+            list list1-1 {
+                key "attr-int";
+                leaf attr-int {
+                    type int32;
+                }
+
+                leaf attr-str {
+                    type string;
+                }
+
+                leaf flags {
+                    type bit-flags;
+                }
+            }
+
+            list list1-2 {
+                key "attr-int";
+                leaf attr-int {
+                    type int32;
+                }
+
+                leaf attr-str {
+                    type string;
+                }
+            }
+        }
+    }
+
+    augment "/test:top/test:top-level-list" {
+        ext:augment-identifier tll-complex-augment;
+        uses aug-grouping;
+    }
+
+    augment "/test:top/test:top-level-list/list1/list1-1"  {
+        ext:augment-identifier list11-simple-augment;
+
+        leaf attr-str2 {
+            type string;
+        }
+
+        container cont {
+            leaf attr-int {
+                type int32;
+            }
+        }
+    }
+
+    augment "/test:top/test:top-level-list/test:nested-list/"  {
+        ext:augment-identifier nested-list-simple-augment;
+
+        leaf type {
+            type string;
+        }
+    }
+
+    rpc knock-knock {
+        input {
+            leaf knocker-id {
+                ext:context-reference routed:test-context;
+                type instance-identifier;
+            }
+
+            leaf question {
+                type string;
+            }
+        }
+
+        output {
+            leaf answer {
+                type string;
+            }
+        }
+    }
+}

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.