Added test cases for each .proto file to ensure 95/9595/2
authorBasheeruddin Ahmed <syedbahm@cisco.com>
Fri, 1 Aug 2014 23:06:18 +0000 (16:06 -0700)
committerBasheeruddin Ahmed <syedbahm@cisco.com>
Sun, 3 Aug 2014 06:43:10 +0000 (23:43 -0700)
that test case fail in case incompatible version
of the protocol buffer is utilized.

New Patch: Updated with copyright header

Change-Id: Ib7fe9e212c6319f46202506d96544d149da28004
Signed-off-by: Basheeruddin Ahmed <syedbahm@cisco.com>
54 files changed:
opendaylight/md-sal/sal-protocolbuffer-encoding/README-FIRST
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NodeToNormalizedNodeBuilder.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NodeValueCodec.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodec.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToProtocolBufferNode.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/AugmentationIdentifierGenerator.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactory.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierGenerator.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithValueGenerator.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeGetter.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeNavigator.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodePrinter.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NormalizedNodeVisitor.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/PathUtils.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/EncoderDecoderUtil.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtils.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/mdsal/CompositeModificationPayload.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/common/SimpleNormalizedNodeMessage.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/shard/ShardManagerMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionChainMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/NormalizedNodeToNodeCodecTest.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierFactoryTest.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtilsTest.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/NormalizedNodeXmlConverterTest.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/AbstractMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/ShardManagerMessagesTest.java [deleted file]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/shard/ShardManagerMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionChainMessagesTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessagesTest.java
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/augment_choice.xml
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/simple_xml_with_attributes.xml
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/DataChangeListenerMessagesData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ListenerRegistrationMessagesData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/NormalizedNodeMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/PersistentMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardManagerMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionChainMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ThreePhaseCommitCohortMessagesTestData [new file with mode: 0644]
opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/readme.txt [new file with mode: 0644]

index d0be2cb..4791979 100644 (file)
@@ -24,5 +24,9 @@ machine
 
 6. !!!WARNING!!! - never edit the generated sources files of protocol buffer
 
-7. !!!NOTE!!! if you are planning to add new .proto file  option java_package should begin with
+7. !!!IMPORTANT!!! if you are planning to add new .proto file  option java_package should begin with
    org.opendaylight.controller.protobuff.messages to properly exclude from sonar.
+
+8. !!!IMPORTANT!!! for any new .proto file added you need to create corresponding version-compatibility-serialized-data
+   serialized test file under test/resources and a test case for one message in your .proto file.
+   Please follow the instruction in readme.txt in that folder
index ce12080..03d632b 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node;
 
 import com.google.common.base.Preconditions;
index 7b6f5c4..14ca75b 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
  */
 
 package org.opendaylight.controller.cluster.datastore.node;
index fc4b395..17bdb36 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node;
 
 import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
index fb15312..68d3c59 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node;
 
 import com.google.common.base.Preconditions;
index a34307f..e2c4c35 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.common.QName;
index 175e242..ea3986f 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
index 9edec1e..1b9c708 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.common.QName;
index 4bfcf39..6d3a26a 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.common.QName;
index b2ec564..2d434ff 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
index e82a23d..31e6521 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import com.google.common.base.Preconditions;
index 4ccc707..0083b00 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import com.google.common.base.Preconditions;
index 7735a12..d370eb2 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
index 69b00be..9e85ccb 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
index ba81836..cf51743 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 public class PathUtils {
index 8dba056..002b9ff 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.common.QName;
index d9a067b..90f5cf3 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.util;
 
 import com.google.common.base.Preconditions;
@@ -44,13 +54,6 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- */
 /*
  *
  * <code>EncoderDecoderUtil</code> helps in wrapping the NormalizedNode into a SimpleNormalizedNode
index 5b459e7..55cb341 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.util;
 
 import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFactory;
index 87b246b..99f4751 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: CompositeModificationPayload.proto
 
index ac0701a..49cb1ea 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: Cohort.proto
 
@@ -652,7 +662,7 @@ public final class ThreePhaseCommitCohortMessages {
 
       public final boolean isInitialized() {
         if (!hasCanCommit()) {
-          
+
           return false;
         }
         return true;
index 81e5b46..f88b66b 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: Common.proto
 
@@ -179,7 +189,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -195,7 +205,7 @@ public final class NormalizedNodeMessages {
         getNameBytes() {
       java.lang.Object ref = name_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         name_ = b;
@@ -222,7 +232,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -238,7 +248,7 @@ public final class NormalizedNodeMessages {
         getValueBytes() {
       java.lang.Object ref = value_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         value_ = b;
@@ -265,7 +275,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -281,7 +291,7 @@ public final class NormalizedNodeMessages {
         getTypeBytes() {
       java.lang.Object ref = type_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         type_ = b;
@@ -541,7 +551,7 @@ public final class NormalizedNodeMessages {
 
       public final boolean isInitialized() {
         if (!hasName()) {
-          
+
           return false;
         }
         return true;
@@ -595,7 +605,7 @@ public final class NormalizedNodeMessages {
           getNameBytes() {
         java.lang.Object ref = name_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           name_ = b;
@@ -669,7 +679,7 @@ public final class NormalizedNodeMessages {
           getValueBytes() {
         java.lang.Object ref = value_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           value_ = b;
@@ -743,7 +753,7 @@ public final class NormalizedNodeMessages {
           getTypeBytes() {
         java.lang.Object ref = type_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           type_ = b;
@@ -930,7 +940,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -946,7 +956,7 @@ public final class NormalizedNodeMessages {
         getValueBytes() {
       java.lang.Object ref = value_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         value_ = b;
@@ -1168,7 +1178,7 @@ public final class NormalizedNodeMessages {
 
       public final boolean isInitialized() {
         if (!hasValue()) {
-          
+
           return false;
         }
         return true;
@@ -1222,7 +1232,7 @@ public final class NormalizedNodeMessages {
           getValueBytes() {
         java.lang.Object ref = value_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           value_ = b;
@@ -1341,7 +1351,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>
         getAttributesList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
@@ -1354,7 +1364,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
         getAttributesOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
@@ -1504,7 +1514,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1520,7 +1530,7 @@ public final class NormalizedNodeMessages {
         getValueBytes() {
       java.lang.Object ref = value_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         value_ = b;
@@ -1555,7 +1565,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1575,7 +1585,7 @@ public final class NormalizedNodeMessages {
         getTypeBytes() {
       java.lang.Object ref = type_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         type_ = b;
@@ -1619,7 +1629,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
         getAttributesOrBuilderList() {
       return attributes_;
     }
@@ -1948,7 +1958,7 @@ public final class NormalizedNodeMessages {
               attributesBuilder_ = null;
               attributes_ = other.attributes_;
               bitField0_ = (bitField0_ & ~0x00000008);
-              attributesBuilder_ = 
+              attributesBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getAttributesFieldBuilder() : null;
             } else {
@@ -1962,18 +1972,18 @@ public final class NormalizedNodeMessages {
 
       public final boolean isInitialized() {
         if (!hasValue()) {
-          
+
           return false;
         }
         if (hasNodeType()) {
           if (!getNodeType().isInitialized()) {
-            
+
             return false;
           }
         }
         for (int i = 0; i < getAttributesCount(); i++) {
           if (!getAttributes(i).isInitialized()) {
-            
+
             return false;
           }
         }
@@ -2028,7 +2038,7 @@ public final class NormalizedNodeMessages {
           getValueBytes() {
         java.lang.Object ref = value_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           value_ = b;
@@ -2114,7 +2124,7 @@ public final class NormalizedNodeMessages {
           getTypeBytes() {
         java.lang.Object ref = type_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           type_ = b;
@@ -2275,7 +2285,7 @@ public final class NormalizedNodeMessages {
        * <code>optional .org.opendaylight.controller.mdsal.QName nodeType = 3;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QName.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.QNameOrBuilder>
           getNodeTypeFieldBuilder() {
         if (nodeTypeBuilder_ == null) {
           nodeTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -2483,7 +2493,7 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
            getAttributesOrBuilderList() {
         if (attributesBuilder_ != null) {
           return attributesBuilder_.getMessageOrBuilderList();
@@ -2509,12 +2519,12 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 4;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder>
            getAttributesBuilderList() {
         return getAttributesFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
           getAttributesFieldBuilder() {
         if (attributesBuilder_ == null) {
           attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
@@ -2546,7 +2556,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument>
         getArgumentsList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
@@ -2559,7 +2569,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
         getArgumentsOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
@@ -2680,7 +2690,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
         getArgumentsOrBuilderList() {
       return arguments_;
     }
@@ -2933,7 +2943,7 @@ public final class NormalizedNodeMessages {
               argumentsBuilder_ = null;
               arguments_ = other.arguments_;
               bitField0_ = (bitField0_ & ~0x00000001);
-              argumentsBuilder_ = 
+              argumentsBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getArgumentsFieldBuilder() : null;
             } else {
@@ -2948,7 +2958,7 @@ public final class NormalizedNodeMessages {
       public final boolean isInitialized() {
         for (int i = 0; i < getArgumentsCount(); i++) {
           if (!getArguments(i).isInitialized()) {
-            
+
             return false;
           }
         }
@@ -3169,7 +3179,7 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
            getArgumentsOrBuilderList() {
         if (argumentsBuilder_ != null) {
           return argumentsBuilder_.getMessageOrBuilderList();
@@ -3195,12 +3205,12 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.PathArgument arguments = 1;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder>
            getArgumentsBuilderList() {
         return getArgumentsFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgument.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.PathArgumentOrBuilder>
           getArgumentsFieldBuilder() {
         if (argumentsBuilder_ == null) {
           argumentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
@@ -3262,7 +3272,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute>
         getAttributesList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
@@ -3275,7 +3285,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
         getAttributesOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
@@ -3287,7 +3297,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node>
         getChildList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
@@ -3300,7 +3310,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
         getChildOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
@@ -3546,7 +3556,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -3562,7 +3572,7 @@ public final class NormalizedNodeMessages {
         getPathBytes() {
       java.lang.Object ref = path_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         path_ = b;
@@ -3589,7 +3599,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -3605,7 +3615,7 @@ public final class NormalizedNodeMessages {
         getTypeBytes() {
       java.lang.Object ref = type_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         type_ = b;
@@ -3627,7 +3637,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
         getAttributesOrBuilderList() {
       return attributes_;
     }
@@ -3663,7 +3673,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
         getChildOrBuilderList() {
       return child_;
     }
@@ -3704,7 +3714,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -3720,7 +3730,7 @@ public final class NormalizedNodeMessages {
         getValueBytes() {
       java.lang.Object ref = value_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         value_ = b;
@@ -3747,7 +3757,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -3763,7 +3773,7 @@ public final class NormalizedNodeMessages {
         getValueTypeBytes() {
       java.lang.Object ref = valueType_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         valueType_ = b;
@@ -4202,7 +4212,7 @@ public final class NormalizedNodeMessages {
               attributesBuilder_ = null;
               attributes_ = other.attributes_;
               bitField0_ = (bitField0_ & ~0x00000004);
-              attributesBuilder_ = 
+              attributesBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getAttributesFieldBuilder() : null;
             } else {
@@ -4228,7 +4238,7 @@ public final class NormalizedNodeMessages {
               childBuilder_ = null;
               child_ = other.child_;
               bitField0_ = (bitField0_ & ~0x00000008);
-              childBuilder_ = 
+              childBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getChildFieldBuilder() : null;
             } else {
@@ -4266,19 +4276,19 @@ public final class NormalizedNodeMessages {
       public final boolean isInitialized() {
         for (int i = 0; i < getAttributesCount(); i++) {
           if (!getAttributes(i).isInitialized()) {
-            
+
             return false;
           }
         }
         for (int i = 0; i < getChildCount(); i++) {
           if (!getChild(i).isInitialized()) {
-            
+
             return false;
           }
         }
         if (hasInstanceIdentifierValue()) {
           if (!getInstanceIdentifierValue().isInitialized()) {
-            
+
             return false;
           }
         }
@@ -4333,7 +4343,7 @@ public final class NormalizedNodeMessages {
           getPathBytes() {
         java.lang.Object ref = path_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           path_ = b;
@@ -4407,7 +4417,7 @@ public final class NormalizedNodeMessages {
           getTypeBytes() {
         java.lang.Object ref = type_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           type_ = b;
@@ -4647,7 +4657,7 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
            getAttributesOrBuilderList() {
         if (attributesBuilder_ != null) {
           return attributesBuilder_.getMessageOrBuilderList();
@@ -4673,12 +4683,12 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Attribute attributes = 3;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder>
            getAttributesBuilderList() {
         return getAttributesFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Attribute.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.AttributeOrBuilder>
           getAttributesFieldBuilder() {
         if (attributesBuilder_ == null) {
           attributesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
@@ -4887,7 +4897,7 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
            getChildOrBuilderList() {
         if (childBuilder_ != null) {
           return childBuilder_.getMessageOrBuilderList();
@@ -4913,12 +4923,12 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Node child = 4;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder>
            getChildBuilderList() {
         return getChildFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getChildFieldBuilder() {
         if (childBuilder_ == null) {
           childBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
@@ -4961,7 +4971,7 @@ public final class NormalizedNodeMessages {
           getValueBytes() {
         java.lang.Object ref = value_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           value_ = b;
@@ -5035,7 +5045,7 @@ public final class NormalizedNodeMessages {
           getValueTypeBytes() {
         java.lang.Object ref = valueType_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           valueType_ = b;
@@ -5277,7 +5287,7 @@ public final class NormalizedNodeMessages {
        * <code>optional .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierValue = 8;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierValueFieldBuilder() {
         if (instanceIdentifierValueBuilder_ == null) {
           instanceIdentifierValueBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -5459,7 +5469,7 @@ public final class NormalizedNodeMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -5475,7 +5485,7 @@ public final class NormalizedNodeMessages {
         getParentPathBytes() {
       java.lang.Object ref = parentPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         parentPath_ = b;
@@ -5751,12 +5761,12 @@ public final class NormalizedNodeMessages {
 
       public final boolean isInitialized() {
         if (!hasParentPath()) {
-          
+
           return false;
         }
         if (hasNormalizedNode()) {
           if (!getNormalizedNode().isInitialized()) {
-            
+
             return false;
           }
         }
@@ -5811,7 +5821,7 @@ public final class NormalizedNodeMessages {
           getParentPathBytes() {
         java.lang.Object ref = parentPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           parentPath_ = b;
@@ -5960,7 +5970,7 @@ public final class NormalizedNodeMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getNormalizedNodeFieldBuilder() {
         if (normalizedNodeBuilder_ == null) {
           normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -6431,16 +6441,16 @@ public final class NormalizedNodeMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPath()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPath().isInitialized()) {
-          
+
           return false;
         }
         if (hasNormalizedNode()) {
           if (!getNormalizedNode().isInitialized()) {
-            
+
             return false;
           }
         }
@@ -6570,7 +6580,7 @@ public final class NormalizedNodeMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathFieldBuilder() {
         if (instanceIdentifierPathBuilder_ == null) {
           instanceIdentifierPathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -6687,7 +6697,7 @@ public final class NormalizedNodeMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getNormalizedNodeFieldBuilder() {
         if (normalizedNodeBuilder_ == null) {
           normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -6718,7 +6728,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry>
         getMapEntriesList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
@@ -6731,7 +6741,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
         getMapEntriesOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
@@ -6852,7 +6862,7 @@ public final class NormalizedNodeMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
         getMapEntriesOrBuilderList() {
       return mapEntries_;
     }
@@ -7105,7 +7115,7 @@ public final class NormalizedNodeMessages {
               mapEntriesBuilder_ = null;
               mapEntries_ = other.mapEntries_;
               bitField0_ = (bitField0_ & ~0x00000001);
-              mapEntriesBuilder_ = 
+              mapEntriesBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getMapEntriesFieldBuilder() : null;
             } else {
@@ -7120,7 +7130,7 @@ public final class NormalizedNodeMessages {
       public final boolean isInitialized() {
         for (int i = 0; i < getMapEntriesCount(); i++) {
           if (!getMapEntries(i).isInitialized()) {
-            
+
             return false;
           }
         }
@@ -7341,7 +7351,7 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
            getMapEntriesOrBuilderList() {
         if (mapEntriesBuilder_ != null) {
           return mapEntriesBuilder_.getMessageOrBuilderList();
@@ -7367,12 +7377,12 @@ public final class NormalizedNodeMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.NodeMapEntry mapEntries = 1;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder>
            getMapEntriesBuilderList() {
         return getMapEntriesFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntry.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapEntryOrBuilder>
           getMapEntriesFieldBuilder() {
         if (mapEntriesBuilder_ == null) {
           mapEntriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
index 29e5457..7cee40d 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: SimpleNormalizedNode.proto
 
@@ -159,7 +169,7 @@ public final class SimpleNormalizedNodeMessage {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -175,7 +185,7 @@ public final class SimpleNormalizedNodeMessage {
         getNodeIdentifierBytes() {
       java.lang.Object ref = nodeIdentifier_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         nodeIdentifier_ = b;
@@ -202,7 +212,7 @@ public final class SimpleNormalizedNodeMessage {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -218,7 +228,7 @@ public final class SimpleNormalizedNodeMessage {
         getXmlStringBytes() {
       java.lang.Object ref = xmlString_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         xmlString_ = b;
@@ -463,11 +473,11 @@ public final class SimpleNormalizedNodeMessage {
 
       public final boolean isInitialized() {
         if (!hasNodeIdentifier()) {
-          
+
           return false;
         }
         if (!hasXmlString()) {
-          
+
           return false;
         }
         return true;
@@ -521,7 +531,7 @@ public final class SimpleNormalizedNodeMessage {
           getNodeIdentifierBytes() {
         java.lang.Object ref = nodeIdentifier_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           nodeIdentifier_ = b;
@@ -595,7 +605,7 @@ public final class SimpleNormalizedNodeMessage {
           getXmlStringBytes() {
         java.lang.Object ref = xmlString_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           xmlString_ = b;
index 2018834..1a98112 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: DataChangeListener.proto
 
@@ -85,7 +95,7 @@ public final class DataChangeListenerMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier>
         getRemovedPathsList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
@@ -98,7 +108,7 @@ public final class DataChangeListenerMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
         getRemovedPathsOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
@@ -395,7 +405,7 @@ public final class DataChangeListenerMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
         getRemovedPathsOrBuilderList() {
       return removedPaths_;
     }
@@ -810,7 +820,7 @@ public final class DataChangeListenerMessages {
               removedPathsBuilder_ = null;
               removedPaths_ = other.removedPaths_;
               bitField0_ = (bitField0_ & ~0x00000020);
-              removedPathsBuilder_ = 
+              removedPathsBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getRemovedPathsFieldBuilder() : null;
             } else {
@@ -825,37 +835,37 @@ public final class DataChangeListenerMessages {
       public final boolean isInitialized() {
         if (hasOriginalSubTree()) {
           if (!getOriginalSubTree().isInitialized()) {
-            
+
             return false;
           }
         }
         if (hasUpdatedSubTree()) {
           if (!getUpdatedSubTree().isInitialized()) {
-            
+
             return false;
           }
         }
         if (hasOriginalData()) {
           if (!getOriginalData().isInitialized()) {
-            
+
             return false;
           }
         }
         if (hasUpdatedData()) {
           if (!getUpdatedData().isInitialized()) {
-            
+
             return false;
           }
         }
         if (hasCreatedData()) {
           if (!getCreatedData().isInitialized()) {
-            
+
             return false;
           }
         }
         for (int i = 0; i < getRemovedPathsCount(); i++) {
           if (!getRemovedPaths(i).isInitialized()) {
-            
+
             return false;
           }
         }
@@ -985,7 +995,7 @@ public final class DataChangeListenerMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node originalSubTree = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getOriginalSubTreeFieldBuilder() {
         if (originalSubTreeBuilder_ == null) {
           originalSubTreeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1102,7 +1112,7 @@ public final class DataChangeListenerMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node updatedSubTree = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getUpdatedSubTreeFieldBuilder() {
         if (updatedSubTreeBuilder_ == null) {
           updatedSubTreeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1219,7 +1229,7 @@ public final class DataChangeListenerMessages {
        * <code>optional .org.opendaylight.controller.mdsal.NodeMap originalData = 3;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
           getOriginalDataFieldBuilder() {
         if (originalDataBuilder_ == null) {
           originalDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1336,7 +1346,7 @@ public final class DataChangeListenerMessages {
        * <code>optional .org.opendaylight.controller.mdsal.NodeMap updatedData = 4;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
           getUpdatedDataFieldBuilder() {
         if (updatedDataBuilder_ == null) {
           updatedDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1453,7 +1463,7 @@ public final class DataChangeListenerMessages {
        * <code>optional .org.opendaylight.controller.mdsal.NodeMap createdData = 5;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMap.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeMapOrBuilder>
           getCreatedDataFieldBuilder() {
         if (createdDataBuilder_ == null) {
           createdDataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1661,7 +1671,7 @@ public final class DataChangeListenerMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
            getRemovedPathsOrBuilderList() {
         if (removedPathsBuilder_ != null) {
           return removedPathsBuilder_.getMessageOrBuilderList();
@@ -1687,12 +1697,12 @@ public final class DataChangeListenerMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.InstanceIdentifier removedPaths = 6;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder>
            getRemovedPathsBuilderList() {
         return getRemovedPathsFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getRemovedPathsFieldBuilder() {
         if (removedPathsBuilder_ == null) {
           removedPathsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
index eaa9001..088630a 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: Persistent.proto
 
@@ -193,7 +203,7 @@ public final class PersistentMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -209,7 +219,7 @@ public final class PersistentMessages {
         getTypeBytes() {
       java.lang.Object ref = type_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         type_ = b;
@@ -541,20 +551,20 @@ public final class PersistentMessages {
 
       public final boolean isInitialized() {
         if (!hasType()) {
-          
+
           return false;
         }
         if (!hasPath()) {
-          
+
           return false;
         }
         if (!getPath().isInitialized()) {
-          
+
           return false;
         }
         if (hasData()) {
           if (!getData().isInitialized()) {
-            
+
             return false;
           }
         }
@@ -609,7 +619,7 @@ public final class PersistentMessages {
           getTypeBytes() {
         java.lang.Object ref = type_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           type_ = b;
@@ -758,7 +768,7 @@ public final class PersistentMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier path = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getPathFieldBuilder() {
         if (pathBuilder_ == null) {
           pathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -875,7 +885,7 @@ public final class PersistentMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node data = 3;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getDataFieldBuilder() {
         if (dataBuilder_ == null) {
           dataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -906,7 +916,7 @@ public final class PersistentMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
      */
-    java.util.List<org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification> 
+    java.util.List<org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification>
         getModificationList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
@@ -919,7 +929,7 @@ public final class PersistentMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
      */
-    java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder> 
+    java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder>
         getModificationOrBuilderList();
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
@@ -1040,7 +1050,7 @@ public final class PersistentMessages {
     /**
      * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
      */
-    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder> 
+    public java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder>
         getModificationOrBuilderList() {
       return modification_;
     }
@@ -1293,7 +1303,7 @@ public final class PersistentMessages {
               modificationBuilder_ = null;
               modification_ = other.modification_;
               bitField0_ = (bitField0_ & ~0x00000001);
-              modificationBuilder_ = 
+              modificationBuilder_ =
                 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                    getModificationFieldBuilder() : null;
             } else {
@@ -1308,7 +1318,7 @@ public final class PersistentMessages {
       public final boolean isInitialized() {
         for (int i = 0; i < getModificationCount(); i++) {
           if (!getModification(i).isInitialized()) {
-            
+
             return false;
           }
         }
@@ -1529,7 +1539,7 @@ public final class PersistentMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
        */
-      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder> 
+      public java.util.List<? extends org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder>
            getModificationOrBuilderList() {
         if (modificationBuilder_ != null) {
           return modificationBuilder_.getMessageOrBuilderList();
@@ -1555,12 +1565,12 @@ public final class PersistentMessages {
       /**
        * <code>repeated .org.opendaylight.controller.mdsal.Modification modification = 1;</code>
        */
-      public java.util.List<org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification.Builder> 
+      public java.util.List<org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification.Builder>
            getModificationBuilderList() {
         return getModificationFieldBuilder().getBuilderList();
       }
       private com.google.protobuf.RepeatedFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification, org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification.Builder, org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification, org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.Modification.Builder, org.opendaylight.controller.protobuff.messages.persistent.PersistentMessages.ModificationOrBuilder>
           getModificationFieldBuilder() {
         if (modificationBuilder_ == null) {
           modificationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
index e06dd0d..0f439d8 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: ListenerRegistration.proto
 
@@ -837,7 +847,7 @@ public final class ListenerRegistrationMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -853,7 +863,7 @@ public final class ListenerRegistrationMessages {
         getDataChangeListenerActorPathBytes() {
       java.lang.Object ref = dataChangeListenerActorPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         dataChangeListenerActorPath_ = b;
@@ -1146,19 +1156,19 @@ public final class ListenerRegistrationMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPath()) {
-          
+
           return false;
         }
         if (!hasDataChangeListenerActorPath()) {
-          
+
           return false;
         }
         if (!hasDataChangeScope()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPath().isInitialized()) {
-          
+
           return false;
         }
         return true;
@@ -1287,7 +1297,7 @@ public final class ListenerRegistrationMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPath = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathFieldBuilder() {
         if (instanceIdentifierPathBuilder_ == null) {
           instanceIdentifierPathBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -1329,7 +1339,7 @@ public final class ListenerRegistrationMessages {
           getDataChangeListenerActorPathBytes() {
         java.lang.Object ref = dataChangeListenerActorPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           dataChangeListenerActorPath_ = b;
@@ -1556,7 +1566,7 @@ public final class ListenerRegistrationMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1572,7 +1582,7 @@ public final class ListenerRegistrationMessages {
         getListenerRegistrationPathBytes() {
       java.lang.Object ref = listenerRegistrationPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         listenerRegistrationPath_ = b;
@@ -1801,7 +1811,7 @@ public final class ListenerRegistrationMessages {
 
       public final boolean isInitialized() {
         if (!hasListenerRegistrationPath()) {
-          
+
           return false;
         }
         return true;
@@ -1855,7 +1865,7 @@ public final class ListenerRegistrationMessages {
           getListenerRegistrationPathBytes() {
         java.lang.Object ref = listenerRegistrationPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           listenerRegistrationPath_ = b;
index 7c2a47e..7141863 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: ShardManager.proto
 
@@ -139,7 +149,7 @@ public final class ShardManagerMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -155,7 +165,7 @@ public final class ShardManagerMessages {
         getShardNameBytes() {
       java.lang.Object ref = shardName_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         shardName_ = b;
@@ -377,7 +387,7 @@ public final class ShardManagerMessages {
 
       public final boolean isInitialized() {
         if (!hasShardName()) {
-          
+
           return false;
         }
         return true;
@@ -431,7 +441,7 @@ public final class ShardManagerMessages {
           getShardNameBytes() {
         java.lang.Object ref = shardName_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           shardName_ = b;
@@ -618,7 +628,7 @@ public final class ShardManagerMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -634,7 +644,7 @@ public final class ShardManagerMessages {
         getPrimaryPathBytes() {
       java.lang.Object ref = primaryPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         primaryPath_ = b;
@@ -856,7 +866,7 @@ public final class ShardManagerMessages {
 
       public final boolean isInitialized() {
         if (!hasPrimaryPath()) {
-          
+
           return false;
         }
         return true;
@@ -910,7 +920,7 @@ public final class ShardManagerMessages {
           getPrimaryPathBytes() {
         java.lang.Object ref = primaryPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           primaryPath_ = b;
@@ -1097,7 +1107,7 @@ public final class ShardManagerMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1113,7 +1123,7 @@ public final class ShardManagerMessages {
         getShardNameBytes() {
       java.lang.Object ref = shardName_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         shardName_ = b;
@@ -1335,7 +1345,7 @@ public final class ShardManagerMessages {
 
       public final boolean isInitialized() {
         if (!hasShardName()) {
-          
+
           return false;
         }
         return true;
@@ -1389,7 +1399,7 @@ public final class ShardManagerMessages {
           getShardNameBytes() {
         java.lang.Object ref = shardName_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           shardName_ = b;
index 3f354ba..68bf325 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: ShardTransactionChain.proto
 
@@ -1066,7 +1076,7 @@ public final class ShardTransactionChainMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1082,7 +1092,7 @@ public final class ShardTransactionChainMessages {
         getTransactionChainPathBytes() {
       java.lang.Object ref = transactionChainPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         transactionChainPath_ = b;
@@ -1304,7 +1314,7 @@ public final class ShardTransactionChainMessages {
 
       public final boolean isInitialized() {
         if (!hasTransactionChainPath()) {
-          
+
           return false;
         }
         return true;
@@ -1358,7 +1368,7 @@ public final class ShardTransactionChainMessages {
           getTransactionChainPathBytes() {
         java.lang.Object ref = transactionChainPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           transactionChainPath_ = b;
index ee2c704..52411f3 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
 // source: ShardTransaction.proto
 
@@ -757,7 +767,7 @@ public final class ShardTransactionMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -773,7 +783,7 @@ public final class ShardTransactionMessages {
         getTransactionIdBytes() {
       java.lang.Object ref = transactionId_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         transactionId_ = b;
@@ -995,7 +1005,7 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasTransactionId()) {
-          
+
           return false;
         }
         return true;
@@ -1049,7 +1059,7 @@ public final class ShardTransactionMessages {
           getTransactionIdBytes() {
         java.lang.Object ref = transactionId_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           transactionId_ = b;
@@ -1256,7 +1266,7 @@ public final class ShardTransactionMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1272,7 +1282,7 @@ public final class ShardTransactionMessages {
         getTransactionActorPathBytes() {
       java.lang.Object ref = transactionActorPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         transactionActorPath_ = b;
@@ -1299,7 +1309,7 @@ public final class ShardTransactionMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -1315,7 +1325,7 @@ public final class ShardTransactionMessages {
         getTransactionIdBytes() {
       java.lang.Object ref = transactionId_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         transactionId_ = b;
@@ -1560,11 +1570,11 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasTransactionActorPath()) {
-          
+
           return false;
         }
         if (!hasTransactionId()) {
-          
+
           return false;
         }
         return true;
@@ -1618,7 +1628,7 @@ public final class ShardTransactionMessages {
           getTransactionActorPathBytes() {
         java.lang.Object ref = transactionActorPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           transactionActorPath_ = b;
@@ -1692,7 +1702,7 @@ public final class ShardTransactionMessages {
           getTransactionIdBytes() {
         java.lang.Object ref = transactionId_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           transactionId_ = b;
@@ -2188,7 +2198,7 @@ public final class ShardTransactionMessages {
       if (ref instanceof java.lang.String) {
         return (java.lang.String) ref;
       } else {
-        com.google.protobuf.ByteString bs = 
+        com.google.protobuf.ByteString bs =
             (com.google.protobuf.ByteString) ref;
         java.lang.String s = bs.toStringUtf8();
         if (bs.isValidUtf8()) {
@@ -2204,7 +2214,7 @@ public final class ShardTransactionMessages {
         getActorPathBytes() {
       java.lang.Object ref = actorPath_;
       if (ref instanceof java.lang.String) {
-        com.google.protobuf.ByteString b = 
+        com.google.protobuf.ByteString b =
             com.google.protobuf.ByteString.copyFromUtf8(
                 (java.lang.String) ref);
         actorPath_ = b;
@@ -2426,7 +2436,7 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasActorPath()) {
-          
+
           return false;
         }
         return true;
@@ -2480,7 +2490,7 @@ public final class ShardTransactionMessages {
           getActorPathBytes() {
         java.lang.Object ref = actorPath_;
         if (ref instanceof String) {
-          com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString b =
               com.google.protobuf.ByteString.copyFromUtf8(
                   (java.lang.String) ref);
           actorPath_ = b;
@@ -2902,11 +2912,11 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPathArguments()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPathArguments().isInitialized()) {
-          
+
           return false;
         }
         return true;
@@ -3035,7 +3045,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathArgumentsFieldBuilder() {
         if (instanceIdentifierPathArgumentsBuilder_ == null) {
           instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -3734,11 +3744,11 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPathArguments()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPathArguments().isInitialized()) {
-          
+
           return false;
         }
         return true;
@@ -3867,7 +3877,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathArgumentsFieldBuilder() {
         if (instanceIdentifierPathArgumentsBuilder_ == null) {
           instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -4256,7 +4266,7 @@ public final class ShardTransactionMessages {
       public final boolean isInitialized() {
         if (hasNormalizedNode()) {
           if (!getNormalizedNode().isInitialized()) {
-            
+
             return false;
           }
         }
@@ -4386,7 +4396,7 @@ public final class ShardTransactionMessages {
        * <code>optional .org.opendaylight.controller.mdsal.Node normalizedNode = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getNormalizedNodeFieldBuilder() {
         if (normalizedNodeBuilder_ == null) {
           normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -4859,19 +4869,19 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPathArguments()) {
-          
+
           return false;
         }
         if (!hasNormalizedNode()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPathArguments().isInitialized()) {
-          
+
           return false;
         }
         if (!getNormalizedNode().isInitialized()) {
-          
+
           return false;
         }
         return true;
@@ -5000,7 +5010,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathArgumentsFieldBuilder() {
         if (instanceIdentifierPathArgumentsBuilder_ == null) {
           instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -5117,7 +5127,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getNormalizedNodeFieldBuilder() {
         if (normalizedNodeBuilder_ == null) {
           normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -5899,19 +5909,19 @@ public final class ShardTransactionMessages {
 
       public final boolean isInitialized() {
         if (!hasInstanceIdentifierPathArguments()) {
-          
+
           return false;
         }
         if (!hasNormalizedNode()) {
-          
+
           return false;
         }
         if (!getInstanceIdentifierPathArguments().isInitialized()) {
-          
+
           return false;
         }
         if (!getNormalizedNode().isInitialized()) {
-          
+
           return false;
         }
         return true;
@@ -6040,7 +6050,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.InstanceIdentifier instanceIdentifierPathArguments = 1;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifier.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.InstanceIdentifierOrBuilder>
           getInstanceIdentifierPathArgumentsFieldBuilder() {
         if (instanceIdentifierPathArgumentsBuilder_ == null) {
           instanceIdentifierPathArgumentsBuilder_ = new com.google.protobuf.SingleFieldBuilder<
@@ -6157,7 +6167,7 @@ public final class ShardTransactionMessages {
        * <code>required .org.opendaylight.controller.mdsal.Node normalizedNode = 2;</code>
        */
       private com.google.protobuf.SingleFieldBuilder<
-          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder> 
+          org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node.Builder, org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.NodeOrBuilder>
           getNormalizedNodeFieldBuilder() {
         if (normalizedNodeBuilder_ == null) {
           normalizedNodeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
index 4ccbc97..1b85d46 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
  */
 
 package org.opendaylight.controller.cluster.datastore.node;
@@ -15,9 +17,9 @@ import org.opendaylight.controller.cluster.datastore.node.utils.NodeIdentifierFa
 import org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeGetter;
 import org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeNavigator;
 import org.opendaylight.controller.cluster.datastore.util.TestModel;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Container;
 import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages.Node;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -32,127 +34,147 @@ public class NormalizedNodeToNodeCodecTest {
 
 
 
-    private SchemaContext schemaContext;
+  private SchemaContext schemaContext;
 
-    @Before
-    public void setUp(){
-        schemaContext = TestModel.createTestContext();
-        assertNotNull("Schema context must not be null.", schemaContext);
-    }
+  @Before
+  public void setUp() {
+    schemaContext = TestModel.createTestContext();
+    assertNotNull("Schema context must not be null.", schemaContext);
+  }
 
-    private YangInstanceIdentifier instanceIdentifierFromString(String s){
+  private YangInstanceIdentifier instanceIdentifierFromString(String s) {
 
-        String[] ids = s.split("/");
+    String[] ids = s.split("/");
 
-        List<YangInstanceIdentifier.PathArgument> pathArguments = new ArrayList<>();
-        for(String nodeId : ids){
-            if(!"".equals(nodeId)) {
-                pathArguments.add(NodeIdentifierFactory.getArgument(nodeId));
-            }
-        }
-        final YangInstanceIdentifier instanceIdentifier = YangInstanceIdentifier.create(pathArguments);
-        return instanceIdentifier;
+    List<YangInstanceIdentifier.PathArgument> pathArguments = new ArrayList<>();
+    for (String nodeId : ids) {
+      if (!"".equals(nodeId)) {
+        pathArguments.add(NodeIdentifierFactory.getArgument(nodeId));
+      }
     }
+    final YangInstanceIdentifier instanceIdentifier =
+        YangInstanceIdentifier.create(pathArguments);
+    return instanceIdentifier;
+  }
 
 
-    @Test
-    public void testNormalizeNodeAttributesToProtoBuffNode(){
-        final NormalizedNode<?, ?> documentOne = TestModel.createTestContainer();
-        String id = "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test" +
-            "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list" +
-            "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=2}]" +
-            "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id";
+  @Test
+  public void testNormalizeNodeAttributesToProtoBuffNode() {
+    final NormalizedNode<?, ?> documentOne = TestModel.createTestContainer();
+    String id =
+        "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test"
+            + "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list"
+            + "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)outer-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=2}]"
+            + "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id";
 
-        NormalizedNodeGetter normalizedNodeGetter = new NormalizedNodeGetter(id);
-        new NormalizedNodeNavigator(normalizedNodeGetter).navigate(
-            YangInstanceIdentifier.builder().build().toString(), documentOne);
+    NormalizedNodeGetter normalizedNodeGetter = new NormalizedNodeGetter(id);
+    new NormalizedNodeNavigator(normalizedNodeGetter).navigate(
+        YangInstanceIdentifier.builder().build().toString(), documentOne);
 
-        // Validate the value of id can be retrieved from the normalized node
-        NormalizedNode output = normalizedNodeGetter.getOutput();
-        assertNotNull(output);
+    // Validate the value of id can be retrieved from the normalized node
+    NormalizedNode output = normalizedNodeGetter.getOutput();
+    assertNotNull(output);
 
 
-      NormalizedNodeToNodeCodec codec = new NormalizedNodeToNodeCodec(schemaContext);
-      Container container = codec.encode(instanceIdentifierFromString(id),output);
+    NormalizedNodeToNodeCodec codec =
+        new NormalizedNodeToNodeCodec(schemaContext);
+    Container container =
+        codec.encode(instanceIdentifierFromString(id), output);
 
-       assertNotNull(container);
-       assertEquals(id, container.getParentPath()+"/"+container.getNormalizedNode().getPath()) ;
+    assertNotNull(container);
+    assertEquals(id, container.getParentPath() + "/"
+        + container.getNormalizedNode().getPath());
 
-      // Decode the normalized node from the ProtocolBuffer form
-      //first get the node representation of normalized node
-      final Node node = container.getNormalizedNode();
+    // Decode the normalized node from the ProtocolBuffer form
+    // first get the node representation of normalized node
+    final Node node = container.getNormalizedNode();
 
-      NormalizedNode<?,?> normalizedNode = codec.decode(instanceIdentifierFromString(id),node);
+    NormalizedNode<?, ?> normalizedNode =
+        codec.decode(instanceIdentifierFromString(id), node);
 
-      assertEquals(normalizedNode.getValue().toString(),output.getValue().toString());
-    }
+    assertEquals(normalizedNode.getValue().toString(), output.getValue()
+        .toString());
+  }
 
-    @Test
-    public void testThatANormalizedNodeToProtoBuffNodeEncodeDecode() throws Exception {
-        final NormalizedNode<?, ?> documentOne = TestModel.createTestContainer();
+  @Test
+  public void testThatANormalizedNodeToProtoBuffNodeEncodeDecode()
+      throws Exception {
+    final NormalizedNode<?, ?> documentOne = TestModel.createTestContainer();
 
-        final NormalizedNodeToNodeCodec normalizedNodeToNodeCodec = new NormalizedNodeToNodeCodec(schemaContext);
+    final NormalizedNodeToNodeCodec normalizedNodeToNodeCodec =
+        new NormalizedNodeToNodeCodec(schemaContext);
 
-        Container container = normalizedNodeToNodeCodec.encode(YangInstanceIdentifier.builder().build(), documentOne);
+    Container container =
+        normalizedNodeToNodeCodec.encode(YangInstanceIdentifier.builder()
+            .build(), documentOne);
 
 
-        final NormalizedNode<?, ?> decode = normalizedNodeToNodeCodec.decode(instanceIdentifierFromString("/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test"),container.getNormalizedNode());
-        assertNotNull(decode != null);
+    final NormalizedNode<?, ?> decode =
+        normalizedNodeToNodeCodec
+            .decode(
+                instanceIdentifierFromString("/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test"),
+                container.getNormalizedNode());
+    assertNotNull(decode != null);
 
-        //let us ensure that the return decode normalized node encode returns same container
-        Container containerResult =  normalizedNodeToNodeCodec.encode(YangInstanceIdentifier.builder().build(), decode);
+    // let us ensure that the return decode normalized node encode returns same container
+    Container containerResult =
+        normalizedNodeToNodeCodec.encode(YangInstanceIdentifier.builder()
+            .build(), decode);
 
-        assertEquals(container.getParentPath(),containerResult.getParentPath());
-        assertEquals(container.getNormalizedNode().getChildCount(),container.getNormalizedNode().getChildCount());
+    assertEquals(container.getParentPath(), containerResult.getParentPath());
+    assertEquals(container.getNormalizedNode().getChildCount(), container
+        .getNormalizedNode().getChildCount());
 
-        Assert.assertEquals(containerResult.getNormalizedNode().getChildCount(),container.getNormalizedNode().getChildCount());
+    Assert.assertEquals(containerResult.getNormalizedNode().getChildCount(),
+        container.getNormalizedNode().getChildCount());
 
-        //check first level children are proper
-        List<Node>childrenResult = containerResult.getNormalizedNode().getChildList();
-        List<Node>childrenOriginal = container.getNormalizedNode().getChildList();
+    // check first level children are proper
+    List<Node> childrenResult =
+        containerResult.getNormalizedNode().getChildList();
+    List<Node> childrenOriginal = container.getNormalizedNode().getChildList();
 
-        System.out.println("-------------------------------------------------");
+    System.out.println("-------------------------------------------------");
 
-        System.out.println(childrenOriginal.toString());
+    System.out.println(childrenOriginal.toString());
 
-        System.out.println("-------------------------------------------------");
+    System.out.println("-------------------------------------------------");
 
-        System.out.println(childrenResult.toString());
+    System.out.println(childrenResult.toString());
 
-       boolean bFound;
-        for(Node resultChild: childrenResult){
-           bFound = false;
-          for(Node originalChild:childrenOriginal){
-            if(originalChild.getPath().equals(resultChild.getPath())
-                && resultChild.getType().equals(resultChild.getType())){
-               bFound=true;
-               break;
-            }
-          }
-          Assert.assertTrue(bFound);
+    boolean bFound;
+    for (Node resultChild : childrenResult) {
+      bFound = false;
+      for (Node originalChild : childrenOriginal) {
+        if (originalChild.getPath().equals(resultChild.getPath())
+            && resultChild.getType().equals(resultChild.getType())) {
+          bFound = true;
+          break;
         }
-
+      }
+      Assert.assertTrue(bFound);
     }
 
-    @Test
-    public void addAugmentations(){
-        String stringId = "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test" +
-            "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)augmented-list" +
-            "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)augmented-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=1}]";
+  }
 
-        YangInstanceIdentifier identifier = instanceIdentifierFromString(stringId);
+  @Test
+  public void addAugmentations() {
+    String stringId =
+        "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test"
+            + "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)augmented-list"
+            + "/(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)augmented-list[{(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)id=1}]";
 
-        MapEntryNode uno = TestModel.createAugmentedListEntry(1, "Uno");
+    YangInstanceIdentifier identifier = instanceIdentifierFromString(stringId);
 
-        NormalizedNodeToNodeCodec codec =
-            new NormalizedNodeToNodeCodec(schemaContext);
+    MapEntryNode uno = TestModel.createAugmentedListEntry(1, "Uno");
 
-        Container encode = codec
-            .encode(identifier, uno);
+    NormalizedNodeToNodeCodec codec =
+        new NormalizedNodeToNodeCodec(schemaContext);
 
-        System.out.println(encode.getNormalizedNode());
+    Container encode = codec.encode(identifier, uno);
 
-        codec.decode(identifier, encode.getNormalizedNode());
-    }
+    System.out.println(encode.getNormalizedNode());
+
+    codec.decode(identifier, encode.getNormalizedNode());
+  }
 
 }
index 4b0bde8..4da7d8c 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import junit.framework.Assert;
@@ -6,15 +16,16 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class NodeIdentifierFactoryTest {
 
-    @Test
-    public void validateAugmentationIdentifier(){
-        YangInstanceIdentifier.PathArgument argument = NodeIdentifierFactory
-            .getArgument(
-                "AugmentationIdentifier{childNames=[(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics]}");
+  @Test
+  public void validateAugmentationIdentifier() {
+    YangInstanceIdentifier.PathArgument argument =
+        NodeIdentifierFactory
+            .getArgument("AugmentationIdentifier{childNames=[(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics]}");
 
-        Assert.assertTrue(argument instanceof YangInstanceIdentifier.AugmentationIdentifier);
+    Assert
+        .assertTrue(argument instanceof YangInstanceIdentifier.AugmentationIdentifier);
 
 
-    }
+  }
 
 }
index bb246fb..136748e 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.util;
 
 import org.junit.Assert;
@@ -13,129 +23,139 @@ import java.util.List;
 
 public class InstanceIdentifierUtilsTest {
 
-    private static QName TEST_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test");
-    private static QName NODE_WITH_VALUE_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)value");
-    private static QName NODE_WITH_PREDICATES_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)pred");
-    private static QName NAME_QNAME = QName.create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)name");
+  private static QName TEST_QNAME =
+      QName
+          .create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)test");
+  private static QName NODE_WITH_VALUE_QNAME =
+      QName
+          .create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)value");
+  private static QName NODE_WITH_PREDICATES_QNAME =
+      QName
+          .create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)pred");
+  private static QName NAME_QNAME =
+      QName
+          .create("(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test?revision=2014-03-13)name");
 
-    @Test
-    public void testSerializationOfNodeIdentifier(){
-        YangInstanceIdentifier.PathArgument p1 =
-            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+  @Test
+  public void testSerializationOfNodeIdentifier() {
+    YangInstanceIdentifier.PathArgument p1 =
+        new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
 
-        List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+    List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
 
-        arguments.add(p1);
+    arguments.add(p1);
 
-        YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+    YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
 
-        NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
-            InstanceIdentifierUtils.toSerializable(expected);
+    NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+        InstanceIdentifierUtils.toSerializable(expected);
 
-        YangInstanceIdentifier actual =
-            InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+    YangInstanceIdentifier actual =
+        InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
 
 
-        Assert.assertEquals(expected.getLastPathArgument(),
-            actual.getLastPathArgument());
+    Assert.assertEquals(expected.getLastPathArgument(),
+        actual.getLastPathArgument());
 
 
-    }
+  }
 
-    @Test
-    public void testSerializationOfNodeWithValue(){
+  @Test
+  public void testSerializationOfNodeWithValue() {
 
-        withValue((short) 1);
-        withValue((long) 2);
-        withValue(3);
-        withValue(true);
+    withValue((short) 1);
+    withValue((long) 2);
+    withValue(3);
+    withValue(true);
 
-    }
+  }
 
-    private void withValue(Object value){
-        YangInstanceIdentifier.PathArgument p1 =
-            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+  private void withValue(Object value) {
+    YangInstanceIdentifier.PathArgument p1 =
+        new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
 
-        YangInstanceIdentifier.PathArgument p2 =
-            new YangInstanceIdentifier.NodeWithValue(NODE_WITH_VALUE_QNAME, value);
+    YangInstanceIdentifier.PathArgument p2 =
+        new YangInstanceIdentifier.NodeWithValue(NODE_WITH_VALUE_QNAME, value);
 
 
-        List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+    List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
 
-        arguments.add(p1);
-        arguments.add(p2);
+    arguments.add(p1);
+    arguments.add(p2);
 
-        YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+    YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
 
-        NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
-            InstanceIdentifierUtils.toSerializable(expected);
+    NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+        InstanceIdentifierUtils.toSerializable(expected);
 
-        YangInstanceIdentifier actual =
-            InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+    YangInstanceIdentifier actual =
+        InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
 
 
-        Assert.assertEquals(expected.getLastPathArgument(),
-            actual.getLastPathArgument());
-    }
+    Assert.assertEquals(expected.getLastPathArgument(),
+        actual.getLastPathArgument());
+  }
 
 
-    @Test
-    public void testSerializationOfNodeIdentifierWithPredicates(){
+  @Test
+  public void testSerializationOfNodeIdentifierWithPredicates() {
 
-        withPredicates((short) 1);
-        withPredicates((long) 2);
-        withPredicates(3);
-        withPredicates(true);
+    withPredicates((short) 1);
+    withPredicates((long) 2);
+    withPredicates(3);
+    withPredicates(true);
 
-    }
+  }
 
-    private void withPredicates(Object value){
-        YangInstanceIdentifier.PathArgument p1 =
-            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
+  private void withPredicates(Object value) {
+    YangInstanceIdentifier.PathArgument p1 =
+        new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME);
 
-        YangInstanceIdentifier.PathArgument p2 =
-            new YangInstanceIdentifier.NodeIdentifierWithPredicates(NODE_WITH_PREDICATES_QNAME, NAME_QNAME, value);
+    YangInstanceIdentifier.PathArgument p2 =
+        new YangInstanceIdentifier.NodeIdentifierWithPredicates(
+            NODE_WITH_PREDICATES_QNAME, NAME_QNAME, value);
 
 
-        List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+    List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
 
-        arguments.add(p1);
-        arguments.add(p2);
+    arguments.add(p1);
+    arguments.add(p2);
 
-        YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+    YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
 
-        NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
-            InstanceIdentifierUtils.toSerializable(expected);
+    NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+        InstanceIdentifierUtils.toSerializable(expected);
 
-        YangInstanceIdentifier actual =
-            InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+    YangInstanceIdentifier actual =
+        InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
 
 
-        Assert.assertEquals(expected.getLastPathArgument(),
-            actual.getLastPathArgument());
-    }
+    Assert.assertEquals(expected.getLastPathArgument(),
+        actual.getLastPathArgument());
+  }
 
-    @Test
-    public void testAugmentationIdentifier(){
-        YangInstanceIdentifier.PathArgument p1 =
-            new YangInstanceIdentifier.AugmentationIdentifier(new HashSet(Arrays.asList(TEST_QNAME)));
+  @Test
+  public void testAugmentationIdentifier() {
+    YangInstanceIdentifier.PathArgument p1 =
+        new YangInstanceIdentifier.AugmentationIdentifier(new HashSet(
+            Arrays.asList(TEST_QNAME)));
 
-        List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
+    List<YangInstanceIdentifier.PathArgument> arguments = new ArrayList<>();
 
-        arguments.add(p1);
+    arguments.add(p1);
 
-        YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
+    YangInstanceIdentifier expected = YangInstanceIdentifier.create(arguments);
 
-        NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
-            InstanceIdentifierUtils.toSerializable(expected);
+    NormalizedNodeMessages.InstanceIdentifier instanceIdentifier =
+        InstanceIdentifierUtils.toSerializable(expected);
 
-        YangInstanceIdentifier actual =
-            InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
+    YangInstanceIdentifier actual =
+        InstanceIdentifierUtils.fromSerializable(instanceIdentifier);
 
 
-        Assert.assertEquals(expected.getLastPathArgument(),
-            actual.getLastPathArgument());
+    Assert.assertEquals(expected.getLastPathArgument(),
+        actual.getLastPathArgument());
 
-    }
+  }
 
 }
index fb28704..853b3e2 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
  *
- * This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
  */
 package org.opendaylight.controller.cluster.datastore.util;
 
@@ -71,8 +73,8 @@ import java.util.Set;
 
 
 /**
- * Two of the testcases in the yangtools/yang-data-impl are leveraged (with  modification) to
- * create the serialization of NormalizedNode using the ProtocolBuffer
+ * Two of the testcases in the yangtools/yang-data-impl are leveraged (with modification) to create
+ * the serialization of NormalizedNode using the ProtocolBuffer
  *
  * @syedbahm
  *
@@ -80,403 +82,402 @@ import java.util.Set;
 
 
 public class NormalizedNodeXmlConverterTest {
-    private static final Logger logger = LoggerFactory
-        .getLogger(NormalizedNodeXmlConverterTest.class);
-    public static final String NAMESPACE =
-        "urn:opendaylight:params:xml:ns:yang:controller:test";
-    private static Date revision;
-    private ContainerNode expectedNode;
-    private ContainerSchemaNode containerNode;
-    private String xmlPath;
-
-    static {
-        try {
-            revision = new SimpleDateFormat("yyyy-MM-dd").parse("2014-03-13");
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static DataSchemaNode getSchemaNode(final SchemaContext context,
-        final String moduleName, final String childNodeName) {
-        for (Module module : context.getModules()) {
-            if (module.getName().equals(moduleName)) {
-                DataSchemaNode found =
-                    findChildNode(module.getChildNodes(), childNodeName);
-                Preconditions.checkState(found != null, "Unable to find %s",
-                    childNodeName);
-                return found;
-            }
-        }
-        throw new IllegalStateException("Unable to find child node "
-            + childNodeName);
+  private static final Logger logger = LoggerFactory
+      .getLogger(NormalizedNodeXmlConverterTest.class);
+  public static final String NAMESPACE =
+      "urn:opendaylight:params:xml:ns:yang:controller:test";
+  private static Date revision;
+  private ContainerNode expectedNode;
+  private ContainerSchemaNode containerNode;
+  private String xmlPath;
+
+  static {
+    try {
+      revision = new SimpleDateFormat("yyyy-MM-dd").parse("2014-03-13");
+    } catch (ParseException e) {
+      throw new RuntimeException(e);
     }
-
-    static DataSchemaNode findChildNode(final Collection<DataSchemaNode> children, final String name) {
-        List<DataNodeContainer> containers = Lists.newArrayList();
-
-        for (DataSchemaNode dataSchemaNode : children) {
-            if (dataSchemaNode.getQName().getLocalName().equals(name)) {
-                return dataSchemaNode;
-            }
-            if (dataSchemaNode instanceof DataNodeContainer) {
-                containers.add((DataNodeContainer) dataSchemaNode);
-            } else if (dataSchemaNode instanceof ChoiceNode) {
-                containers.addAll(((ChoiceNode) dataSchemaNode).getCases());
-            }
-        }
-
-        for (DataNodeContainer container : containers) {
-            DataSchemaNode retVal = findChildNode(container.getChildNodes(), name);
-            if (retVal != null) {
-                return retVal;
-            }
-        }
-
-        return null;
+  }
+
+  public static DataSchemaNode getSchemaNode(final SchemaContext context,
+      final String moduleName, final String childNodeName) {
+    for (Module module : context.getModules()) {
+      if (module.getName().equals(moduleName)) {
+        DataSchemaNode found =
+            findChildNode(module.getChildNodes(), childNodeName);
+        Preconditions.checkState(found != null, "Unable to find %s",
+            childNodeName);
+        return found;
+      }
     }
-
-    public static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(
-        final String localName) {
-        return new YangInstanceIdentifier.NodeIdentifier(QName.create(
-            URI.create(NAMESPACE), revision, localName));
+    throw new IllegalStateException("Unable to find child node "
+        + childNodeName);
+  }
+
+  static DataSchemaNode findChildNode(
+      final Collection<DataSchemaNode> children, final String name) {
+    List<DataNodeContainer> containers = Lists.newArrayList();
+
+    for (DataSchemaNode dataSchemaNode : children) {
+      if (dataSchemaNode.getQName().getLocalName().equals(name)) {
+        return dataSchemaNode;
+      }
+      if (dataSchemaNode instanceof DataNodeContainer) {
+        containers.add((DataNodeContainer) dataSchemaNode);
+      } else if (dataSchemaNode instanceof ChoiceNode) {
+        containers.addAll(((ChoiceNode) dataSchemaNode).getCases());
+      }
     }
 
-    public static YangInstanceIdentifier.AugmentationIdentifier getAugmentIdentifier(
-        final String... childNames) {
-        Set<QName> qn = Sets.newHashSet();
-
-        for (String childName : childNames) {
-            qn.add(getNodeIdentifier(childName).getNodeType());
-        }
-
-        return new YangInstanceIdentifier.AugmentationIdentifier(qn);
+    for (DataNodeContainer container : containers) {
+      DataSchemaNode retVal = findChildNode(container.getChildNodes(), name);
+      if (retVal != null) {
+        return retVal;
+      }
     }
 
+    return null;
+  }
 
-    public static ContainerNode augmentChoiceExpectedNode() {
-
-        DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> b =
-            Builders.containerBuilder();
-        b.withNodeIdentifier(getNodeIdentifier("container"));
-
-        b.withChild(Builders
-            .choiceBuilder()
-            .withNodeIdentifier(getNodeIdentifier("ch2"))
-            .withChild(
-                Builders.leafBuilder()
-                    .withNodeIdentifier(getNodeIdentifier("c2Leaf")).withValue("2")
-                    .build())
-            .withChild(
-                Builders
-                    .choiceBuilder()
-                    .withNodeIdentifier(getNodeIdentifier("c2DeepChoice"))
-                    .withChild(
-                        Builders
-                            .leafBuilder()
-                            .withNodeIdentifier(
-                                getNodeIdentifier("c2DeepChoiceCase1Leaf2"))
-                            .withValue("2").build()).build()).build());
-
-        b.withChild(Builders
-            .choiceBuilder()
-            .withNodeIdentifier(getNodeIdentifier("ch3"))
-            .withChild(
-                Builders.leafBuilder()
-                    .withNodeIdentifier(getNodeIdentifier("c3Leaf")).withValue("3")
-                    .build()).build());
-
-        b.withChild(Builders
-            .augmentationBuilder()
-            .withNodeIdentifier(getAugmentIdentifier("augLeaf"))
-            .withChild(
-                Builders.leafBuilder()
-                    .withNodeIdentifier(getNodeIdentifier("augLeaf"))
-                    .withValue("augment").build()).build());
-
-        b.withChild(Builders
-            .augmentationBuilder()
-            .withNodeIdentifier(getAugmentIdentifier("ch"))
-            .withChild(
-                Builders
-                    .choiceBuilder()
-                    .withNodeIdentifier(getNodeIdentifier("ch"))
-                    .withChild(
-                        Builders.leafBuilder()
-                            .withNodeIdentifier(getNodeIdentifier("c1Leaf"))
-                            .withValue("1").build())
-                    .withChild(
-                        Builders
-                            .augmentationBuilder()
-                            .withNodeIdentifier(
-                                getAugmentIdentifier("c1Leaf_AnotherAugment",
-                                    "deepChoice"))
-                            .withChild(
-                                Builders
-                                    .leafBuilder()
-                                    .withNodeIdentifier(
-                                        getNodeIdentifier("c1Leaf_AnotherAugment"))
-                                    .withValue("1").build())
-                            .withChild(
-                                Builders
-                                    .choiceBuilder()
-                                    .withNodeIdentifier(
-                                        getNodeIdentifier("deepChoice"))
-                                    .withChild(
-                                        Builders
-                                            .leafBuilder()
-                                            .withNodeIdentifier(
-                                                getNodeIdentifier("deepLeafc1"))
-                                            .withValue("1").build()).build())
-                            .build()).build()).build());
-
-        return b.build();
-    }
-
+  public static YangInstanceIdentifier.NodeIdentifier getNodeIdentifier(
+      final String localName) {
+    return new YangInstanceIdentifier.NodeIdentifier(QName.create(
+        URI.create(NAMESPACE), revision, localName));
+  }
 
+  public static YangInstanceIdentifier.AugmentationIdentifier getAugmentIdentifier(
+      final String... childNames) {
+    Set<QName> qn = Sets.newHashSet();
 
-    public void init(final String yangPath, final String xmlPath, final ContainerNode expectedNode)
-        throws Exception {
-        SchemaContext schema = parseTestSchema(yangPath);
-        this.xmlPath = xmlPath;
-        this.containerNode =
-            (ContainerSchemaNode) getSchemaNode(schema, "test", "container");
-        this.expectedNode = expectedNode;
+    for (String childName : childNames) {
+      qn.add(getNodeIdentifier(childName).getNodeType());
     }
 
-    SchemaContext parseTestSchema(final String yangPath) throws Exception {
-
-        YangParserImpl yangParserImpl = new YangParserImpl();
-        InputStream stream =
-            NormalizedNodeXmlConverterTest.class.getResourceAsStream(yangPath);
-        ArrayList<InputStream> al = new ArrayList<InputStream>();
-        al.add(stream);
-        Set<Module> modules = yangParserImpl.parseYangModelsFromStreams(al);
-        return yangParserImpl.resolveSchemaContext(modules);
-
+    return new YangInstanceIdentifier.AugmentationIdentifier(qn);
+  }
+
+
+  public static ContainerNode augmentChoiceExpectedNode() {
+
+    DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> b =
+        Builders.containerBuilder();
+    b.withNodeIdentifier(getNodeIdentifier("container"));
+
+    b.withChild(Builders
+        .choiceBuilder()
+        .withNodeIdentifier(getNodeIdentifier("ch2"))
+        .withChild(
+            Builders.leafBuilder()
+                .withNodeIdentifier(getNodeIdentifier("c2Leaf")).withValue("2")
+                .build())
+        .withChild(
+            Builders
+                .choiceBuilder()
+                .withNodeIdentifier(getNodeIdentifier("c2DeepChoice"))
+                .withChild(
+                    Builders
+                        .leafBuilder()
+                        .withNodeIdentifier(
+                            getNodeIdentifier("c2DeepChoiceCase1Leaf2"))
+                        .withValue("2").build()).build()).build());
+
+    b.withChild(Builders
+        .choiceBuilder()
+        .withNodeIdentifier(getNodeIdentifier("ch3"))
+        .withChild(
+            Builders.leafBuilder()
+                .withNodeIdentifier(getNodeIdentifier("c3Leaf")).withValue("3")
+                .build()).build());
+
+    b.withChild(Builders
+        .augmentationBuilder()
+        .withNodeIdentifier(getAugmentIdentifier("augLeaf"))
+        .withChild(
+            Builders.leafBuilder()
+                .withNodeIdentifier(getNodeIdentifier("augLeaf"))
+                .withValue("augment").build()).build());
+
+    b.withChild(Builders
+        .augmentationBuilder()
+        .withNodeIdentifier(getAugmentIdentifier("ch"))
+        .withChild(
+            Builders
+                .choiceBuilder()
+                .withNodeIdentifier(getNodeIdentifier("ch"))
+                .withChild(
+                    Builders.leafBuilder()
+                        .withNodeIdentifier(getNodeIdentifier("c1Leaf"))
+                        .withValue("1").build())
+                .withChild(
+                    Builders
+                        .augmentationBuilder()
+                        .withNodeIdentifier(
+                            getAugmentIdentifier("c1Leaf_AnotherAugment",
+                                "deepChoice"))
+                        .withChild(
+                            Builders
+                                .leafBuilder()
+                                .withNodeIdentifier(
+                                    getNodeIdentifier("c1Leaf_AnotherAugment"))
+                                .withValue("1").build())
+                        .withChild(
+                            Builders
+                                .choiceBuilder()
+                                .withNodeIdentifier(
+                                    getNodeIdentifier("deepChoice"))
+                                .withChild(
+                                    Builders
+                                        .leafBuilder()
+                                        .withNodeIdentifier(
+                                            getNodeIdentifier("deepLeafc1"))
+                                        .withValue("1").build()).build())
+                        .build()).build()).build());
+
+    return b.build();
+  }
+
+
+
+  public void init(final String yangPath, final String xmlPath,
+      final ContainerNode expectedNode) throws Exception {
+    SchemaContext schema = parseTestSchema(yangPath);
+    this.xmlPath = xmlPath;
+    this.containerNode =
+        (ContainerSchemaNode) getSchemaNode(schema, "test", "container");
+    this.expectedNode = expectedNode;
+  }
+
+  SchemaContext parseTestSchema(final String yangPath) throws Exception {
+
+    YangParserImpl yangParserImpl = new YangParserImpl();
+    InputStream stream =
+        NormalizedNodeXmlConverterTest.class.getResourceAsStream(yangPath);
+    ArrayList<InputStream> al = new ArrayList<InputStream>();
+    al.add(stream);
+    Set<Module> modules = yangParserImpl.parseYangModelsFromStreams(al);
+    return yangParserImpl.resolveSchemaContext(modules);
+
+  }
+
+
+  @Test
+  public void testConversionWithAugmentChoice() throws Exception {
+    init("/augment_choice.yang", "/augment_choice.xml",
+        augmentChoiceExpectedNode());
+    Document doc = loadDocument(xmlPath);
+
+    ContainerNode built =
+        DomToNormalizedNodeParserFactory
+            .getInstance(DomUtils.defaultValueCodecProvider())
+            .getContainerNodeParser()
+            .parse(Collections.singletonList(doc.getDocumentElement()),
+                containerNode);
+
+    if (expectedNode != null) {
+      junit.framework.Assert.assertEquals(expectedNode, built);
     }
 
+    logger.info("{}", built);
 
-    @Test
-    public void testConversionWithAugmentChoice() throws Exception {
-        init("/augment_choice.yang", "/augment_choice.xml",
-            augmentChoiceExpectedNode());
-        Document doc = loadDocument(xmlPath);
+    Iterable<Element> els =
+        DomFromNormalizedNodeSerializerFactory
+            .getInstance(XmlDocumentUtils.getDocument(),
+                DomUtils.defaultValueCodecProvider())
+            .getContainerNodeSerializer().serialize(containerNode, built);
 
-        ContainerNode built =
-            DomToNormalizedNodeParserFactory
-                .getInstance(DomUtils.defaultValueCodecProvider())
-                .getContainerNodeParser()
-                .parse(Collections.singletonList(doc.getDocumentElement()),
-                    containerNode);
+    Element el = els.iterator().next();
 
-        if (expectedNode != null) {
-            junit.framework.Assert.assertEquals(expectedNode, built);
-        }
+    XMLUnit.setIgnoreWhitespace(true);
+    XMLUnit.setIgnoreComments(true);
 
-        logger.info("{}", built);
+    System.out.println(toString(doc.getDocumentElement()));
+    System.out.println(toString(el));
 
-        Iterable<Element> els =
-            DomFromNormalizedNodeSerializerFactory
-                .getInstance(XmlDocumentUtils.getDocument(),
-                    DomUtils.defaultValueCodecProvider())
-                .getContainerNodeSerializer().serialize(containerNode, built);
+    new Diff(XMLUnit.buildControlDocument(toString(doc.getDocumentElement())),
+        XMLUnit.buildTestDocument(toString(el))).similar();
+  }
 
-        Element el = els.iterator().next();
+  private static ContainerNode listLeafListWithAttributes() {
+    DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> b =
+        Builders.containerBuilder();
+    b.withNodeIdentifier(getNodeIdentifier("container"));
 
-        XMLUnit.setIgnoreWhitespace(true);
-        XMLUnit.setIgnoreComments(true);
+    CollectionNodeBuilder<MapEntryNode, MapNode> listBuilder =
+        Builders.mapBuilder().withNodeIdentifier(getNodeIdentifier("list"));
 
-        System.out.println(toString(doc.getDocumentElement()));
-        System.out.println(toString(el));
+    Map<QName, Object> predicates = Maps.newHashMap();
+    predicates.put(getNodeIdentifier("uint32InList").getNodeType(), 3L);
 
-        new Diff(
-            XMLUnit.buildControlDocument(toString(doc.getDocumentElement())),
-            XMLUnit.buildTestDocument(toString(el))).similar();
-    }
+    DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> list1Builder =
+        Builders.mapEntryBuilder().withNodeIdentifier(
+            new YangInstanceIdentifier.NodeIdentifierWithPredicates(
+                getNodeIdentifier("list").getNodeType(), predicates));
+    NormalizedNodeBuilder<YangInstanceIdentifier.NodeIdentifier, Object, LeafNode<Object>> uint32InListBuilder =
+        Builders.leafBuilder().withNodeIdentifier(
+            getNodeIdentifier("uint32InList"));
 
-    private static ContainerNode listLeafListWithAttributes() {
-        DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> b =
-            Builders.containerBuilder();
-        b.withNodeIdentifier(getNodeIdentifier("container"));
+    list1Builder.withChild(uint32InListBuilder.withValue(3L).build());
 
-        CollectionNodeBuilder<MapEntryNode, MapNode> listBuilder =
-            Builders.mapBuilder().withNodeIdentifier(getNodeIdentifier("list"));
+    listBuilder.withChild(list1Builder.build());
+    b.withChild(listBuilder.build());
 
-        Map<QName, Object> predicates = Maps.newHashMap();
-        predicates.put(getNodeIdentifier("uint32InList").getNodeType(), 3L);
+    NormalizedNodeBuilder<YangInstanceIdentifier.NodeIdentifier, Object, LeafNode<Object>> booleanBuilder =
+        Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("boolean"));
+    booleanBuilder.withValue(false);
+    b.withChild(booleanBuilder.build());
 
-        DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> list1Builder =
-            Builders.mapEntryBuilder().withNodeIdentifier(
-                new YangInstanceIdentifier.NodeIdentifierWithPredicates(
-                    getNodeIdentifier("list").getNodeType(), predicates));
-        NormalizedNodeBuilder<YangInstanceIdentifier.NodeIdentifier, Object, LeafNode<Object>> uint32InListBuilder =
-            Builders.leafBuilder().withNodeIdentifier(
-                getNodeIdentifier("uint32InList"));
+    ListNodeBuilder<Object, LeafSetEntryNode<Object>> leafListBuilder =
+        Builders.leafSetBuilder().withNodeIdentifier(
+            getNodeIdentifier("leafList"));
 
-        list1Builder.withChild(uint32InListBuilder.withValue(3L).build());
+    NormalizedNodeBuilder<YangInstanceIdentifier.NodeWithValue, Object, LeafSetEntryNode<Object>> leafList1Builder =
+        Builders.leafSetEntryBuilder().withNodeIdentifier(
+            new YangInstanceIdentifier.NodeWithValue(getNodeIdentifier(
+                "leafList").getNodeType(), "a"));
 
-        listBuilder.withChild(list1Builder.build());
-        b.withChild(listBuilder.build());
+    leafList1Builder.withValue("a");
 
-        NormalizedNodeBuilder<YangInstanceIdentifier.NodeIdentifier, Object, LeafNode<Object>> booleanBuilder =
-            Builders.leafBuilder().withNodeIdentifier(getNodeIdentifier("boolean"));
-        booleanBuilder.withValue(false);
-        b.withChild(booleanBuilder.build());
+    leafListBuilder.withChild(leafList1Builder.build());
+    b.withChild(leafListBuilder.build());
 
-        ListNodeBuilder<Object, LeafSetEntryNode<Object>> leafListBuilder =
-            Builders.leafSetBuilder().withNodeIdentifier(
-                getNodeIdentifier("leafList"));
+    return b.build();
+  }
 
-        NormalizedNodeBuilder<YangInstanceIdentifier.NodeWithValue, Object, LeafSetEntryNode<Object>> leafList1Builder =
-            Builders.leafSetEntryBuilder().withNodeIdentifier(
-                new YangInstanceIdentifier.NodeWithValue(getNodeIdentifier("leafList")
-                    .getNodeType(), "a"));
 
-        leafList1Builder.withValue("a");
+  @Test
+  public void testConversionWithAttributes() throws Exception {
+    init("/test.yang", "/simple_xml_with_attributes.xml",
+        listLeafListWithAttributes());
+    Document doc = loadDocument(xmlPath);
 
-        leafListBuilder.withChild(leafList1Builder.build());
-        b.withChild(leafListBuilder.build());
+    ContainerNode built =
+        DomToNormalizedNodeParserFactory
+            .getInstance(DomUtils.defaultValueCodecProvider())
+            .getContainerNodeParser()
+            .parse(Collections.singletonList(doc.getDocumentElement()),
+                containerNode);
 
-        return b.build();
+    if (expectedNode != null) {
+      junit.framework.Assert.assertEquals(expectedNode, built);
     }
 
+    logger.info("{}", built);
 
-    @Test
-    public void testConversionWithAttributes() throws Exception {
-        init("/test.yang", "/simple_xml_with_attributes.xml",
-            listLeafListWithAttributes());
-        Document doc = loadDocument(xmlPath);
+    Iterable<Element> els =
+        DomFromNormalizedNodeSerializerFactory
+            .getInstance(XmlDocumentUtils.getDocument(),
+                DomUtils.defaultValueCodecProvider())
+            .getContainerNodeSerializer().serialize(containerNode, built);
 
-        ContainerNode built =
-            DomToNormalizedNodeParserFactory
-                .getInstance(DomUtils.defaultValueCodecProvider())
-                .getContainerNodeParser()
-                .parse(Collections.singletonList(doc.getDocumentElement()),
-                    containerNode);
+    Element el = els.iterator().next();
 
-        if (expectedNode != null) {
-            junit.framework.Assert.assertEquals(expectedNode, built);
-        }
+    XMLUnit.setIgnoreWhitespace(true);
+    XMLUnit.setIgnoreComments(true);
 
-        logger.info("{}", built);
+    System.out.println(toString(doc.getDocumentElement()));
+    System.out.println(toString(el));
 
-        Iterable<Element> els =
-            DomFromNormalizedNodeSerializerFactory
-                .getInstance(XmlDocumentUtils.getDocument(),
-                    DomUtils.defaultValueCodecProvider())
-                .getContainerNodeSerializer().serialize(containerNode, built);
+    new Diff(XMLUnit.buildControlDocument(toString(doc.getDocumentElement())),
+        XMLUnit.buildTestDocument(toString(el))).similar();
+  }
 
-        Element el = els.iterator().next();
 
-        XMLUnit.setIgnoreWhitespace(true);
-        XMLUnit.setIgnoreComments(true);
+  private Document loadDocument(final String xmlPath) throws Exception {
+    InputStream resourceAsStream =
+        NormalizedNodeXmlConverterTest.class.getResourceAsStream(xmlPath);
 
-        System.out.println(toString(doc.getDocumentElement()));
-        System.out.println(toString(el));
+    Document currentConfigElement = readXmlToDocument(resourceAsStream);
+    Preconditions.checkNotNull(currentConfigElement);
+    return currentConfigElement;
+  }
 
-        new Diff(
-            XMLUnit.buildControlDocument(toString(doc.getDocumentElement())),
-            XMLUnit.buildTestDocument(toString(el))).similar();
-    }
+  private static final DocumentBuilderFactory BUILDERFACTORY;
 
+  static {
+    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+    factory.setNamespaceAware(true);
+    factory.setCoalescing(true);
+    factory.setIgnoringElementContentWhitespace(true);
+    factory.setIgnoringComments(true);
+    BUILDERFACTORY = factory;
+  }
 
-    private Document loadDocument(final String xmlPath) throws Exception {
-        InputStream resourceAsStream =
-            NormalizedNodeXmlConverterTest.class.getResourceAsStream(xmlPath);
-
-        Document currentConfigElement = readXmlToDocument(resourceAsStream);
-        Preconditions.checkNotNull(currentConfigElement);
-        return currentConfigElement;
-    }
-
-    private static final DocumentBuilderFactory BUILDERFACTORY;
-
-    static {
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        factory.setNamespaceAware(true);
-        factory.setCoalescing(true);
-        factory.setIgnoringElementContentWhitespace(true);
-        factory.setIgnoringComments(true);
-        BUILDERFACTORY = factory;
+  private Document readXmlToDocument(final InputStream xmlContent)
+      throws IOException, SAXException {
+    DocumentBuilder dBuilder;
+    try {
+      dBuilder = BUILDERFACTORY.newDocumentBuilder();
+    } catch (ParserConfigurationException e) {
+      throw new RuntimeException("Failed to parse XML document", e);
     }
-
-    private Document readXmlToDocument(final InputStream xmlContent)
-        throws IOException, SAXException {
-        DocumentBuilder dBuilder;
-        try {
-            dBuilder = BUILDERFACTORY.newDocumentBuilder();
-        } catch (ParserConfigurationException e) {
-            throw new RuntimeException("Failed to parse XML document", e);
-        }
-        Document doc = dBuilder.parse(xmlContent);
-
-        doc.getDocumentElement().normalize();
-        return doc;
-    }
-
-    public static String toString(final Element xml) {
-        try {
-            Transformer transformer =
-                TransformerFactory.newInstance().newTransformer();
-            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-
-            StreamResult result = new StreamResult(new StringWriter());
-            DOMSource source = new DOMSource(xml);
-            transformer.transform(source, result);
-
-            return result.getWriter().toString();
-        } catch (IllegalArgumentException | TransformerFactoryConfigurationError
-            | TransformerException e) {
-            throw new RuntimeException("Unable to serialize xml element " + xml, e);
-        }
+    Document doc = dBuilder.parse(xmlContent);
+
+    doc.getDocumentElement().normalize();
+    return doc;
+  }
+
+  public static String toString(final Element xml) {
+    try {
+      Transformer transformer =
+          TransformerFactory.newInstance().newTransformer();
+      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+
+      StreamResult result = new StreamResult(new StringWriter());
+      DOMSource source = new DOMSource(xml);
+      transformer.transform(source, result);
+
+      return result.getWriter().toString();
+    } catch (IllegalArgumentException | TransformerFactoryConfigurationError
+        | TransformerException e) {
+      throw new RuntimeException("Unable to serialize xml element " + xml, e);
     }
+  }
 
-    @Test
-    public void testConversionToNormalizedXml() throws Exception {
-        SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml =
-            EncoderDecoderUtil.encode(parseTestSchema("/augment_choice.yang"),
-                augmentChoiceExpectedNode());
-        Document expectedDoc = loadDocument("/augment_choice.xml");
-        Document convertedDoc =
-            EncoderDecoderUtil.factory.newDocumentBuilder().parse(
-                new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8")));
-        System.out.println(toString(convertedDoc.getDocumentElement()));
-        XMLUnit.setIgnoreWhitespace(true);
-        XMLUnit.setIgnoreComments(true);
-        new Diff(XMLUnit.buildControlDocument(toString(expectedDoc
-            .getDocumentElement())),
-            XMLUnit.buildTestDocument(toString(convertedDoc
-                .getDocumentElement()))).similar();
-        System.out.println(toString(expectedDoc.getDocumentElement()));
-
-    }
-
-
-    @Test
-    public void testConversionFromXmlToNormalizedNode() throws Exception {
-        SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml =
-            EncoderDecoderUtil.encode(parseTestSchema("/test.yang"),
-                listLeafListWithAttributes());
-        Document expectedDoc = loadDocument("/simple_xml_with_attributes.xml");
-        Document convertedDoc =
-            EncoderDecoderUtil.factory.newDocumentBuilder().parse(
-                new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8")));
-        System.out.println(toString(convertedDoc.getDocumentElement()));
-        XMLUnit.setIgnoreWhitespace(true);
-        XMLUnit.setIgnoreComments(true);
-        new Diff(XMLUnit.buildControlDocument(toString(expectedDoc
-            .getDocumentElement())),
-            XMLUnit.buildTestDocument(toString(convertedDoc
-                .getDocumentElement()))).similar();
-        System.out.println(toString(expectedDoc.getDocumentElement()));
-
-        // now we will try to convert xml back to normalize node.
-        ContainerNode cn =
-            (ContainerNode) EncoderDecoderUtil.decode(
-                parseTestSchema("/test.yang"), nnXml);
-        junit.framework.Assert.assertEquals(listLeafListWithAttributes(), cn);
-
-    }
+  @Test
+  public void testConversionToNormalizedXml() throws Exception {
+    SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml =
+        EncoderDecoderUtil.encode(parseTestSchema("/augment_choice.yang"),
+            augmentChoiceExpectedNode());
+    Document expectedDoc = loadDocument("/augment_choice.xml");
+    Document convertedDoc =
+        EncoderDecoderUtil.factory.newDocumentBuilder().parse(
+            new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8")));
+    System.out.println(toString(convertedDoc.getDocumentElement()));
+    XMLUnit.setIgnoreWhitespace(true);
+    XMLUnit.setIgnoreComments(true);
+    new Diff(XMLUnit.buildControlDocument(toString(expectedDoc
+        .getDocumentElement())),
+        XMLUnit.buildTestDocument(toString(convertedDoc.getDocumentElement())))
+        .similar();
+    System.out.println(toString(expectedDoc.getDocumentElement()));
+
+  }
+
+
+  @Test
+  public void testConversionFromXmlToNormalizedNode() throws Exception {
+    SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml =
+        EncoderDecoderUtil.encode(parseTestSchema("/test.yang"),
+            listLeafListWithAttributes());
+    Document expectedDoc = loadDocument("/simple_xml_with_attributes.xml");
+    Document convertedDoc =
+        EncoderDecoderUtil.factory.newDocumentBuilder().parse(
+            new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8")));
+    System.out.println(toString(convertedDoc.getDocumentElement()));
+    XMLUnit.setIgnoreWhitespace(true);
+    XMLUnit.setIgnoreComments(true);
+    new Diff(XMLUnit.buildControlDocument(toString(expectedDoc
+        .getDocumentElement())),
+        XMLUnit.buildTestDocument(toString(convertedDoc.getDocumentElement())))
+        .similar();
+    System.out.println(toString(expectedDoc.getDocumentElement()));
+
+    // now we will try to convert xml back to normalize node.
+    ContainerNode cn =
+        (ContainerNode) EncoderDecoderUtil.decode(
+            parseTestSchema("/test.yang"), nnXml);
+    junit.framework.Assert.assertEquals(listLeafListWithAttributes(), cn);
+
+  }
 
 }
index bef4057..3eeb06f 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.util;
 
 import org.opendaylight.yangtools.yang.common.QName;
@@ -34,453 +44,427 @@ import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.ma
 
 public class TestModel {
 
-    public static final QName TEST_QNAME = QName.create(
-        "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test",
-        "2014-03-13", "test");
-
-    public static final QName AUG_NAME_QNAME = QName.create(
-        "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
-        "2014-03-13", "name");
-
-    public static final QName AUG_CONT_QNAME = QName.create(
-        "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
-        "2014-03-13", "cont");
-
-
-    public static final QName DESC_QNAME = QName.create(TEST_QNAME, "desc");
-    public static final QName POINTER_QNAME =
-        QName.create(TEST_QNAME, "pointer");
-    public static final QName SOME_REF_QNAME =
-        QName.create(TEST_QNAME, "some-ref");
-    public static final QName MYIDENTITY_QNAME =
-        QName.create(TEST_QNAME, "myidentity");
-    public static final QName SWITCH_FEATURES_QNAME =
-        QName.create(TEST_QNAME, "switch-features");
-
-    public static final QName AUGMENTED_LIST_QNAME =
-        QName.create(TEST_QNAME, "augmented-list");
-
-    public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME,
-        "outer-list");
-    public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME,
-        "inner-list");
-    public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME,
-        "outer-choice");
-    public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
-    public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
-    public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
-    private static final String DATASTORE_TEST_YANG =
-        "/odl-datastore-test.yang";
-    private static final String DATASTORE_AUG_YANG =
-        "/odl-datastore-augmentation.yang";
-    private static final String DATASTORE_TEST_NOTIFICATION_YANG =
-        "/odl-datastore-test-notification.yang";
-
-
-    public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier
-        .of(TEST_QNAME);
-    public static final YangInstanceIdentifier DESC_PATH = YangInstanceIdentifier
-        .builder(TEST_PATH).node(DESC_QNAME).build();
-    public static final YangInstanceIdentifier OUTER_LIST_PATH = YangInstanceIdentifier
-        .builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
-    public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
-    public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
-
-    private static final Integer ONE_ID = 1;
-    private static final Integer TWO_ID = 2;
-    private static final String TWO_ONE_NAME = "one";
-    private static final String TWO_TWO_NAME = "two";
-    private static final String DESC = "Hello there";
-
-    // Family specific constants
-    public static final QName FAMILY_QNAME =
-        QName
-            .create(
-                "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test",
-                "2014-04-17", "family");
-    public static final QName CHILDREN_QNAME = QName.create(FAMILY_QNAME,
-        "children");
-    public static final QName GRAND_CHILDREN_QNAME = QName.create(FAMILY_QNAME,
-        "grand-children");
-    public static final QName CHILD_NUMBER_QNAME = QName.create(FAMILY_QNAME,
-        "child-number");
-    public static final QName CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
-        "child-name");
-    public static final QName GRAND_CHILD_NUMBER_QNAME = QName.create(
-        FAMILY_QNAME, "grand-child-number");
-    public static final QName GRAND_CHILD_NAME_QNAME =
-        QName.create(FAMILY_QNAME,
-            "grand-child-name");
-
-    public static final YangInstanceIdentifier FAMILY_PATH = YangInstanceIdentifier
-        .of(FAMILY_QNAME);
-    public static final YangInstanceIdentifier FAMILY_DESC_PATH = YangInstanceIdentifier
-        .builder(FAMILY_PATH).node(DESC_QNAME).build();
-    public static final YangInstanceIdentifier CHILDREN_PATH = YangInstanceIdentifier
-        .builder(FAMILY_PATH).node(CHILDREN_QNAME).build();
-
-    private static final Integer FIRST_CHILD_ID = 1;
-    private static final Integer SECOND_CHILD_ID = 2;
-
-    private static final String FIRST_CHILD_NAME = "first child";
-    private static final String SECOND_CHILD_NAME = "second child";
-
-    private static final Integer FIRST_GRAND_CHILD_ID = 1;
-    private static final Integer SECOND_GRAND_CHILD_ID = 2;
-
-    private static final String FIRST_GRAND_CHILD_NAME = "first grand child";
-    private static final String SECOND_GRAND_CHILD_NAME = "second grand child";
-
-    // first child
-    private static final YangInstanceIdentifier CHILDREN_1_PATH = YangInstanceIdentifier
-        .builder(CHILDREN_PATH)
-        .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID) //
-        .build();
-    private static final YangInstanceIdentifier CHILDREN_1_NAME_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_PATH)
-            .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, FIRST_CHILD_NAME) //
-            .build();
+  public static final QName TEST_QNAME = QName.create(
+      "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test",
+      "2014-03-13", "test");
+
+  public static final QName AUG_NAME_QNAME = QName.create(
+      "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
+      "2014-03-13", "name");
+
+  public static final QName AUG_CONT_QNAME = QName.create(
+      "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:aug",
+      "2014-03-13", "cont");
+
+
+  public static final QName DESC_QNAME = QName.create(TEST_QNAME, "desc");
+  public static final QName POINTER_QNAME = QName.create(TEST_QNAME, "pointer");
+  public static final QName SOME_REF_QNAME = QName.create(TEST_QNAME,
+      "some-ref");
+  public static final QName MYIDENTITY_QNAME = QName.create(TEST_QNAME,
+      "myidentity");
+  public static final QName SWITCH_FEATURES_QNAME = QName.create(TEST_QNAME,
+      "switch-features");
+
+  public static final QName AUGMENTED_LIST_QNAME = QName.create(TEST_QNAME,
+      "augmented-list");
+
+  public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME,
+      "outer-list");
+  public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME,
+      "inner-list");
+  public static final QName OUTER_CHOICE_QNAME = QName.create(TEST_QNAME,
+      "outer-choice");
+  public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
+  public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
+  public static final QName VALUE_QNAME = QName.create(TEST_QNAME, "value");
+  private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
+  private static final String DATASTORE_AUG_YANG =
+      "/odl-datastore-augmentation.yang";
+  private static final String DATASTORE_TEST_NOTIFICATION_YANG =
+      "/odl-datastore-test-notification.yang";
+
+
+  public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier
+      .of(TEST_QNAME);
+  public static final YangInstanceIdentifier DESC_PATH = YangInstanceIdentifier
+      .builder(TEST_PATH).node(DESC_QNAME).build();
+  public static final YangInstanceIdentifier OUTER_LIST_PATH =
+      YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
+  public static final QName TWO_QNAME = QName.create(TEST_QNAME, "two");
+  public static final QName THREE_QNAME = QName.create(TEST_QNAME, "three");
+
+  private static final Integer ONE_ID = 1;
+  private static final Integer TWO_ID = 2;
+  private static final String TWO_ONE_NAME = "one";
+  private static final String TWO_TWO_NAME = "two";
+  private static final String DESC = "Hello there";
+
+  // Family specific constants
+  public static final QName FAMILY_QNAME =
+      QName
+          .create(
+              "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test",
+              "2014-04-17", "family");
+  public static final QName CHILDREN_QNAME = QName.create(FAMILY_QNAME,
+      "children");
+  public static final QName GRAND_CHILDREN_QNAME = QName.create(FAMILY_QNAME,
+      "grand-children");
+  public static final QName CHILD_NUMBER_QNAME = QName.create(FAMILY_QNAME,
+      "child-number");
+  public static final QName CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
+      "child-name");
+  public static final QName GRAND_CHILD_NUMBER_QNAME = QName.create(
+      FAMILY_QNAME, "grand-child-number");
+  public static final QName GRAND_CHILD_NAME_QNAME = QName.create(FAMILY_QNAME,
+      "grand-child-name");
+
+  public static final YangInstanceIdentifier FAMILY_PATH =
+      YangInstanceIdentifier.of(FAMILY_QNAME);
+  public static final YangInstanceIdentifier FAMILY_DESC_PATH =
+      YangInstanceIdentifier.builder(FAMILY_PATH).node(DESC_QNAME).build();
+  public static final YangInstanceIdentifier CHILDREN_PATH =
+      YangInstanceIdentifier.builder(FAMILY_PATH).node(CHILDREN_QNAME).build();
+
+  private static final Integer FIRST_CHILD_ID = 1;
+  private static final Integer SECOND_CHILD_ID = 2;
+
+  private static final String FIRST_CHILD_NAME = "first child";
+  private static final String SECOND_CHILD_NAME = "second child";
+
+  private static final Integer FIRST_GRAND_CHILD_ID = 1;
+  private static final Integer SECOND_GRAND_CHILD_ID = 2;
+
+  private static final String FIRST_GRAND_CHILD_NAME = "first grand child";
+  private static final String SECOND_GRAND_CHILD_NAME = "second grand child";
+
+  // first child
+  private static final YangInstanceIdentifier CHILDREN_1_PATH =
+      YangInstanceIdentifier.builder(CHILDREN_PATH)
+          .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID) //
+          .build();
+  private static final YangInstanceIdentifier CHILDREN_1_NAME_PATH =
+      YangInstanceIdentifier.builder(CHILDREN_PATH)
+          .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, FIRST_CHILD_NAME) //
+          .build();
+
+  private static final YangInstanceIdentifier CHILDREN_2_PATH =
+      YangInstanceIdentifier.builder(CHILDREN_PATH)
+          .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID) //
+          .build();
+  private static final YangInstanceIdentifier CHILDREN_2_NAME_PATH =
+      YangInstanceIdentifier.builder(CHILDREN_PATH)
+          .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, SECOND_CHILD_NAME) //
+          .build();
+
+
+  private static final YangInstanceIdentifier GRAND_CHILD_1_PATH =
+      YangInstanceIdentifier
+          .builder(CHILDREN_1_PATH)
+          .node(GRAND_CHILDREN_QNAME)
+          //
+          .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+              FIRST_GRAND_CHILD_ID) //
+          .build();
+
+  private static final YangInstanceIdentifier GRAND_CHILD_1_NAME_PATH =
+      YangInstanceIdentifier
+          .builder(CHILDREN_1_PATH)
+          .node(GRAND_CHILDREN_QNAME)
+          //
+          .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+              FIRST_GRAND_CHILD_NAME) //
+          .build();
+
+  private static final YangInstanceIdentifier GRAND_CHILD_2_PATH =
+      YangInstanceIdentifier
+          .builder(CHILDREN_2_PATH)
+          .node(GRAND_CHILDREN_QNAME)
+          //
+          .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+              SECOND_GRAND_CHILD_ID) //
+          .build();
+
+  private static final YangInstanceIdentifier GRAND_CHILD_2_NAME_PATH =
+      YangInstanceIdentifier
+          .builder(CHILDREN_2_PATH)
+          .node(GRAND_CHILDREN_QNAME)
+          //
+          .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
+              SECOND_GRAND_CHILD_NAME) //
+          .build();
+
+  private static final YangInstanceIdentifier DESC_PATH_ID =
+      YangInstanceIdentifier.builder(DESC_PATH).build();
+  private static final YangInstanceIdentifier OUTER_LIST_1_PATH =
+      YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+          .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, ONE_ID) //
+          .build();
+
+  private static final YangInstanceIdentifier OUTER_LIST_2_PATH =
+      YangInstanceIdentifier.builder(OUTER_LIST_PATH)
+          .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+          .build();
+
+  private static final YangInstanceIdentifier TWO_TWO_PATH =
+      YangInstanceIdentifier.builder(OUTER_LIST_2_PATH).node(INNER_LIST_QNAME) //
+          .nodeWithKey(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME) //
+          .build();
+
+  private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH =
+      YangInstanceIdentifier.builder(TWO_TWO_PATH).node(VALUE_QNAME) //
+          .build();
+
+  private static final MapEntryNode BAR_NODE = mapEntryBuilder(
+      OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
+      .withChild(mapNodeBuilder(INNER_LIST_QNAME) //
+          .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) //
+          .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) //
+          .build()) //
+      .build();
+
+  public static final InputStream getDatastoreTestInputStream() {
+    return getInputStream(DATASTORE_TEST_YANG);
+  }
+
+  public static final InputStream getDatastoreAugInputStream() {
+    return getInputStream(DATASTORE_AUG_YANG);
+  }
+
+  public static final InputStream getDatastoreTestNotificationInputStream() {
+    return getInputStream(DATASTORE_TEST_NOTIFICATION_YANG);
+  }
+
+  private static InputStream getInputStream(final String resourceName) {
+    return TestModel.class.getResourceAsStream(resourceName);
+  }
+
+  public static SchemaContext createTestContext() {
+    List<InputStream> inputStreams = new ArrayList<>();
+    inputStreams.add(getDatastoreTestInputStream());
+    inputStreams.add(getDatastoreAugInputStream());
+    inputStreams.add(getDatastoreTestNotificationInputStream());
+
+    YangParserImpl parser = new YangParserImpl();
+    Set<Module> modules = parser.parseYangModelsFromStreams(inputStreams);
+    return parser.resolveSchemaContext(modules);
+  }
+
+  /**
+   * Returns a test document
+   * <p/>
+   *
+   * <pre>
+   * test
+   *     outer-list
+   *          id 1
+   *     outer-list
+   *          id 2
+   *          inner-list
+   *                  name "one"
+   *          inner-list
+   *                  name "two"
+   *
+   * </pre>
+   *
+   * @return
+   */
+  public static NormalizedNode<?, ?> createDocumentOne(
+      SchemaContext schemaContext) {
+    return ImmutableContainerNodeBuilder
+        .create()
+        .withNodeIdentifier(
+            new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName()))
+        .withChild(createTestContainer()).build();
+
+  }
+
+  public static ContainerNode createTestContainer() {
+
+
+    // Create a list of shoes
+    // This is to test leaf list entry
+    final LeafSetEntryNode<Object> nike =
+        ImmutableLeafSetEntryNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeWithValue(QName.create(
+                    TEST_QNAME, "shoe"), "nike")).withValue("nike").build();
+
+    final LeafSetEntryNode<Object> puma =
+        ImmutableLeafSetEntryNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeWithValue(QName.create(
+                    TEST_QNAME, "shoe"), "puma")).withValue("puma").build();
 
-    private static final YangInstanceIdentifier CHILDREN_2_PATH = YangInstanceIdentifier
-        .builder(CHILDREN_PATH)
-        .nodeWithKey(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID) //
-        .build();
-    private static final YangInstanceIdentifier CHILDREN_2_NAME_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_PATH)
-            .nodeWithKey(CHILDREN_QNAME, CHILD_NAME_QNAME, SECOND_CHILD_NAME) //
+    final LeafSetNode<Object> shoes =
+        ImmutableLeafSetNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeIdentifier(QName.create(
+                    TEST_QNAME, "shoe"))).withChild(nike).withChild(puma)
             .build();
 
 
-    private static final YangInstanceIdentifier GRAND_CHILD_1_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_1_PATH)
-            .node(GRAND_CHILDREN_QNAME)
-                //
-            .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
-                FIRST_GRAND_CHILD_ID) //
-            .build();
+    // Test a leaf-list where each entry contains an identity
+    final LeafSetEntryNode<Object> cap1 =
+        ImmutableLeafSetEntryNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeWithValue(QName.create(
+                    TEST_QNAME, "capability"), DESC_QNAME))
+            .withValue(DESC_QNAME).build();
 
-    private static final YangInstanceIdentifier GRAND_CHILD_1_NAME_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_1_PATH)
-            .node(GRAND_CHILDREN_QNAME)
-                //
-            .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
-                FIRST_GRAND_CHILD_NAME) //
-            .build();
+    final LeafSetNode<Object> capabilities =
+        ImmutableLeafSetNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeIdentifier(QName.create(
+                    TEST_QNAME, "capability"))).withChild(cap1).build();
 
-    private static final YangInstanceIdentifier GRAND_CHILD_2_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_2_PATH)
-            .node(GRAND_CHILDREN_QNAME)
-                //
-            .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
-                SECOND_GRAND_CHILD_ID) //
-            .build();
+    ContainerNode switchFeatures =
+        ImmutableContainerNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeIdentifier(SWITCH_FEATURES_QNAME))
+            .withChild(capabilities).build();
 
-    private static final YangInstanceIdentifier GRAND_CHILD_2_NAME_PATH =
-        YangInstanceIdentifier.builder(CHILDREN_2_PATH)
-            .node(GRAND_CHILDREN_QNAME)
-                //
-            .nodeWithKey(GRAND_CHILDREN_QNAME, GRAND_CHILD_NAME_QNAME,
-                SECOND_GRAND_CHILD_NAME) //
+    // Create a leaf list with numbers
+    final LeafSetEntryNode<Object> five =
+        ImmutableLeafSetEntryNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                (new YangInstanceIdentifier.NodeWithValue(QName.create(
+                    TEST_QNAME, "number"), 5))).withValue(5).build();
+    final LeafSetEntryNode<Object> fifteen =
+        ImmutableLeafSetEntryNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                (new YangInstanceIdentifier.NodeWithValue(QName.create(
+                    TEST_QNAME, "number"), 15))).withValue(15).build();
+    final LeafSetNode<Object> numbers =
+        ImmutableLeafSetNodeBuilder
+            .create()
+            .withNodeIdentifier(
+                new YangInstanceIdentifier.NodeIdentifier(QName.create(
+                    TEST_QNAME, "number"))).withChild(five).withChild(fifteen)
             .build();
 
-    private static final YangInstanceIdentifier DESC_PATH_ID = YangInstanceIdentifier
-        .builder(DESC_PATH).build();
-    private static final YangInstanceIdentifier OUTER_LIST_1_PATH =
-        YangInstanceIdentifier.builder(OUTER_LIST_PATH)
-            .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, ONE_ID) //
-            .build();
 
-    private static final YangInstanceIdentifier OUTER_LIST_2_PATH =
-        YangInstanceIdentifier.builder(OUTER_LIST_PATH)
-            .nodeWithKey(OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
-            .build();
+    // Create augmentations
+    MapEntryNode mapEntry = createAugmentedListEntry(1, "First Test");
 
-    private static final YangInstanceIdentifier TWO_TWO_PATH = YangInstanceIdentifier
-        .builder(OUTER_LIST_2_PATH).node(INNER_LIST_QNAME) //
-        .nodeWithKey(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME) //
-        .build();
 
-    private static final YangInstanceIdentifier TWO_TWO_VALUE_PATH =
-        YangInstanceIdentifier.builder(TWO_TWO_PATH).node(VALUE_QNAME) //
-            .build();
+    // Create the document
+    return ImmutableContainerNodeBuilder
+        .create()
+        .withNodeIdentifier(
+            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME))
+        .withChild(ImmutableNodes.leafNode(DESC_QNAME, DESC))
+        .withChild(ImmutableNodes.leafNode(POINTER_QNAME, "pointer"))
+        .withChild(
+            ImmutableNodes.leafNode(SOME_REF_QNAME, YangInstanceIdentifier
+                .builder().build()))
+        .withChild(ImmutableNodes.leafNode(MYIDENTITY_QNAME, DESC_QNAME))
 
-    private static final MapEntryNode BAR_NODE = mapEntryBuilder(
-        OUTER_LIST_QNAME, ID_QNAME, TWO_ID) //
-        .withChild(mapNodeBuilder(INNER_LIST_QNAME) //
-            .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_ONE_NAME)) //
-            .withChild(mapEntry(INNER_LIST_QNAME, NAME_QNAME, TWO_TWO_NAME)) //
-            .build()) //
-        .build();
-
-    public static final InputStream getDatastoreTestInputStream() {
-        return getInputStream(DATASTORE_TEST_YANG);
-    }
-
-    public static final InputStream getDatastoreAugInputStream() {
-        return getInputStream(DATASTORE_AUG_YANG);
-    }
-
-    public static final InputStream getDatastoreTestNotificationInputStream() {
-        return getInputStream(DATASTORE_TEST_NOTIFICATION_YANG);
-    }
-
-    private static InputStream getInputStream(final String resourceName) {
-        return TestModel.class.getResourceAsStream(resourceName);
-    }
-
-    public static SchemaContext createTestContext() {
-        List<InputStream> inputStreams = new ArrayList<>();
-        inputStreams.add(getDatastoreTestInputStream());
-        inputStreams.add(getDatastoreAugInputStream());
-        inputStreams.add(getDatastoreTestNotificationInputStream());
-
-        YangParserImpl parser = new YangParserImpl();
-        Set<Module> modules = parser.parseYangModelsFromStreams(inputStreams);
-        return parser.resolveSchemaContext(modules);
-    }
-
-    /**
-     * Returns a test document
-     * <p/>
-     * <pre>
-     * test
-     *     outer-list
-     *          id 1
-     *     outer-list
-     *          id 2
-     *          inner-list
-     *                  name "one"
-     *          inner-list
-     *                  name "two"
-     *
-     * </pre>
-     *
-     * @return
-     */
-    public static NormalizedNode<?, ?> createDocumentOne(
-        SchemaContext schemaContext) {
-        return ImmutableContainerNodeBuilder
-            .create()
-            .withNodeIdentifier(
-                new YangInstanceIdentifier.NodeIdentifier(schemaContext.getQName()))
-            .withChild(createTestContainer()).build();
-
-    }
-
-    public static ContainerNode createTestContainer() {
-
-
-        // Create a list of shoes
-        // This is to test leaf list entry
-        final LeafSetEntryNode<Object> nike =
-            ImmutableLeafSetEntryNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeWithValue(
-                        QName.create(TEST_QNAME,
-                            "shoe"), "nike")
-                ).withValue("nike").build();
-
-        final LeafSetEntryNode<Object> puma =
-            ImmutableLeafSetEntryNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeWithValue(
-                        QName.create(TEST_QNAME,
-                            "shoe"), "puma")
-                ).withValue("puma").build();
-
-        final LeafSetNode<Object> shoes =
-            ImmutableLeafSetNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeIdentifier(
-                        QName.create(TEST_QNAME,
-                            "shoe"))
-                ).withChild(nike).withChild(puma).build();
-
-
-        // Test a leaf-list where each entry contains an identity
-        final LeafSetEntryNode<Object> cap1 =
-            ImmutableLeafSetEntryNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeWithValue(
-                        QName.create(TEST_QNAME,
-                            "capability"), DESC_QNAME)
-                ).withValue(DESC_QNAME).build();
-
-        final LeafSetNode<Object> capabilities =
-            ImmutableLeafSetNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeIdentifier(
-                        QName.create(TEST_QNAME,
-                            "capability"))
-                ).withChild(cap1).build();
-
-        ContainerNode switchFeatures = ImmutableContainerNodeBuilder
-            .create()
-            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(
-                SWITCH_FEATURES_QNAME))
-            .withChild(capabilities)
-            .build();
+        // .withChild(augmentationNode)
+        .withChild(shoes)
+        .withChild(numbers)
+        .withChild(switchFeatures)
+        .withChild(
+            mapNodeBuilder(AUGMENTED_LIST_QNAME).withChild(mapEntry).build())
+        .withChild(
+            mapNodeBuilder(OUTER_LIST_QNAME)
+                .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
+                .withChild(BAR_NODE).build()).build();
+
+  }
 
-        // Create a leaf list with numbers
-        final LeafSetEntryNode<Object> five =
-            ImmutableLeafSetEntryNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    (new YangInstanceIdentifier.NodeWithValue(
-                        QName.create(TEST_QNAME,
-                            "number"), 5))
-                ).withValue(5).build();
-        final LeafSetEntryNode<Object> fifteen =
-            ImmutableLeafSetEntryNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    (new YangInstanceIdentifier.NodeWithValue(
-                        QName.create(TEST_QNAME,
-                            "number"), 15))
-                ).withValue(15).build();
-        final LeafSetNode<Object> numbers =
-            ImmutableLeafSetNodeBuilder
-                .create()
-                .withNodeIdentifier(
-                    new YangInstanceIdentifier.NodeIdentifier(
-                        QName.create(TEST_QNAME,
-                            "number"))
-                ).withChild(five).withChild(fifteen).build();
-
-
-        // Create augmentations
-        MapEntryNode mapEntry = createAugmentedListEntry(1, "First Test");
-
-
-        // Create the document
-        return ImmutableContainerNodeBuilder
+  public static MapEntryNode createAugmentedListEntry(int id, String name) {
+
+    Set<QName> childAugmentations = new HashSet<>();
+    childAugmentations.add(AUG_CONT_QNAME);
+
+    ContainerNode augCont =
+        ImmutableContainerNodeBuilder
             .create()
             .withNodeIdentifier(
-                new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME))
-            .withChild(ImmutableNodes.leafNode(DESC_QNAME, DESC))
-            .withChild(ImmutableNodes.leafNode(POINTER_QNAME, "pointer"))
-            .withChild(ImmutableNodes.leafNode(SOME_REF_QNAME,
-                YangInstanceIdentifier.builder().build()))
-            .withChild(ImmutableNodes.leafNode(MYIDENTITY_QNAME, DESC_QNAME))
-
-                //.withChild(augmentationNode)
-            .withChild(shoes)
-            .withChild(numbers)
-            .withChild(switchFeatures)
-            .withChild(mapNodeBuilder(AUGMENTED_LIST_QNAME).withChild(mapEntry).build())
-            .withChild(
-                mapNodeBuilder(OUTER_LIST_QNAME)
-                    .withChild(mapEntry(OUTER_LIST_QNAME, ID_QNAME, ONE_ID))
-                    .withChild(BAR_NODE).build()
-            ).build();
-
-    }
-
-    public static MapEntryNode createAugmentedListEntry(int id, String name) {
-
-        Set<QName> childAugmentations = new HashSet<>();
-        childAugmentations.add(AUG_CONT_QNAME);
-
-        ContainerNode augCont = ImmutableContainerNodeBuilder
-            .create()
-            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(AUG_CONT_QNAME))
-            .withChild(ImmutableNodes.leafNode(AUG_NAME_QNAME, name))
-            .build();
+                new YangInstanceIdentifier.NodeIdentifier(AUG_CONT_QNAME))
+            .withChild(ImmutableNodes.leafNode(AUG_NAME_QNAME, name)).build();
 
 
-        final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
-            new YangInstanceIdentifier.AugmentationIdentifier(childAugmentations);
+    final YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier =
+        new YangInstanceIdentifier.AugmentationIdentifier(childAugmentations);
 
-        final AugmentationNode augmentationNode =
-            Builders.augmentationBuilder()
-                .withNodeIdentifier(augmentationIdentifier)
-                .withChild(augCont)
-                .build();
+    final AugmentationNode augmentationNode =
+        Builders.augmentationBuilder()
+            .withNodeIdentifier(augmentationIdentifier).withChild(augCont)
+            .build();
 
-        return ImmutableMapEntryNodeBuilder.create()
-            .withNodeIdentifier(
-                new YangInstanceIdentifier.NodeIdentifierWithPredicates(
-                    AUGMENTED_LIST_QNAME, ID_QNAME, id))
-            .withChild(ImmutableNodes.leafNode(ID_QNAME, id))
-            .withChild(augmentationNode).build();
-    }
-
-
-    public static ContainerNode createFamily() {
-        final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode>
-            familyContainerBuilder =
-            ImmutableContainerNodeBuilder.create().withNodeIdentifier(
-                new YangInstanceIdentifier.NodeIdentifier(FAMILY_QNAME));
-
-        final CollectionNodeBuilder<MapEntryNode, MapNode> childrenBuilder =
-            mapNodeBuilder(CHILDREN_QNAME);
-
-        final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
-            firstChildBuilder =
-            mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID);
-        final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
-            secondChildBuilder =
-            mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME,
-                SECOND_CHILD_ID);
-
-        final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
-            firstGrandChildBuilder =
-            mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
-                FIRST_GRAND_CHILD_ID);
-        final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode>
-            secondGrandChildBuilder =
-            mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
-                SECOND_GRAND_CHILD_ID);
-
-        firstGrandChildBuilder
-            .withChild(
-                ImmutableNodes.leafNode(GRAND_CHILD_NUMBER_QNAME,
-                    FIRST_GRAND_CHILD_ID)
-            ).withChild(
+    return ImmutableMapEntryNodeBuilder
+        .create()
+        .withNodeIdentifier(
+            new YangInstanceIdentifier.NodeIdentifierWithPredicates(
+                AUGMENTED_LIST_QNAME, ID_QNAME, id))
+        .withChild(ImmutableNodes.leafNode(ID_QNAME, id))
+        .withChild(augmentationNode).build();
+  }
+
+
+  public static ContainerNode createFamily() {
+    final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, ContainerNode> familyContainerBuilder =
+        ImmutableContainerNodeBuilder.create().withNodeIdentifier(
+            new YangInstanceIdentifier.NodeIdentifier(FAMILY_QNAME));
+
+    final CollectionNodeBuilder<MapEntryNode, MapNode> childrenBuilder =
+        mapNodeBuilder(CHILDREN_QNAME);
+
+    final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstChildBuilder =
+        mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, FIRST_CHILD_ID);
+    final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondChildBuilder =
+        mapEntryBuilder(CHILDREN_QNAME, CHILD_NUMBER_QNAME, SECOND_CHILD_ID);
+
+    final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> firstGrandChildBuilder =
+        mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+            FIRST_GRAND_CHILD_ID);
+    final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifierWithPredicates, MapEntryNode> secondGrandChildBuilder =
+        mapEntryBuilder(GRAND_CHILDREN_QNAME, GRAND_CHILD_NUMBER_QNAME,
+            SECOND_GRAND_CHILD_ID);
+
+    firstGrandChildBuilder
+        .withChild(
+            ImmutableNodes.leafNode(GRAND_CHILD_NUMBER_QNAME,
+                FIRST_GRAND_CHILD_ID)).withChild(
             ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
-                FIRST_GRAND_CHILD_NAME)
-        );
-
-        secondGrandChildBuilder.withChild(
-            ImmutableNodes
-                .leafNode(GRAND_CHILD_NUMBER_QNAME, SECOND_GRAND_CHILD_ID)
-        )
-            .withChild(
-                ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
-                    SECOND_GRAND_CHILD_NAME)
-            );
-
-        firstChildBuilder
-            .withChild(
-                ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, FIRST_CHILD_ID))
-            .withChild(
-                ImmutableNodes.leafNode(CHILD_NAME_QNAME, FIRST_CHILD_NAME))
-            .withChild(
-                mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
-                    firstGrandChildBuilder.build()).build()
-            );
-
-
-        secondChildBuilder
-            .withChild(
-                ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, SECOND_CHILD_ID))
-            .withChild(
-                ImmutableNodes.leafNode(CHILD_NAME_QNAME, SECOND_CHILD_NAME))
-            .withChild(
-                mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
-                    firstGrandChildBuilder.build()).build()
-            );
-
-        childrenBuilder.withChild(firstChildBuilder.build());
-        childrenBuilder.withChild(secondChildBuilder.build());
-
-        return familyContainerBuilder.withChild(childrenBuilder.build())
-            .build();
-    }
+                FIRST_GRAND_CHILD_NAME));
+
+    secondGrandChildBuilder.withChild(
+        ImmutableNodes
+            .leafNode(GRAND_CHILD_NUMBER_QNAME, SECOND_GRAND_CHILD_ID))
+        .withChild(
+            ImmutableNodes.leafNode(GRAND_CHILD_NAME_QNAME,
+                SECOND_GRAND_CHILD_NAME));
+
+    firstChildBuilder
+        .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, FIRST_CHILD_ID))
+        .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, FIRST_CHILD_NAME))
+        .withChild(
+            mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+                firstGrandChildBuilder.build()).build());
+
+
+    secondChildBuilder
+        .withChild(ImmutableNodes.leafNode(CHILD_NUMBER_QNAME, SECOND_CHILD_ID))
+        .withChild(ImmutableNodes.leafNode(CHILD_NAME_QNAME, SECOND_CHILD_NAME))
+        .withChild(
+            mapNodeBuilder(GRAND_CHILDREN_QNAME).withChild(
+                firstGrandChildBuilder.build()).build());
+
+    childrenBuilder.withChild(firstChildBuilder.build());
+    childrenBuilder.withChild(secondChildBuilder.build());
+
+    return familyContainerBuilder.withChild(childrenBuilder.build()).build();
+  }
 
 }
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/AbstractMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/AbstractMessagesTest.java
new file mode 100644 (file)
index 0000000..c6c4afd
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+
+/**
+ * @author: syedbahm Date: 7/31/14
+ */
+public abstract class AbstractMessagesTest {
+  public final String VERSION_COMPATIBILTY_TEST_DATA_PATH = "."
+      + File.separator + "src" + File.separator + "test" + File.separator
+      + "resources" + File.separator + "version-compatibility-serialized-data";
+  private File file;
+  private File testDataFile;
+
+  protected AbstractMessagesTest() {
+    init();
+  }
+
+  protected void init() {
+    file = new File(getTestFileName());
+    testDataFile =
+        new File(VERSION_COMPATIBILTY_TEST_DATA_PATH + File.separator
+            + getTestFileName() + "Data");
+  }
+
+
+
+  abstract public void verifySerialization() throws Exception;
+
+
+  protected void writeToFile(
+      com.google.protobuf.GeneratedMessage.Builder<?> builder) throws Exception {
+
+    FileOutputStream output = new FileOutputStream(file);
+    builder.build().writeTo(output);
+    output.close();;
+
+  }
+
+  protected com.google.protobuf.GeneratedMessage readFromFile(
+      com.google.protobuf.Parser<?> parser) throws Exception {
+    com.google.protobuf.GeneratedMessage message =
+        (com.google.protobuf.GeneratedMessage) parser
+            .parseFrom(new FileInputStream(file));
+
+    /*Note: we will delete only the test file -- comment below if you want to capture the
+       version-compatibility-serialized-data test data file.The file will be generated at root of the
+       sal-protocolbuffer-encoding
+       and you need to move it to test/resources/version-compatbility-serialized-data folder renaming the file to include suffix <TestFileName>"Data"
+    */
+     file.delete();
+    return message;
+  }
+
+  protected com.google.protobuf.GeneratedMessage readFromTestDataFile(
+      com.google.protobuf.Parser<?> parser) throws Exception {
+    return (com.google.protobuf.GeneratedMessage) parser
+        .parseFrom(new FileInputStream(testDataFile));
+  }
+
+
+  public abstract String getTestFileName();
+
+
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/ShardManagerMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/ShardManagerMessagesTest.java
deleted file mode 100644 (file)
index b0758da..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.opendaylight.controller.protobuff.messages;
-
-/**
- * This test case is present to ensure that if others have used proper version of protocol buffer.
- *
- * If a different version of protocol buffer is used then it would generate different java sources
- * and would result in breaking of this test case.
- *
- * @author: syedbahm Date: 6/20/14
- *
- */
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-
-public class ShardManagerMessagesTest {
-
-  @Test
-  public void verifySerialization() throws Exception {
-    ShardManagerMessages.FindPrimary.Builder builder =
-        ShardManagerMessages.FindPrimary.newBuilder();
-    builder.setShardName("Inventory");
-    File testFile = new File("./test");
-    FileOutputStream output = new FileOutputStream(testFile);
-    builder.build().writeTo(output);
-    output.close();
-
-    // Here we will read the same and check we got back what we had saved
-    ShardManagerMessages.FindPrimary findPrimary =
-        ShardManagerMessages.FindPrimary
-            .parseFrom(new FileInputStream(testFile));
-    Assert.assertEquals("Inventory", findPrimary.getShardName());
-
-    testFile.delete();
-
-  }
-}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessagesTest.java
new file mode 100644 (file)
index 0000000..a01ccb8
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.cohort3pc;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the cohort.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+
+public class ThreePhaseCommitCohortMessagesTest extends AbstractMessagesTest {
+
+
+  @Test
+  public void verifySerialization() throws Exception {
+
+
+
+    ThreePhaseCommitCohortMessages.CanCommitTransactionReply.Builder builder =
+        ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder();
+    builder.setCanCommit(true);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    // Here we will read from the just serialized data
+
+    ThreePhaseCommitCohortMessages.CanCommitTransactionReply newCanCommitTransactionReply =
+        (ThreePhaseCommitCohortMessages.CanCommitTransactionReply) readFromFile(ThreePhaseCommitCohortMessages.CanCommitTransactionReply.PARSER);
+
+    Assert.assertTrue(newCanCommitTransactionReply.getCanCommit());
+
+
+    // Here we will read the same from our test-data file and check we got back what we had saved
+    // earlier
+    ThreePhaseCommitCohortMessages.CanCommitTransactionReply originalCanCommitTransactionReply =
+        (ThreePhaseCommitCohortMessages.CanCommitTransactionReply) readFromTestDataFile(ThreePhaseCommitCohortMessages.CanCommitTransactionReply.PARSER);
+
+    Assert.assertEquals(newCanCommitTransactionReply.getCanCommit(),
+        originalCanCommitTransactionReply.getCanCommit());
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return ThreePhaseCommitCohortMessagesTest.class.getSimpleName();
+  }
+
+
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/common/NormalizedNodeMessagesTest.java
new file mode 100644 (file)
index 0000000..c68ecea
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.common;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the common.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+public class NormalizedNodeMessagesTest extends AbstractMessagesTest {
+
+  @Override
+  @Test
+  public void verifySerialization() throws Exception {
+    NormalizedNodeMessages.Attribute.Builder builder =
+        NormalizedNodeMessages.Attribute.newBuilder();
+    builder.setName("test");
+    builder.setType("fake");
+    builder.setValue("testValue");
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    NormalizedNodeMessages.Attribute attributeNew =
+        (NormalizedNodeMessages.Attribute) readFromFile(NormalizedNodeMessages.Attribute.PARSER);
+    Assert.assertEquals("test", attributeNew.getName());
+    Assert.assertEquals("fake", attributeNew.getType());
+    Assert.assertEquals("testValue", attributeNew.getValue());
+
+    NormalizedNodeMessages.Attribute attributeOriginal =
+        (NormalizedNodeMessages.Attribute) readFromTestDataFile(NormalizedNodeMessages.Attribute.PARSER);
+    Assert.assertEquals(attributeNew.getName(), attributeOriginal.getName());
+  }
+
+  @Override
+  public String getTestFileName() {
+    return NormalizedNodeMessagesTest.class.getSimpleName();
+  }
+
+
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/datachange/notification/DataChangeListenerMessagesTest.java
new file mode 100644 (file)
index 0000000..e933928
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.datachange.notification;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the DataChangeListener.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+public class DataChangeListenerMessagesTest extends AbstractMessagesTest {
+
+  private final String namespace = "urn:protobuff", revision = "2014-07-31",
+      localName = "test";
+
+  @Override
+  @Test
+  public void verifySerialization() throws Exception {
+    NormalizedNodeMessages.InstanceIdentifier.Builder instanceIdentifierBuilder =
+        NormalizedNodeMessages.InstanceIdentifier.newBuilder();
+    NormalizedNodeMessages.PathArgument.Builder pathArgument =
+        NormalizedNodeMessages.PathArgument.newBuilder();
+    pathArgument.setNodeType(NormalizedNodeMessages.QName.newBuilder()
+        .setValue(QName.create(namespace, revision, localName).toString())
+        .build());
+    pathArgument.setValue("test");
+    instanceIdentifierBuilder.addArguments(pathArgument.build());
+
+    NormalizedNodeMessages.InstanceIdentifier expectedOne =
+        instanceIdentifierBuilder.build();
+    DataChangeListenerMessages.DataChanged.Builder builder =
+        DataChangeListenerMessages.DataChanged.newBuilder();
+    builder.addRemovedPaths(expectedOne);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    DataChangeListenerMessages.DataChanged dataChangedNew =
+        (DataChangeListenerMessages.DataChanged) readFromFile(DataChangeListenerMessages.DataChanged.PARSER);
+    Assert.assertEquals(expectedOne.getArgumentsCount(), dataChangedNew
+        .getRemovedPaths(0).getArgumentsCount());
+    Assert.assertEquals(expectedOne.getArguments(0).getType(), dataChangedNew
+        .getRemovedPaths(0).getArguments(0).getType());
+
+    DataChangeListenerMessages.DataChanged dataChangedOriginal =
+        (DataChangeListenerMessages.DataChanged) readFromTestDataFile(DataChangeListenerMessages.DataChanged.PARSER);
+    Assert.assertEquals(dataChangedNew.getRemovedPathsCount(),
+        dataChangedOriginal.getRemovedPathsCount());
+    Assert.assertEquals(dataChangedNew.getRemovedPaths(0).getArguments(0)
+        .getValue(), dataChangedOriginal.getRemovedPaths(0).getArguments(0)
+        .getValue());
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return DataChangeListenerMessages.class.getSimpleName();
+  }
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/persistent/PersistentMessagesTest.java
new file mode 100644 (file)
index 0000000..a8ade30
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.persistent;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the peristent.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+public class PersistentMessagesTest extends AbstractMessagesTest {
+
+  private final String namespace = "urn:protobuff", revision = "2014-07-31",
+      localName = "test";
+
+  @Override
+  @Test
+  public void verifySerialization() throws Exception {
+    NormalizedNodeMessages.InstanceIdentifier.Builder instanceIdentifierBuilder =
+        NormalizedNodeMessages.InstanceIdentifier.newBuilder();
+    NormalizedNodeMessages.PathArgument.Builder pathArgument =
+        NormalizedNodeMessages.PathArgument.newBuilder();
+    pathArgument.setNodeType(NormalizedNodeMessages.QName.newBuilder()
+        .setValue(QName.create(namespace, revision, localName).toString())
+        .build());
+    pathArgument.setValue("test");
+    instanceIdentifierBuilder.addArguments(pathArgument.build());
+    NormalizedNodeMessages.InstanceIdentifier expectedOne =
+        instanceIdentifierBuilder.build();
+
+    PersistentMessages.Modification.Builder builder =
+        PersistentMessages.Modification.newBuilder();
+    builder.setType("test");
+    builder.setPath(expectedOne);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    PersistentMessages.Modification modificationNew =
+        (PersistentMessages.Modification) readFromFile(PersistentMessages.Modification.PARSER);
+    Assert.assertEquals("test", modificationNew.getType());
+    Assert.assertEquals(expectedOne.getArguments(0).getValue(), modificationNew
+        .getPath().getArguments(0).getValue());
+    Assert.assertEquals(expectedOne.getArguments(0).getType(), modificationNew
+        .getPath().getArguments(0).getType());
+
+    // we will compare with the serialized data that we had shipped
+    PersistentMessages.Modification modificationOriginal =
+        (PersistentMessages.Modification) readFromTestDataFile(PersistentMessages.Modification.PARSER);
+    Assert.assertEquals(modificationOriginal.getPath().getArguments(0)
+        .getValue(), modificationNew.getPath().getArguments(0).getValue());
+    Assert.assertEquals(modificationOriginal.getPath().getArguments(0)
+        .getType(), modificationNew.getPath().getArguments(0).getType());
+
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return PersistentMessagesTest.class.getSimpleName();
+  }
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/registration/ListenerRegistrationMessagesTest.java
new file mode 100644 (file)
index 0000000..1d50872
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.registration;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the ListenerRegistration.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+public class ListenerRegistrationMessagesTest extends AbstractMessagesTest {
+
+  @Override
+  @Test
+  public void verifySerialization() throws Exception {
+    String testListenerRegistrationPath =
+        "(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test?revision=2014-04-15)family";
+    ListenerRegistrationMessages.RegisterChangeListenerReply.Builder builder =
+        ListenerRegistrationMessages.RegisterChangeListenerReply.newBuilder();
+    builder.setListenerRegistrationPath(testListenerRegistrationPath);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    ListenerRegistrationMessages.RegisterChangeListenerReply rclrNew =
+        (ListenerRegistrationMessages.RegisterChangeListenerReply) readFromFile(ListenerRegistrationMessages.RegisterChangeListenerReply.PARSER);
+    Assert.assertEquals(testListenerRegistrationPath,
+        rclrNew.getListenerRegistrationPath());
+
+    ListenerRegistrationMessages.RegisterChangeListenerReply rclrOriginal =
+        (ListenerRegistrationMessages.RegisterChangeListenerReply) readFromTestDataFile(ListenerRegistrationMessages.RegisterChangeListenerReply.PARSER);
+    Assert.assertEquals(rclrOriginal.getListenerRegistrationPath(),
+        rclrNew.getListenerRegistrationPath());
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return ListenerRegistrationMessages.class.getSimpleName();
+  }
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/shard/ShardManagerMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/shard/ShardManagerMessagesTest.java
new file mode 100644 (file)
index 0000000..45dcd12
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.shard;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the ShardManager.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+
+public class ShardManagerMessagesTest extends AbstractMessagesTest {
+
+  @Test
+  public void verifySerialization() throws Exception {
+    ShardManagerMessages.FindPrimary.Builder builder =
+        ShardManagerMessages.FindPrimary.newBuilder();
+    builder.setShardName("Inventory");
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+
+    // Here we will read the same and check we got back what we had saved
+    ShardManagerMessages.FindPrimary findPrimaryNew =
+        (ShardManagerMessages.FindPrimary) readFromFile(ShardManagerMessages.FindPrimary.PARSER);
+
+    Assert.assertEquals("Inventory", findPrimaryNew.getShardName());
+
+    // Here we compare with the version we had shipped to catch any protobuff compiler version
+    // changes
+    ShardManagerMessages.FindPrimary findPrimaryOriginal =
+        (ShardManagerMessages.FindPrimary) readFromTestDataFile(ShardManagerMessages.FindPrimary.PARSER);
+
+    Assert.assertEquals(findPrimaryNew.getShardName(),
+        findPrimaryOriginal.getShardName());
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return ShardManagerMessagesTest.class.getSimpleName();
+  }
+
+}
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionChainMessagesTest.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionChainMessagesTest.java
new file mode 100644 (file)
index 0000000..c0e91ab
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
+package org.opendaylight.controller.protobuff.messages.transaction;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+
+/**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the ShardTransactionChain.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
+ * @author: syedbahm
+ *
+ */
+
+
+public class ShardTransactionChainMessagesTest extends AbstractMessagesTest {
+
+  @Override
+  @Test
+  public void verifySerialization() throws Exception {
+    String testTransactionChainPath =
+        "/actor/path";
+
+    ShardTransactionChainMessages.CreateTransactionChainReply.Builder builder =
+        ShardTransactionChainMessages.CreateTransactionChainReply.newBuilder();
+    builder.setTransactionChainPath(testTransactionChainPath);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    // Here we will read the same and check we got back what we had saved
+    ShardTransactionChainMessages.CreateTransactionChainReply replyNew =
+        (ShardTransactionChainMessages.CreateTransactionChainReply) readFromFile(ShardTransactionChainMessages.CreateTransactionChainReply.PARSER);
+
+    Assert.assertEquals(replyNew.getTransactionChainPath(),testTransactionChainPath);
+
+    // the following will compare with the version we had shipped
+    ShardTransactionChainMessages.CreateTransactionChainReply replyOriginal =
+        (ShardTransactionChainMessages.CreateTransactionChainReply) readFromTestDataFile(ShardTransactionChainMessages.CreateTransactionChainReply.PARSER);
+
+
+    Assert.assertEquals(replyOriginal.getTransactionChainPath(),
+        replyNew.getTransactionChainPath());
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return ShardTransactionChainMessagesTest.class.getSimpleName();
+  }
+
+
+
+}
index 2b1ee56..6b538da 100644 (file)
@@ -1,10 +1,85 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.protobuff.messages.transaction;
 
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.protobuff.messages.AbstractMessagesTest;
+import org.opendaylight.controller.protobuff.messages.common.NormalizedNodeMessages;
+import org.opendaylight.yangtools.yang.common.QName;
+
 /**
+ * This test case is present to ensure that if others have used proper version of protocol buffer
+ * for the ShardTransaction.proto messages
+ *
+ * If a different version of protocol buffer and there is change in serializaiton format
+ * this test would break as we are comparing with protocol buffer 2.5 generated
+ * serialized data.
+ *
  * @author: syedbahm
- * Date: 7/7/14
+ *
  */
-public class ShardTransactionMessagesTest {
+
+
+public class ShardTransactionMessagesTest extends AbstractMessagesTest {
+
+  private final String namespace = "urn:protobuff", revision = "2014-07-31",
+      localName = "test";
+
+  @Test
+  public void verifySerialization() throws Exception {
+    NormalizedNodeMessages.InstanceIdentifier.Builder instanceIdentifierBuilder =
+        NormalizedNodeMessages.InstanceIdentifier.newBuilder();
+    NormalizedNodeMessages.PathArgument.Builder pathArgument =
+        NormalizedNodeMessages.PathArgument.newBuilder();
+    pathArgument.setNodeType(NormalizedNodeMessages.QName.newBuilder()
+        .setValue(QName.create(namespace, revision, localName).toString())
+        .build());
+    pathArgument.setValue("test");
+    instanceIdentifierBuilder.addArguments(pathArgument.build());
+    ShardTransactionMessages.ReadData.Builder builder =
+        ShardTransactionMessages.ReadData.newBuilder();
+    NormalizedNodeMessages.InstanceIdentifier expectedOne =
+        instanceIdentifierBuilder.build();
+    builder.setInstanceIdentifierPathArguments(expectedOne);
+
+    writeToFile((com.google.protobuf.GeneratedMessage.Builder<?>) builder);
+
+    // Here we will read the same and check we got back what we had saved
+    ShardTransactionMessages.ReadData readDataNew =
+        (ShardTransactionMessages.ReadData) readFromFile(ShardTransactionMessages.ReadData.PARSER);
+
+
+    Assert.assertEquals(expectedOne.getArgumentsCount(), readDataNew
+        .getInstanceIdentifierPathArguments().getArgumentsCount());
+    Assert.assertEquals(expectedOne.getArguments(0), readDataNew
+        .getInstanceIdentifierPathArguments().getArguments(0));
+
+
+    // the following will compare with the version we had shipped
+    ShardTransactionMessages.ReadData readDataOriginal =
+        (ShardTransactionMessages.ReadData) readFromTestDataFile(ShardTransactionMessages.ReadData.PARSER);
+
+
+    Assert.assertEquals(readDataNew.getInstanceIdentifierPathArguments()
+        .getArguments(0), readDataOriginal.getInstanceIdentifierPathArguments()
+        .getArguments(0));
+
+  }
+
+  @Override
+  public String getTestFileName() {
+    return ShardTransactionMessagesTest.class.getSimpleName();
+  }
+
 
 
 }
index c5a581c..7de3d07 100644 (file)
@@ -1,3 +1,13 @@
+<!--
+  ~ /*
+  ~  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~  This program and the accompanying materials are made available under the
+  ~  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~  and is available at http://www.eclipse.org/legal/epl-v10.html
+  ~  */
+  -->
+
 <container xmlns="urn:opendaylight:params:xml:ns:yang:controller:test">
 
     <c2Leaf>2</c2Leaf>
index 0316d7a..934d876 100644 (file)
@@ -1,3 +1,13 @@
+<!--
+  ~ /*
+  ~  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~  This program and the accompanying materials are made available under the
+  ~  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~  and is available at http://www.eclipse.org/legal/epl-v10.html
+  ~  */
+  -->
+
 <container xmlns="urn:opendaylight:params:xml:ns:yang:controller:test" name="test" xmlns:foo="http://www.foo.com/"
            foo:baz="baz">
 
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/DataChangeListenerMessagesData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/DataChangeListenerMessagesData
new file mode 100644 (file)
index 0000000..883bcad
--- /dev/null
@@ -0,0 +1,4 @@
+23
+1
+\ 4test\1a)
+'(urn:protobuff?revision=2014-07-31)test
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ListenerRegistrationMessagesData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ListenerRegistrationMessagesData
new file mode 100644 (file)
index 0000000..1718a01
--- /dev/null
@@ -0,0 +1,2 @@
+
+m(urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:notification-test?revision=2014-04-15)family
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/NormalizedNodeMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/NormalizedNodeMessagesTestData
new file mode 100644 (file)
index 0000000..c4ec377
--- /dev/null
@@ -0,0 +1,2 @@
+
+\ 4test\12 testValue\1a\ 4fake
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/PersistentMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/PersistentMessagesTestData
new file mode 100644 (file)
index 0000000..efb8e15
--- /dev/null
@@ -0,0 +1,5 @@
+
+\ 4test\123
+1
+\ 4test\1a)
+'(urn:protobuff?revision=2014-07-31)test
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardManagerMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardManagerMessagesTestData
new file mode 100644 (file)
index 0000000..82eea07
--- /dev/null
@@ -0,0 +1,2 @@
+
+       Inventory
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionChainMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionChainMessagesTestData
new file mode 100644 (file)
index 0000000..577d9c4
--- /dev/null
@@ -0,0 +1,2 @@
+
+\v/actor/path
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ShardTransactionMessagesTestData
new file mode 100644 (file)
index 0000000..db43fa4
--- /dev/null
@@ -0,0 +1,5 @@
+
+3
+1
+\ 4test\1a)
+'(urn:protobuff?revision=2014-07-31)test
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ThreePhaseCommitCohortMessagesTestData b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/ThreePhaseCommitCohortMessagesTestData
new file mode 100644 (file)
index 0000000..e19a122
--- /dev/null
@@ -0,0 +1 @@
+\b\ 1
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/readme.txt b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/test/resources/version-compatibility-serialized-data/readme.txt
new file mode 100644 (file)
index 0000000..06a561e
--- /dev/null
@@ -0,0 +1,18 @@
+This directory contains one serialized test data file for one of the messages in each .proto file.
+These files are utilized as part of the  test cases, mostly to fail the test cases in case some engineer has used
+a different version of protocol buffer than what we ship with (Protocol Buffer 2.5.0) to generate the messages source f
+file.
+
+1. If you see protocolbuffer version/invalid message exception in the test case
+  1. ensure you are using the right version of protocol buffer/protoc compiler i.e protocol
+
+2. If you have knowingly updated an existing .proto message than please update the corresponding version-compatibility-serialized-data
+file. You can get the file by commenting out the test file deletion in AbstractMessagesTest look for comments
+
+ /* we will delete only the test file -- comment below if you want to capture the
+       version-compatibility-serialized-data test data file.The file will be generated at root of the sal-protocolbuffer-encoding
+       and you need to move it to version-compatbility-serialized-data folder renaming the file to include suffix <TestFileName>"Data"
+  */
+
+3. If you are creating a new .proto file -- Follow an existing test case e.g. ThreePhaseCommitCohortMessagesTest to
+   check how the test case is created and create the corresponding serialized test data file in version-compatibility-serialized-data

©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.