aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/pcep/pcepio/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/pcep/pcepio/src/test')
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AdministrativeGroupTlvTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AutonomousSystemTlvTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/BGPLSidentifierTlvTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/GmplsCapabilityTlvTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IGPMetricTlvTest.java40
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4InterfaceAddressTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4NeighborAddressTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4SubObjectTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfLocalNodeTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfRemoteNodeTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6InterfaceAddressTlvTest.java44
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6NeighborAddressTlvTest.java44
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6SubObjectTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofLocalNodeTlvTest.java44
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofRemoteNodeTlvTest.java44
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/ISISAreaIdentifierTlvTest.java42
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LabelSubObjectTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkLocalRemoteIdentifiersTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkNameTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkProtectionTypeTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LocalTENodeDescriptorsTlvTest.java56
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MPLSProtocolMaskTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumLinkBandwidthTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumReservableLinkBandwidthTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv4addressTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv6addressTlvTest.java43
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopUnnumberedIPv4IDTlvTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeFlagBitsTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeNameTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OSPFareaIDsubTlvTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OpaqueLinkAttributeTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathKeySubObjectTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathSetupTypeTlvTest.java36
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PceccCapabilityTlvTest.java41
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepCloseMsgTest.java60
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepErrorMsgTest.java739
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgExtTest.java1686
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgTest.java1335
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepKeepaliveMsgTest.java63
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepLabelUpdateMsgTest.java406
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4AdjacencyTest.java38
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4NodeIdTest.java36
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6AdjacencyTest.java39
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6NodeIdTest.java45
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiUnnumberedAdjacencyIpv4Test.java51
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepOpenMsgTest.java562
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgExtTest.java221
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgTest.java1601
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepTEReportMsgTest.java1600
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgExtTest.java1275
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgTest.java1427
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RemoteTENodeDescriptorsTlvTest.java57
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RouterIDSubTlvTest.java44
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RoutingUniverseTlvTest.java37
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SharedRiskLinkGroupTlvTest.java43
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SrEroSubObjectTest.java61
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulIPv4LspIdentidiersTlvTest.java57
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspDbVerTlvTest.java37
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspErrorCodeTlvTest.java32
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulPceCapabilityTlvTest.java35
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SymbolicPathNameTlvTest.java45
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TEDefaultMetricTlvTest.java36
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkAttributesTlvTest.java59
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkDescriptorsTlvTest.java57
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TENodeAttributesTlvTest.java59
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TedCapabilityTlvTest.java36
-rw-r--r--framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/UnreservedBandwidthTlvTest.java37
67 files changed, 13299 insertions, 0 deletions
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AdministrativeGroupTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AdministrativeGroupTlvTest.java
new file mode 100644
index 00000000..b3ff2cbb
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AdministrativeGroupTlvTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.AdministrativeGroupTlv;
+
+/**
+ * Test of the AdministrativeGroupTlv.
+ */
+public class AdministrativeGroupTlvTest {
+ private final AdministrativeGroupTlv tlv1 = AdministrativeGroupTlv.of(1);
+ private final AdministrativeGroupTlv sameAsTlv1 = AdministrativeGroupTlv.of(1);
+ private final AdministrativeGroupTlv tlv2 = AdministrativeGroupTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AutonomousSystemTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AutonomousSystemTlvTest.java
new file mode 100644
index 00000000..7a0078f9
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/AutonomousSystemTlvTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.AutonomousSystemTlv;
+
+/**
+ * Test of the AutonomousSystemTlv.
+ */
+public class AutonomousSystemTlvTest {
+ private final AutonomousSystemTlv tlv1 = AutonomousSystemTlv.of(1);
+ private final AutonomousSystemTlv sameAsTlv1 = AutonomousSystemTlv.of(1);
+ private final AutonomousSystemTlv tlv2 = AutonomousSystemTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/BGPLSidentifierTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/BGPLSidentifierTlvTest.java
new file mode 100644
index 00000000..d7a1f852
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/BGPLSidentifierTlvTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.BGPLSidentifierTlv;
+
+/**
+ * Test of the BGPLSidentifierTlv.
+ */
+public class BGPLSidentifierTlvTest {
+ private final BGPLSidentifierTlv tlv1 = BGPLSidentifierTlv.of(1);
+ private final BGPLSidentifierTlv sameAsTlv1 = BGPLSidentifierTlv.of(1);
+ private final BGPLSidentifierTlv tlv2 = BGPLSidentifierTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/GmplsCapabilityTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/GmplsCapabilityTlvTest.java
new file mode 100644
index 00000000..3a5c972b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/GmplsCapabilityTlvTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.GmplsCapabilityTlv;
+
+/**
+ * Test of the GmplsCapabilityTlv.
+ */
+public class GmplsCapabilityTlvTest {
+ private final GmplsCapabilityTlv tlv1 = GmplsCapabilityTlv.of(1);
+ private final GmplsCapabilityTlv sameAsTlv1 = GmplsCapabilityTlv.of(1);
+ private final GmplsCapabilityTlv tlv2 = GmplsCapabilityTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IGPMetricTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IGPMetricTlvTest.java
new file mode 100644
index 00000000..583b7049
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IGPMetricTlvTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IGPMetricTlv;
+
+/**
+ * Test of the IGPMetricTlv.
+ */
+public class IGPMetricTlvTest {
+ private final byte[] b1 = new byte[] {0x01, 0x02};
+ private final byte[] b2 = new byte[] {0x01, 0x02};
+ private final IGPMetricTlv tlv1 = IGPMetricTlv.of(b1, (short) 2);
+ private final IGPMetricTlv sameAsTlv1 = IGPMetricTlv.of(b1, (short) 2);
+ private final IGPMetricTlv tlv2 = IGPMetricTlv.of(b2, (short) 2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4InterfaceAddressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4InterfaceAddressTlvTest.java
new file mode 100644
index 00000000..c25a6b5b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4InterfaceAddressTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4InterfaceAddressTlv;
+
+/**
+ * Test of the IPv4InterfaceAddressTlv.
+ */
+public class IPv4InterfaceAddressTlvTest {
+
+ private final IPv4InterfaceAddressTlv tlv1 = IPv4InterfaceAddressTlv.of(2);
+ private final IPv4InterfaceAddressTlv sameAsTlv1 = IPv4InterfaceAddressTlv.of(2);
+ private final IPv4InterfaceAddressTlv tlv2 = IPv4InterfaceAddressTlv.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4NeighborAddressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4NeighborAddressTlvTest.java
new file mode 100644
index 00000000..60a4f120
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4NeighborAddressTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4NeighborAddressTlv;
+
+/**
+ * Test of the IPv4NeighborAddressTlv.
+ */
+public class IPv4NeighborAddressTlvTest {
+
+ private final IPv4NeighborAddressTlv tlv1 = IPv4NeighborAddressTlv.of(2);
+ private final IPv4NeighborAddressTlv sameAsTlv1 = IPv4NeighborAddressTlv.of(2);
+ private final IPv4NeighborAddressTlv tlv2 = IPv4NeighborAddressTlv.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4SubObjectTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4SubObjectTest.java
new file mode 100644
index 00000000..08b49879
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4SubObjectTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4SubObject;
+
+/**
+ * Test of the IPv4SubObject.
+ */
+public class IPv4SubObjectTest {
+
+ private final IPv4SubObject subObj1 = IPv4SubObject.of(2, (byte) 16, (byte) 0);
+ private final IPv4SubObject sameAsSubObj1 = IPv4SubObject.of(2, (byte) 16, (byte) 0);
+ private final IPv4SubObject subObj2 = IPv4SubObject.of(3, (byte) 16, (byte) 0);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(subObj1, sameAsSubObj1)
+ .addEqualityGroup(subObj2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfLocalNodeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfLocalNodeTlvTest.java
new file mode 100644
index 00000000..d04be239
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfLocalNodeTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4TERouterIdOfLocalNodeTlv;
+
+/**
+ * Test of the IPv4TERouterIdOfLocalNodeTlv.
+ */
+public class IPv4TERouterIdOfLocalNodeTlvTest {
+
+ private final IPv4TERouterIdOfLocalNodeTlv tlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2);
+ private final IPv4TERouterIdOfLocalNodeTlv sameAsTlv1 = IPv4TERouterIdOfLocalNodeTlv.of(2);
+ private final IPv4TERouterIdOfLocalNodeTlv tlv2 = IPv4TERouterIdOfLocalNodeTlv.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfRemoteNodeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfRemoteNodeTlvTest.java
new file mode 100644
index 00000000..fb8c9653
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv4TERouterIdOfRemoteNodeTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4TERouterIdOfRemoteNodeTlv;
+
+/**
+ * Test of the IPv4TERouterIdOfRemoteNodeTlv.
+ */
+public class IPv4TERouterIdOfRemoteNodeTlvTest {
+
+ private final IPv4TERouterIdOfRemoteNodeTlv tlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
+ private final IPv4TERouterIdOfRemoteNodeTlv sameAsTlv1 = IPv4TERouterIdOfRemoteNodeTlv.of(2);
+ private final IPv4TERouterIdOfRemoteNodeTlv tlv2 = IPv4TERouterIdOfRemoteNodeTlv.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6InterfaceAddressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6InterfaceAddressTlvTest.java
new file mode 100644
index 00000000..6eb771da
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6InterfaceAddressTlvTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv6InterfaceAddressTlv;
+
+/**
+ * Test of the IPv6InterfaceAddressTlv.
+ */
+public class IPv6InterfaceAddressTlvTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final IPv6InterfaceAddressTlv tlv1 = IPv6InterfaceAddressTlv.of(b1);
+ private final IPv6InterfaceAddressTlv sameAsTlv1 = IPv6InterfaceAddressTlv.of(b1);
+ private final IPv6InterfaceAddressTlv tlv2 = IPv6InterfaceAddressTlv.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6NeighborAddressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6NeighborAddressTlvTest.java
new file mode 100644
index 00000000..17fa9a3b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6NeighborAddressTlvTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv6NeighborAddressTlv;
+
+/**
+ * Test of the IPv6NeighborAddressTlv.
+ */
+public class IPv6NeighborAddressTlvTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final IPv6NeighborAddressTlv tlv1 = IPv6NeighborAddressTlv.of(b1);
+ private final IPv6NeighborAddressTlv sameAsTlv1 = IPv6NeighborAddressTlv.of(b1);
+ private final IPv6NeighborAddressTlv tlv2 = IPv6NeighborAddressTlv.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6SubObjectTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6SubObjectTest.java
new file mode 100644
index 00000000..08a47237
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6SubObjectTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv6SubObject;
+
+/**
+ * Test of the IPv6SubObject.
+ */
+public class IPv6SubObjectTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final IPv6SubObject subObj1 = IPv6SubObject.of(b1);
+ private final IPv6SubObject sameAsSubObj1 = IPv6SubObject.of(b1);
+ private final IPv6SubObject subObj2 = IPv6SubObject.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(subObj1, sameAsSubObj1).addEqualityGroup(subObj2).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofLocalNodeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofLocalNodeTlvTest.java
new file mode 100644
index 00000000..b37cb3d8
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofLocalNodeTlvTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv6TERouterIdofLocalNodeTlv;
+
+/**
+ * Test of the IPv6TERouterIdofLocalNodeTlv.
+ */
+public class IPv6TERouterIdofLocalNodeTlvTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final IPv6TERouterIdofLocalNodeTlv tlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
+ private final IPv6TERouterIdofLocalNodeTlv sameAsTlv1 = IPv6TERouterIdofLocalNodeTlv.of(b1);
+ private final IPv6TERouterIdofLocalNodeTlv tlv2 = IPv6TERouterIdofLocalNodeTlv.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofRemoteNodeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofRemoteNodeTlvTest.java
new file mode 100644
index 00000000..e572e358
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/IPv6TERouterIdofRemoteNodeTlvTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv6TERouterIdofRemoteNodeTlv;
+
+/**
+ * Test of the IPv6TERouterIdofRemoteNodeTlv.
+ */
+public class IPv6TERouterIdofRemoteNodeTlvTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00};
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final IPv6TERouterIdofRemoteNodeTlv tlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
+ private final IPv6TERouterIdofRemoteNodeTlv sameAsTlv1 = IPv6TERouterIdofRemoteNodeTlv.of(b1);
+ private final IPv6TERouterIdofRemoteNodeTlv tlv2 = IPv6TERouterIdofRemoteNodeTlv.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/ISISAreaIdentifierTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/ISISAreaIdentifierTlvTest.java
new file mode 100644
index 00000000..7bea1a9b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/ISISAreaIdentifierTlvTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.ISISAreaIdentifierTlv;
+
+/**
+ * Test of the ISISAreaIdentifierTlv.
+ */
+public class ISISAreaIdentifierTlvTest {
+
+ private final byte[] b1 = new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+ private final byte[] b2 = new byte[] {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
+
+ private final ISISAreaIdentifierTlv tlv1 = ISISAreaIdentifierTlv.of(b1, (short) 20);
+ private final ISISAreaIdentifierTlv sameAsTlv1 = ISISAreaIdentifierTlv.of(b1, (short) 20);
+ private final ISISAreaIdentifierTlv tlv2 = ISISAreaIdentifierTlv.of(b2, (short) 20);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LabelSubObjectTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LabelSubObjectTest.java
new file mode 100644
index 00000000..41d1f4ba
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LabelSubObjectTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.LabelSubObject;
+
+/**
+ * Test of the LabelSubObject.
+ */
+public class LabelSubObjectTest {
+
+ private final LabelSubObject subObj1 = LabelSubObject.of((byte) 0, (byte) 1, 20);
+ private final LabelSubObject sameAsSubObj1 = LabelSubObject.of((byte) 0, (byte) 1, 20);
+ private final LabelSubObject subObj2 = LabelSubObject.of((byte) 0, (byte) 1, 30);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(subObj1, sameAsSubObj1)
+ .addEqualityGroup(subObj2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkLocalRemoteIdentifiersTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkLocalRemoteIdentifiersTlvTest.java
new file mode 100644
index 00000000..1d04b47c
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkLocalRemoteIdentifiersTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.LinkLocalRemoteIdentifiersTlv;
+
+/**
+ * Test of the LinkLocalRemoteIdentifiersTlv.
+ */
+public class LinkLocalRemoteIdentifiersTlvTest {
+
+ private final LinkLocalRemoteIdentifiersTlv tlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20);
+ private final LinkLocalRemoteIdentifiersTlv sameAsTlv1 = LinkLocalRemoteIdentifiersTlv.of(10, 20);
+ private final LinkLocalRemoteIdentifiersTlv tlv2 = LinkLocalRemoteIdentifiersTlv.of(20, 30);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkNameTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkNameTlvTest.java
new file mode 100644
index 00000000..5236be9d
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkNameTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.LinkNameTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for LinkNameTlv.
+ */
+public class LinkNameTlvTest {
+ private final byte[] rawValue1 = new byte[] {0x01, 0x00};
+ private final byte[] rawValue2 = new byte[] {0x02, 0x00};
+
+ private final LinkNameTlv tlv1 = new LinkNameTlv(rawValue1, (short) rawValue1.length);
+ private final LinkNameTlv sameAsTlv1 = LinkNameTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final LinkNameTlv tlv2 = new LinkNameTlv(rawValue2, (short) 0);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkProtectionTypeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkProtectionTypeTlvTest.java
new file mode 100644
index 00000000..4eea1b00
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LinkProtectionTypeTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.LinkProtectionTypeTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the LinkProtectionTypeTlv.
+ */
+public class LinkProtectionTypeTlvTest {
+ private final byte rawValue1 = 0x0A;
+ private final byte rawValue2 = 0x0B;
+
+ private final LinkProtectionTypeTlv tlv1 = new LinkProtectionTypeTlv(rawValue1);
+ private final LinkProtectionTypeTlv sameAsTlv1 = new LinkProtectionTypeTlv(rawValue1);
+ private final LinkProtectionTypeTlv tlv2 = new LinkProtectionTypeTlv(rawValue2, (byte) 0);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LocalTENodeDescriptorsTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LocalTENodeDescriptorsTlvTest.java
new file mode 100644
index 00000000..3311a96c
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/LocalTENodeDescriptorsTlvTest.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+
+import java.util.LinkedList;
+
+import org.onosproject.pcepio.types.LocalTENodeDescriptorsTlv;
+import org.onosproject.pcepio.types.AutonomousSystemTlv;
+import org.onosproject.pcepio.types.BGPLSidentifierTlv;
+import org.onosproject.pcepio.types.PcepValueType;
+
+/**
+ * Test of the LocalTENodeDescriptorsTlv.
+ */
+public class LocalTENodeDescriptorsTlvTest {
+
+ private final AutonomousSystemTlv baAutoSysTlvRawValue1 = new AutonomousSystemTlv(1);
+ private final BGPLSidentifierTlv baBgplsIdRawValue1 = new BGPLSidentifierTlv(1);
+
+ private final AutonomousSystemTlv baAutoSysTlvRawValue2 = new AutonomousSystemTlv(2);
+ private final BGPLSidentifierTlv baBgplsIdRawValue2 = new BGPLSidentifierTlv(2);
+
+ private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs1 = new LinkedList<PcepValueType>();
+ private final boolean a = llNodeDescriptorSubTLVs1.add(baAutoSysTlvRawValue1);
+ private final boolean b = llNodeDescriptorSubTLVs1.add(baBgplsIdRawValue1);
+
+ private final LinkedList<PcepValueType> llNodeDescriptorSubTLVs2 = new LinkedList<PcepValueType>();
+ private final boolean c = llNodeDescriptorSubTLVs2.add(baAutoSysTlvRawValue2);
+ private final boolean d = llNodeDescriptorSubTLVs2.add(baBgplsIdRawValue2);
+
+ private final LocalTENodeDescriptorsTlv tlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
+ private final LocalTENodeDescriptorsTlv sameAstlv1 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs1);
+ private final LocalTENodeDescriptorsTlv tlv2 = LocalTENodeDescriptorsTlv.of(llNodeDescriptorSubTLVs2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MPLSProtocolMaskTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MPLSProtocolMaskTlvTest.java
new file mode 100644
index 00000000..eda99a38
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MPLSProtocolMaskTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.MPLSProtocolMaskTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the MPLSProtocolMaskTlv.
+ */
+public class MPLSProtocolMaskTlvTest {
+ private final byte rawValue1 = 0x0A;
+ private final byte rawValue2 = 0x0B;
+
+ private final MPLSProtocolMaskTlv tlv1 = new MPLSProtocolMaskTlv(rawValue1);
+ private final MPLSProtocolMaskTlv sameAsTlv1 = new MPLSProtocolMaskTlv(rawValue1);
+ private final MPLSProtocolMaskTlv tlv2 = MPLSProtocolMaskTlv.of(rawValue2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumLinkBandwidthTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumLinkBandwidthTlvTest.java
new file mode 100644
index 00000000..50902acb
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumLinkBandwidthTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.MaximumLinkBandwidthTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the MaximumLinkBandwidthTlv.
+ */
+public class MaximumLinkBandwidthTlvTest {
+ private final int rawValue1 = 0x0A;
+ private final int rawValue2 = 0x0B;
+
+ private final MaximumLinkBandwidthTlv tlv1 = new MaximumLinkBandwidthTlv(rawValue1);
+ private final MaximumLinkBandwidthTlv sameAsTlv1 = new MaximumLinkBandwidthTlv(rawValue1);
+ private final MaximumLinkBandwidthTlv tlv2 = MaximumLinkBandwidthTlv.of(rawValue2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumReservableLinkBandwidthTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumReservableLinkBandwidthTlvTest.java
new file mode 100644
index 00000000..da72c5ff
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/MaximumReservableLinkBandwidthTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.MaximumReservableLinkBandwidthTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the MaximumReservableLinkBandwidthTlv.
+ */
+public class MaximumReservableLinkBandwidthTlvTest {
+ private final int rawValue1 = 0x0A;
+ private final int rawValue2 = 0x0B;
+
+ private final MaximumReservableLinkBandwidthTlv tlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
+ private final MaximumReservableLinkBandwidthTlv sameAsTlv1 = new MaximumReservableLinkBandwidthTlv(rawValue1);
+ private final MaximumReservableLinkBandwidthTlv tlv2 = MaximumReservableLinkBandwidthTlv.of(rawValue2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv4addressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv4addressTlvTest.java
new file mode 100644
index 00000000..27539fae
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv4addressTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.NexthopIPv4addressTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for NexthopIPv4addressTlv.
+ */
+public class NexthopIPv4addressTlvTest {
+
+ private final NexthopIPv4addressTlv tlv1 = new NexthopIPv4addressTlv(0x0A);
+ private final NexthopIPv4addressTlv sameAsTlv1 = new NexthopIPv4addressTlv(0x0A);
+ private final NexthopIPv4addressTlv tlv2 = NexthopIPv4addressTlv.of(0x0B);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv6addressTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv6addressTlvTest.java
new file mode 100644
index 00000000..a543d651
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopIPv6addressTlvTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.NexthopIPv6addressTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for NexthopIPv6addressTlv.
+ */
+public class NexthopIPv6addressTlvTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02, 0x00, 0x00 };
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02, 0x00, 0x00 };
+
+ private final NexthopIPv6addressTlv tlv1 = NexthopIPv6addressTlv.of(b1);
+ private final NexthopIPv6addressTlv sameAsTlv1 = NexthopIPv6addressTlv.of(b1);
+ private final NexthopIPv6addressTlv tlv2 = NexthopIPv6addressTlv.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopUnnumberedIPv4IDTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopUnnumberedIPv4IDTlvTest.java
new file mode 100644
index 00000000..457b9347
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NexthopUnnumberedIPv4IDTlvTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.NexthopUnnumberedIPv4IDTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for NexthopUnnumberedIPv4IDTlv.
+ */
+public class NexthopUnnumberedIPv4IDTlvTest {
+
+ private final NexthopUnnumberedIPv4IDTlv tlv1 = new NexthopUnnumberedIPv4IDTlv(0x0A, 0x0A);
+ private final NexthopUnnumberedIPv4IDTlv sameAsTlv1 = new NexthopUnnumberedIPv4IDTlv(0x0A, 0x0A);
+ private final NexthopUnnumberedIPv4IDTlv tlv2 = NexthopUnnumberedIPv4IDTlv.of(0x0B, 0x0B);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeFlagBitsTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeFlagBitsTlvTest.java
new file mode 100644
index 00000000..a50062ae
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeFlagBitsTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.NodeFlagBitsTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the NodeFlagBitsTlv.
+ */
+public class NodeFlagBitsTlvTest {
+ private final byte rawValue1 = 0x0A;
+ private final byte rawValue2 = 0x0B;
+
+ private final NodeFlagBitsTlv tlv1 = new NodeFlagBitsTlv(rawValue1);
+ private final NodeFlagBitsTlv sameAsTlv1 = new NodeFlagBitsTlv(rawValue1);
+ private final NodeFlagBitsTlv tlv2 = NodeFlagBitsTlv.of(rawValue2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeNameTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeNameTlvTest.java
new file mode 100644
index 00000000..bb35ed90
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/NodeNameTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.NodeNameTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the NodeNameTlv.
+ */
+public class NodeNameTlvTest {
+ private final byte[] rawValue1 = new byte[] {0x01, 0x02};
+ private final byte[] rawValue2 = new byte[] {0x14, 0x15};
+
+ private final NodeNameTlv tlv1 = new NodeNameTlv(rawValue1, (short) rawValue1.length);
+ private final NodeNameTlv sameAsTlv1 = NodeNameTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final NodeNameTlv tlv2 = new NodeNameTlv(rawValue2, (short) 0);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OSPFareaIDsubTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OSPFareaIDsubTlvTest.java
new file mode 100644
index 00000000..4b67a900
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OSPFareaIDsubTlvTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.OSPFareaIDsubTlv;
+
+/**
+ * Test of the OSPFareaIDsubTlv.
+ */
+public class OSPFareaIDsubTlvTest {
+ private final int rawValue1 = 0x0A;
+
+ private final OSPFareaIDsubTlv tlv1 = new OSPFareaIDsubTlv(rawValue1);
+ private final OSPFareaIDsubTlv tlv2 = OSPFareaIDsubTlv.of(tlv1.getInt());
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OpaqueLinkAttributeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OpaqueLinkAttributeTlvTest.java
new file mode 100644
index 00000000..cda77a02
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/OpaqueLinkAttributeTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.OpaqueLinkAttributeTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the OpaqueLinkAttributeTlv.
+ */
+public class OpaqueLinkAttributeTlvTest {
+ private final byte[] rawValue1 = new byte[] {0x01, 0x02};
+ private final byte[] rawValue2 = new byte[] {0x14, 0x15};
+
+ private final OpaqueLinkAttributeTlv tlv1 = new OpaqueLinkAttributeTlv(rawValue1, (short) rawValue1.length);
+ private final OpaqueLinkAttributeTlv sameAsTlv1 = OpaqueLinkAttributeTlv.of(tlv1.getValue(), tlv1.getLength());
+ private final OpaqueLinkAttributeTlv tlv2 = new OpaqueLinkAttributeTlv(rawValue2, (short) 0);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathKeySubObjectTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathKeySubObjectTest.java
new file mode 100644
index 00000000..cab43794
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathKeySubObjectTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PathKeySubObject;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the PathKeySubObject.
+ */
+public class PathKeySubObjectTest {
+
+ private final PathKeySubObject tlv1 = new PathKeySubObject((short) 0x0A, 0x0A);
+ private final PathKeySubObject sameAsTlv1 = PathKeySubObject.of((short) 0x0A, 0x0A);
+ private final PathKeySubObject tlv2 = new PathKeySubObject((short) 0x0B, 0x0B);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathSetupTypeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathSetupTypeTlvTest.java
new file mode 100644
index 00000000..e56c96e5
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PathSetupTypeTlvTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PathSetupTypeTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the PathSetupTypeTlv.
+ */
+public class PathSetupTypeTlvTest {
+
+ private final PathSetupTypeTlv tlv1 = PathSetupTypeTlv.of(0x0A);
+ private final PathSetupTypeTlv sameAsTlv1 = PathSetupTypeTlv.of(0x0A);
+ private final PathSetupTypeTlv tlv2 = PathSetupTypeTlv.of(0x0B);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PceccCapabilityTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PceccCapabilityTlvTest.java
new file mode 100644
index 00000000..a8d521a9
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PceccCapabilityTlvTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PceccCapabilityTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test of the PceccCapabilityTlv.
+ */
+public class PceccCapabilityTlvTest {
+ private final int rawValue1 = 0x0A;
+ private final int rawValue2 = 0x0B;
+
+ private final PceccCapabilityTlv tlv1 = new PceccCapabilityTlv(rawValue1);
+ private final PceccCapabilityTlv sameAsTlv1 = new PceccCapabilityTlv(rawValue1);
+ private final PceccCapabilityTlv tlv2 = PceccCapabilityTlv.of(rawValue2);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, sameAsTlv1)
+ .addEqualityGroup(tlv2)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepCloseMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepCloseMsgTest.java
new file mode 100644
index 00000000..8faab559
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepCloseMsgTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepCloseMsg;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepCloseMsgTest {
+
+ /**
+ * Common header, reason to close.
+ */
+ @Test
+ public void closeMessageTest1() throws PcepParseException {
+
+ byte[] closeMsg = new byte[] {0x20, 0x07, 0x00, 0x0C, 0x0f, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02 };
+
+ byte[] testCloseMsg = {0 };
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(closeMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepCloseMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testCloseMsg = buf.array();
+
+ int readLen = buf.writerIndex();
+ testCloseMsg = new byte[readLen];
+ buf.readBytes(testCloseMsg, 0, readLen);
+ assertThat(testCloseMsg, is(closeMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepErrorMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepErrorMsgTest.java
new file mode 100644
index 00000000..2fc1fedf
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepErrorMsgTest.java
@@ -0,0 +1,739 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepErrorMsg;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Test cases for PCEP ERROR Message.
+ */
+public class PcepErrorMsgTest {
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV, TED Capability TLV)
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest1() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x01, 0x10, 0x00, 0x28, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x00};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV, TED Capability TLV)
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest2() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x01, 0x10, 0x00, 0x28, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x00};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV)
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest3() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x34, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x01, 0x10, 0x00, 0x20, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x03};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV)
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest4() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2c, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x01, 0x10, 0x00, 0x18, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object (STATEFUL-PCE-CAPABILITY)
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest5() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x01, 0x10, 0x00, 0x10, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, OPEN Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest6() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x1C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x01, 0x10, 0x00, 0x08, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01 // OPEN object
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, OPEN Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest7() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x01, 0x10, 0x00, 0x08, // OPEN object header
+ 0x20, 0x05, 0x1E, 0x01 // OPEN object
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, RP Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest8() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest9() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest10() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x14, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest11() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header
+ 0x65, 0x13, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * RP Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest12() throws PcepParseException {
+
+ //RP Object, PCEP-ERROR Object
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x18, // common header
+ 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * RP Object, RP Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest13() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
+ 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object, TE Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest14() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x24, // common header
+ 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, TE Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest15() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x20, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x03};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest16() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest17() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x2C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x03};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest18() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x06};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, PCEP-ERROR Object, TE Object, TE Object, PCEP-ERROR Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest19() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x3C, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x03, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x11, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x06};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+
+ /**
+ * This test case checks for
+ * PCEP-ERROR Object, RP Object, RP Object, PCEP-ERROR Object, PCEP-ERROR Object,
+ * TE Object, PCEP-ERROR Object
+ * in PcepErrorMsg message.
+ */
+ @Test
+ public void errorMessageTest20() throws PcepParseException {
+
+ byte[] errorMsg = new byte[]{0x20, 0x06, 0x00, 0x48, // common header
+ 0x0D, 0x10, 0x00, 0x08, // PCEP-ERROR Object Header
+ 0x00, 0x00, 0x01, 0x01, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x10, 0x00, 0x0C, // RP Object Header
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x04, 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x06, 0x65, 0x10, 0x00, 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x0D, 0x10, 0x00, 0x08, // PCERR Object Header
+ 0x00, 0x00, 0x01, 0x06};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(errorMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testErrorMsg = {0};
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ assertThat(message, instanceOf(PcepErrorMsg.class));
+
+ message.writeTo(buf);
+ int iReadLen = buf.writerIndex();
+ testErrorMsg = new byte[iReadLen];
+ buf.readBytes(testErrorMsg, 0, iReadLen);
+
+ assertThat(testErrorMsg, is(errorMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgExtTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgExtTest.java
new file mode 100644
index 00000000..9da4c62e
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgExtTest.java
@@ -0,0 +1,1686 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepInitiateMsg;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.Matchers.instanceOf;
+
+public class PcepInitiateMsgExtTest {
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest1() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA4,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, //Metric object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv,
+ * StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest2() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x48, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
+ 0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest3() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ // 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
+ //0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
+ * END-POINTS, ERO, LSPA objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest4() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ // 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
+ // 0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest5() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest6() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x8c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO,
+ * LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest7() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv,
+ * StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x98,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest8() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x90,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest9() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest10() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest11() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ * END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7C,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x30, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest12() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x78,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest13() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspDbVerTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x84,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest14() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x7c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest15() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest16() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest17() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest18() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest19() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest20() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest21() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO,
+ * LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest22() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest23() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest25() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest26() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x6C,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA,
+ * BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest27() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO,
+ * LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest28() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
+ * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest29() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4C,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
+ * END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest30() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5C,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest31() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest32() throws PcepParseException {
+
+ /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH, METRIC OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest33() throws PcepParseException {
+
+ /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA, BANDWIDTH OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest34() throws PcepParseException {
+
+ /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest35() throws PcepParseException {
+
+ /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest36() throws PcepParseException {
+
+ /* SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
+ * ERO, LSPA OBJECT.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x0C, 0x01, //ERO object
+ 0x01, 0x01, 0x00, 0x00, 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+}
+
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgTest.java
new file mode 100644
index 00000000..a27b781f
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepInitiateMsgTest.java
@@ -0,0 +1,1335 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepInitiateMsg;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepInitiateMsgTest {
+
+ /**
+ * This test case checks for srp, lsp, end-point, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest1() throws PcepParseException {
+
+ /* srp, lsp, end-point, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, 0x54,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x00, 0x08, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp and lsp objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest2() throws PcepParseException {
+ /* srp, lsp.
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x34,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x20, 0x10, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ 0x01, 0x01, 0x01, 0x01, 0x00, 0x43, (byte) 0x83, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33}; //SymbolicPathTlv
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO objects
+ * in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest3() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest4() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest5() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest6() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest7() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest8() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x4c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest9() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * END-POINT, ERO.
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x3c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv)
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest10() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x44,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f,
+ (byte) 0xb6, 0x02, 0x4e, 0x20, 0x00, 0x11, 0x00, 0x04, 0x54, 0x31, 0x32, 0x33, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08 //StatefulLspErrorCodeTlv
+ };
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv) objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest11() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ StatefulLspErrorCodeTlv).*/
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x44,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08}; //StatefulLspErrorCodeTlv
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest12() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x3c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00 //SymbolicPathNameTlv
+ };
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest13() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x3c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00}; //SymbolicPathNameTlv
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv)
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest14() throws PcepParseException {
+
+ /* SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x34,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20};
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv)
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest15() throws PcepParseException {
+
+ /* SRP, LSP (StatefulIPv4LspIdentidiersTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x2c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20};
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest16() throws PcepParseException {
+
+ //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest17() throws PcepParseException {
+
+ //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest18() throws PcepParseException {
+ //srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest19() throws PcepParseException {
+ //srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x74,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x04, //ERO object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
+ * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv) objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest20() throws PcepParseException {
+ /* srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
+ * lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv).
+ */
+ byte[] initiateDeletionMsg = new byte[]{0x20, 0x0C, 0x00, 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20};
+
+ byte[] testInitiateDeletionMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateDeletionMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateDeletionMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateDeletionMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
+
+ assertThat(testInitiateDeletionMsg, is(initiateDeletionMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest21() throws PcepParseException {
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0x94,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest22() throws PcepParseException {
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xA8,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest23() throws PcepParseException {
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
+ */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xB0,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest24() throws PcepParseException {
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth*/
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xBC,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv), end-point,ero,lspa,bandwidth,metric-list
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest25() throws PcepParseException {
+
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),
+ * end-point,ero,lspa,bandwidth,metric-list */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xC4,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,metric-list,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv), end-point,ero,lspa,bandwidth,metric-list
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest26() throws PcepParseException {
+
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,bandwidth,metric-list,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),
+ * end-point,ero,lspa,bandwidth,metric-list */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xD0,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+
+ /**
+ * This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv), end-point,ero,lspa,bandwidth,metric-list
+ * objects in PcInitiate message.
+ */
+ @Test
+ public void initiateMessageTest27() throws PcepParseException {
+
+ /*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list,
+ * srp,lsp(StatefulIPv4LspIdentidiersTlv),
+ * end-point,ero,lspa,bandwidth,metric-list */
+ byte[] initiateCreationMsg = new byte[]{0x20, 0x0C, 0x00, (byte) 0xE4,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x04, 0x12, 0x00, 0x0C, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, //Endpoints Object
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x01, 0x08, 0x0C, 0x01, 0x01, 0x02, 0x00, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testInitiateCreationMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(initiateCreationMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepInitiateMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testInitiateCreationMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testInitiateCreationMsg = new byte[iReadLen];
+ buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
+
+ assertThat(testInitiateCreationMsg, is(initiateCreationMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepKeepaliveMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepKeepaliveMsgTest.java
new file mode 100644
index 00000000..a35c8af5
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepKeepaliveMsgTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Assert;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepKeepaliveMsg;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepKeepaliveMsgTest {
+
+ /**
+ * Common header for keep alive message.
+ */
+ @Test
+ public void keepaliveMessageTest1() throws PcepParseException {
+
+ byte[] keepaliveMsg = new byte[] {0x20, 0x02, 0x00, 0x04 };
+
+ byte[] testKeepaliveMsg = {0 };
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(keepaliveMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepKeepaliveMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+
+ message.writeTo(buf);
+
+ testKeepaliveMsg = buf.array();
+
+ int iReadLen = buf.writerIndex();
+ testKeepaliveMsg = new byte[iReadLen];
+ buf.readBytes(testKeepaliveMsg, 0, iReadLen);
+
+ Assert.assertThat(testKeepaliveMsg, is(keepaliveMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepLabelUpdateMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepLabelUpdateMsgTest.java
new file mode 100644
index 00000000..d6ec350c
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepLabelUpdateMsgTest.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepLabelUpdateMsg;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+
+public class PcepLabelUpdateMsgTest {
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LSP, LABEL Object.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest1() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LSP, LABEL Object, LABEL Object.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest2() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x30, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-map> SRP, LABEL, FEC Object.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest3() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x24, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0B, 0x0B};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LSP, LABEL, LABEL, <pce-label-download> SRP, LSP, LABEL
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest4() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x02, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x44};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-map> SRP, LABEL, FEC, <pce-label-map> SRP, LABEL, FEC.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest5() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x44, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0B, 0x0B,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0C, 0x0C};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LSP, LABEL, LABEL, <pce-label-download> SRP, LABEL, FEC.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest6() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x12,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0D, 0x0D};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LABEL, FEC, <pce-label-download> SRP, LSP, LABEL, LABEL.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest7() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x50, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x12,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0D, 0x0D,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+
+ /**
+ * This test case checks for
+ * <pce-label-download> SRP, LABEL, FEC, <pce-label-download> SRP, LSP, LABEL, LABEL.
+ * <pce-label-download> SRP, LSP, LABEL, LABEL.
+ * in PcepLabelUpdate message.
+ */
+ @Test
+ public void labelUpdateMessageTest8() throws PcepParseException {
+
+ byte[] labelUpdate = new byte[]{0x20, 0x0D, 0x00, 0x7C, // common header
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x12,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x24, 0x10, 0x00, 0x08, // FEC Object Header
+ 0x0A, 0x0A, 0x0D, 0x0D,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77,
+ 0x21, 0x10, 0x00, 0x0C, // SRP Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x20, 0x10, 0x00, 0x08, // LSP Object Header
+ 0x00, 0x01, 0x00, 0x00,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x66,
+ 0x23, 0x10, 0x00, 0x0C, // LABEL Object Header
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x77};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(labelUpdate);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testLabelUpdateMsg = {0};
+
+ assertThat(message, instanceOf(PcepLabelUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testLabelUpdateMsg = new byte[readLen];
+ buf.readBytes(testLabelUpdateMsg, 0, readLen);
+
+ assertThat(testLabelUpdateMsg, is(labelUpdate));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4AdjacencyTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4AdjacencyTest.java
new file mode 100644
index 00000000..390f5738
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4AdjacencyTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PcepNaiIpv4Adjacency;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for PcepNaiIpv4Adjacency.
+ */
+public class PcepNaiIpv4AdjacencyTest {
+
+ private final PcepNaiIpv4Adjacency obj1 = PcepNaiIpv4Adjacency.of(2, 16);
+ private final PcepNaiIpv4Adjacency sameAsObj1 = PcepNaiIpv4Adjacency.of(2, 16);
+ private final PcepNaiIpv4Adjacency obj2 = PcepNaiIpv4Adjacency.of(3, 16);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(obj1, sameAsObj1).addEqualityGroup(obj2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4NodeIdTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4NodeIdTest.java
new file mode 100644
index 00000000..bcd69bea
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv4NodeIdTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PcepNaiIpv4NodeId;
+
+import com.google.common.testing.EqualsTester;
+
+public class PcepNaiIpv4NodeIdTest {
+
+ private final PcepNaiIpv4NodeId tlv1 = PcepNaiIpv4NodeId.of(1);
+ private final PcepNaiIpv4NodeId tlv2 = PcepNaiIpv4NodeId.of(1);
+ private final PcepNaiIpv4NodeId tlv3 = PcepNaiIpv4NodeId.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester()
+ .addEqualityGroup(tlv1, tlv2)
+ .addEqualityGroup(tlv3)
+ .testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6AdjacencyTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6AdjacencyTest.java
new file mode 100644
index 00000000..5b68193d
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6AdjacencyTest.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PcepNaiIpv6Adjacency;
+
+import com.google.common.testing.EqualsTester;
+
+public class PcepNaiIpv6AdjacencyTest {
+ private final byte[] localIpv6Addr1 = {(byte) 0x01010101 };
+ private final byte[] remoteIpv6Addr1 = {(byte) 0x02020202 };
+ private final byte[] localIpv6Addr2 = {(byte) 0x01010101 };
+ private final byte[] remoteIpv6Addr2 = {(byte) 0x02020202 };
+ private final byte[] localIpv6Addr3 = {(byte) 0x05050505 };
+ private final byte[] remoteIpv6Addr3 = {(byte) 0x06060606 };
+
+ private final PcepNaiIpv6Adjacency tlv1 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
+ private final PcepNaiIpv6Adjacency tlv2 = PcepNaiIpv6Adjacency.of(localIpv6Addr1, remoteIpv6Addr1);
+ private final PcepNaiIpv6Adjacency tlv3 = PcepNaiIpv6Adjacency.of(localIpv6Addr3, remoteIpv6Addr3);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6NodeIdTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6NodeIdTest.java
new file mode 100644
index 00000000..bf458940
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiIpv6NodeIdTest.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PcepNaiIpv6NodeId;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for PcepNaiIpv6NodeId.
+ */
+public class PcepNaiIpv6NodeIdTest {
+
+ private final byte[] b1 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x29, 0x00, 0x02,
+ 0x00, 0x00 };
+ private final byte[] b2 = new byte[] {(byte) 0xFE, (byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
+ (byte) 0xB3, (byte) 0xFF, (byte) 0xFE, 0x1E, (byte) 0x83, 0x30, 0x00, 0x02,
+ 0x00, 0x00 };
+
+ private final PcepNaiIpv6NodeId tlv1 = PcepNaiIpv6NodeId.of(b1);
+ private final PcepNaiIpv6NodeId sameAsTlv1 = PcepNaiIpv6NodeId.of(b1);
+ private final PcepNaiIpv6NodeId tlv2 = PcepNaiIpv6NodeId.of(b2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiUnnumberedAdjacencyIpv4Test.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiUnnumberedAdjacencyIpv4Test.java
new file mode 100644
index 00000000..d45bae8b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepNaiUnnumberedAdjacencyIpv4Test.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.PcepNaiUnnumberedAdjacencyIpv4;
+
+import com.google.common.testing.EqualsTester;
+
+public class PcepNaiUnnumberedAdjacencyIpv4Test {
+
+ private final int localNodeId1 = 1;
+ private final int localInterfaceId1 = 1;
+ private final int remoteNodeId1 = 1;
+ private final int remoteInterfaceId1 = 1;
+ private final PcepNaiUnnumberedAdjacencyIpv4 tlv1 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId1,
+ localInterfaceId1, remoteNodeId1, remoteInterfaceId1);
+
+ private final int localNodeId2 = 1;
+ private final int localInterfaceId2 = 1;
+ private final int remoteNodeId2 = 1;
+ private final int remoteInterfaceId2 = 1;
+ private final PcepNaiUnnumberedAdjacencyIpv4 tlv2 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId2,
+ localInterfaceId2, remoteNodeId2, remoteInterfaceId2);
+
+ private final int localNodeId3 = 2;
+ private final int localInterfaceId3 = 2;
+ private final int remoteNodeId3 = 2;
+ private final int remoteInterfaceId3 = 2;
+
+ private final PcepNaiUnnumberedAdjacencyIpv4 tlv3 = PcepNaiUnnumberedAdjacencyIpv4.of(localNodeId3,
+ localInterfaceId3, remoteNodeId3, remoteInterfaceId3);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepOpenMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepOpenMsgTest.java
new file mode 100644
index 00000000..1aff4962
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepOpenMsgTest.java
@@ -0,0 +1,562 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepOpenMsg;
+/**
+ * Test cases for PCEP OPEN Message.
+ */
+public class PcepOpenMsgTest {
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest1() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x10, 0x00, 0x20, 0x20, 0x1e, 0x78, (byte) 0xbd,
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV
+ 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY-TLV in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest2() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
+ 0x01, 0x10, 0x00, 0x10, // common object header
+ 0x20, 0x1E, 0x78, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f}; // STATEFUL-PCE-CAPABILITY
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with GmplsCapability tlv in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest3() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
+ 0x01, 0x10, 0x00, 0x10, // common object header
+ 0x20, 0x1E, 0x78, 0x01, // OPEN object
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; //GMPLS-CAPABILITY-TLV
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with StatefulLspDbVer Tlv in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest4() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x18,
+ 0x01, 0x10, 0x00, 0x14, 0x20, 0x1e, 0x78, 0x20,
+ 0x00, 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }; //StatefulLspDbVerTlv
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with no tlv's in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest5() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0C,
+ 0x01, 0x10, 0x00, 0x08, 0x20, 0x1e, 0x78, (byte) 0xbd }; // no Tlvs in open messsage
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV
+ * with I bit set in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest6() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x11, 0x00, 0x20, //p bit not set & i bit set
+ 0x20, 0x1e, 0x78, (byte) 0xbd,
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV
+ 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV
+ * with P bit set in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest7() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x12, 0x00, 0x20, //p bit set & i bit not set
+ 0x20, 0x1e, 0x78, (byte) 0xbd,
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV
+ 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV
+ * with P & I bits set in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest8() throws PcepParseException {
+
+ /* OPEN OBJECT (STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV)
+ with p bit set & i bit set.
+ */
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x13, 0x00, 0x20, //p bit set & i bit set
+ 0x20, 0x1e, 0x78, (byte) 0xbd,
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV
+ 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV, PCECC-CAPABILITY-TLV
+ * with P & I bits set and invalid session id in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest9() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, 0x01, 0x13, 0x00, 0x20, //p bit set & i bit set
+ 0x20, 0x1e, 0x78, 0x00, //invalid sessionID
+ 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, //STATEFUL-PCE-CAPABILITY
+ 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, //GMPLS-CAPABILITY-TLV
+ 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, //PCECC-CAPABILITY-TLV
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV
+ * in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest10() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1C, // common header
+ 0x01, 0x10, 0x00, 0x18, // common object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05,
+ 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV, TED Capability TLV in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest11() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x2C, // common header
+ 0x01, 0x10, 0x00, 0x28, // common object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x03, 0x00, (byte) 0x84, 0x00, 0x04, // TED Capability TLV
+ 0x00, 0x00, 0x00, 0x00 };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV,
+ * PCECC-CAPABILITY-TLV in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest12() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x24, // common header
+ 0x01, 0x10, 0x00, 0x20, // common object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // PCECC-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x03};
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY, GMPLS-CAPABILITY-TLV
+ * in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest13() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x1c, // common header
+ 0x01, 0x10, 0x00, 0x18, // common object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04, // GMPLS-CAPABILITY-TLV
+ 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with STATEFUL-PCE-CAPABILITY in Pcep Open message.
+ */
+ @Test
+ public void openMessageTest14() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x14, // common header
+ 0x01, 0x10, 0x00, 0x10, // common object header
+ 0x20, 0x05, 0x1E, 0x01, // OPEN object
+ 0x00, 0x10, 0x00, 0x04, // STATEFUL-PCE-CAPABILITY
+ 0x00, 0x00, 0x00, 0x05};
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+
+ /**
+ * This test case checks open object with no tlv Pcep Open message.
+ */
+ @Test
+ public void openMessageTest15() throws PcepParseException {
+
+ byte[] openMsg = new byte[] {0x20, 0x01, 0x00, 0x0c, // common header
+ 0x01, 0x10, 0x00, 0x08, // common object header
+ 0x20, 0x05, 0x1E, 0x01 // OPEN object
+ };
+
+ byte[] testOpenMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(openMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepOpenMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testOpenMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testOpenMsg = new byte[readLen];
+ buf.readBytes(testOpenMsg, 0, readLen);
+ assertThat(testOpenMsg, is(openMsg));
+
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgExtTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgExtTest.java
new file mode 100644
index 00000000..346caf87
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgExtTest.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepReportMsg;
+
+public class PcepReportMsgExtTest {
+
+ /**
+ * This test case checks forSRP Object,LSP Object(symbolic path tlv),ERO Object
+ * SRP Object,LSP Object(symbolic path tlv,ERO Object,LSPA Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest39() throws PcepParseException {
+
+ byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x98,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object
+ * SRP Object,LSP Object(symbolic path tlv),ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest40() throws PcepParseException {
+
+ byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object
+ * SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest41() throws PcepParseException {
+
+ byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x8c,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object,BandWidth Object,
+ * Metric-list SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object,BandWidth Object,Metric-list,
+ * RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest42() throws PcepParseException {
+
+ byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0xE8,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //symbolic path tlv
+ 0x07, 0x10, 0x00, 0x14, //ERO object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgTest.java
new file mode 100644
index 00000000..237e617f
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepReportMsgTest.java
@@ -0,0 +1,1601 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepReportMsg;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepReportMsgTest {
+
+ /**
+ * This test case checks for SRP object, LSP object(Symbolic path name tlv), ERO object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest1() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, 0x24,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x04}; //ERO Object
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object, LSP Object(StatefulIPv4LspIdentidiersTlv,SymbolicPathNameTlv
+ * StatefulLspErrorCodeTlv) ERO Object, LSPA Object, Metric-list, IRO object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest2() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object // LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00, // IPv4SubObjects
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, //Metric Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ };
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(StatefulIPv4LspIdentidiersTlv,SymbolicPathNameTlv,StatefulLspErrorCodeTlv)
+ * ERO Object, LSPA Object, Metric-list, IRO object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest3() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00, //Ipv4SubObjects
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, //Metric Objects
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ };
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(StatefulIPv4LspIdentidiersTlv,SymbolicPathNameTlv,StatefulLspErrorCodeTlv)
+ * ERO Object, LSPA Object, Metric-list
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest4() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object, LSP Object(StatefulIPv4LspIdentidiersTlv,SymbolicPathNameTlv
+ * StatefulLspErrorCodeTlv) ERO Object, IRO object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest5() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object, LSP Object(StatefulIPv4LspIdentidiersTlv,SymbolicPathNameTlv
+ * StatefulLspErrorCodeTlv) ERO Object, LSPA Object, Metric-list.
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest6() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x04, //ERO Object
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, //Metric object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ };
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object, ERO Object, LSPA Object, Metric-list, IRO object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest7() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, // Metric objects
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP object, LSP object( StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv) ERO object, LSPA object, Metric object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest8() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric Object
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,
+ * StatefulLspErrorCodeTlv ),ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest9() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(StatefulIPv4LspIdentidiersTlv)ERO Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest10() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(SymbolicPathNameTlv)ERO Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest11() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object, ERO Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest12() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(StatefulLspErrorCodeTlv)ERO Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest13() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(StatefulRsvpErrorSpecTlv),ERO Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest14() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),LSPA Object,ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest15() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x7C,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),BandWidth Object,ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest16() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object,ERO Object,LSPA Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest17() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object,ERO Object,BandWidth Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest18() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object,ERO Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest19() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6C,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object,ERO Object,LSPA Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest20() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x88,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,
+ * StatefulLspErrorCodeTlv ) ERO Object,LSPA Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest21() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xac,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * ERO Object,LSPA Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest22() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xA0,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * ERO Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest23() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * ERO Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest24() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x84,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * ERO Object,LSPA Object,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest25() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8c,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * ERO Object,LSPA Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest26() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x58,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv)
+ * ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest27() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x44,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for LSP Object(Symbolic path tlv, StatefulIPv4LspIdentidiersTlv,StatefulLspErrorCodeTlv )
+ * LSPA Object,BandWidth Object,Metric-list,ERO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest28() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x6c,
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest29() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x74,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,Metric-list,RRO Object
+ * SRP Object,LSP Object(symbolic path tlv),ERO Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest30() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xE4,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object
+ * BandWidth Object,Metric-list,RRO Object,SRP Object,LSP Object(symbolic path tlv)
+ * ERO Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest31() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object
+ * BandWidth Object,Metric-list,RRO Object,SRP Object,LSP Object(symbolic path tlv)
+ * ERO Object,LSPA Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest32() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x14,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path tlv),ERO Object,LSPA Object
+ * BandWidth Object,Metric-list,RRO Object,SRP Object,LSP Object(symbolic path tlv)
+ * ERO Object,LSPA Object,BandWidth Object,Metric-list,RRO Object
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest33() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x01, (byte) 0x1c,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x08, 0x10, 0x00, 0x34, 0x01, 0x08, 0x11, 0x01, //RRO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x06, 0x06,
+ 0x06, 0x06, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x05, 0x05, 0x05, 0x05, 0x04, 0x00};
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object(symbolic path Tlv),ERO Object,LSPA Object
+ * BandWidth Object,Metric-list,SRP Object,LSP Object(symbolic path tlv)
+ * ERO Object,LSPA Object,BandWidth Object,Metric-list
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest34() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0xB4,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric Object
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x04, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric Object
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+
+ /**
+ * This test case checks for SRP Object,LSP Object)Symbolic path tlv),ERO Object,SRP Object
+ * LSP Object(symbolic path tlv) ERO Object,LSPA Object, BandWidth Object,Metric-list
+ * in PcRpt message.
+ */
+ @Test
+ public void reportMessageTest35() throws PcepParseException {
+
+ byte[] reportMsg = new byte[]{0x20, 0x0a, 0x00, (byte) 0x8C,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x21, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, //SRP Object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP Object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, //ERO Object
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x04, 0x00,
+ 0x01, 0x08, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, //LSPA Object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth Object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric Object
+
+ byte[] testReportMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(reportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(reportMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepTEReportMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepTEReportMsgTest.java
new file mode 100644
index 00000000..b800e05e
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepTEReportMsgTest.java
@@ -0,0 +1,1600 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepTEReportMsg;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+public class PcepTEReportMsgTest {
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)).
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest1() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
+ 0x0E, 0x10, 0x00, 0x24, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystem Tlv
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * T E Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)) with different TE-ID.
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest2() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x28, // common header
+ 0x0E, 0x10, 0x00, 0x24, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x08, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for TE Object (Routing Universe TLV)
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest3() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x1c, // common header
+ 0x0E, 0x10, 0x00, 0x18, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
+ * OSPFareaIDsubTlv, RouterIDSubTlv)).
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest4() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x44, // common header
+ 0x0E, 0x10, 0x00, 0x40, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest5() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x3C, // common header
+ 0x0E, 0x10, 0x00, 0x38, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x1C, // Local TE Node Descriptors TLV
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(OSPFareaIDsubTlv,
+ * RouterIDSubTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest6() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x34, // common header
+ 0x0E, 0x10, 0x00, 0x30, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x14, // Local TE Node Descriptors TLV
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(RouterIDSubTlv)).
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest7() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x2C, // common header
+ 0x0E, 0x10, 0x00, 0x28, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x0C, // Local TE Node Descriptors TLV
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11};
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV)
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest8() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x20, // common header
+ 0x0E, 0x10, 0x00, 0x1C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x00 // Local TE Node Descriptors TLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
+ * OSPFareaIDsubTlv, RouterIDSubTlv)).
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest9() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x6C, // common header
+ 0x0E, 0x10, 0x00, 0x68, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest10() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x64, // common header
+ 0x0E, 0x10, 0x00, 0x60, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x1C, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(OSPFareaIDsubTlv, RouterIDSubTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest11() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x5C, // common header
+ 0x0E, 0x10, 0x00, 0x58, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x14, //RemoteTENodeDescriptorsTLV
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(RouterIDSubTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest12() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x54, // common header
+ 0x0E, 0x10, 0x00, 0x50, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x0c, //RemoteTENodeDescriptorsTLV
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV)
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest13() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, 0x48, // common header
+ 0x0E, 0x10, 0x00, 0x44, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x00, //RemoteTENodeDescriptorsTLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest14() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x8C, // common header
+ 0x0E, 0x10, 0x00, (byte) 0x88, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest15() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x80, // common header
+ 0x0E, 0x10, 0x00, (byte) 0x7C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x10, //TELinkDescriptorsTLV
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(IPv4NeighborAddressTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest16() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x78, // common header
+ 0x0E, 0x10, 0x00, (byte) 0x74, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x08, //TELinkDescriptorsTLV
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV)
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest17() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0x70, // common header
+ 0x0E, 0x10, 0x00, (byte) 0x6C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x00, //TELinkDescriptorsTLV
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest18() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
+ 0x0E, 0x10, 0x00, (byte) 0xbC, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
+ (byte) 0x90, 0x00, 0x00, 0x00,
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
+ * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest19() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xC0, // common header
+ 0x0E, 0x10, 0x00, (byte) 0xBC, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x30, //TENodeAttributesTlv
+ 0x00, 0x0E, 0x00, 0x01, //NodeFlagBitsTlv
+ (byte) 0x90, 0x00, 0x00, 0x00,
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
+ * NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest20() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xB8, // common header
+ 0x0E, 0x10, 0x00, (byte) 0xB4, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
+ * ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest21() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x00, (byte) 0xAC, // common header
+ 0x0E, 0x10, 0x00, (byte) 0xA8, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x1C, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv.
+ * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv).
+ * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv.
+ * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv.
+ * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv.
+ * OpaqueLinkAttributeTlv, LinkNameTlv)).
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest22() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x120, // common header
+ 0x0E, 0x10, 0x01, (byte) 0x1C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02,
+ 0x07, 0x69, 0x00, 0x64, //TELinkAttributesTlv
+ 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
+ 0x04, 0x49, 0x00, 0x04,
+ 0x04, 0x47, 0x00, 0x03,
+ 0x04, 0x4A, 0x00, 0x04, //LinkNameTlv
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
+ * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
+ * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
+ * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
+ * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv
+ * OpaqueLinkAttributeTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest23() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x118, // common header
+ 0x0E, 0x10, 0x01, (byte) 0x14, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02,
+ 0x07, 0x69, 0x00, 0x5C, //TELinkAttributesTlv
+ 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x04, 0x47, 0x00, 0x03, //OpaqueLinkAttributeTlv
+ 0x04, 0x49, 0x00, 0x04,
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
+ * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
+ * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
+ * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
+ * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest24() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x110, // common header
+ 0x0E, 0x10, 0x01, (byte) 0x0C, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02,
+ 0x07, 0x69, 0x00, 0x54, //TELinkAttributesTlv
+ 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
+ 0x09, (byte) 0x89, 0x07, 0x00,
+ 0x04, 0x48, 0x00, 0x08, //SharedRiskLinkGroupTlv
+ 0x04, 0x47, 0x00, 0x03,
+ 0x04, 0x47, 0x00, 0x03
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+
+ /**
+ * This test case checks for
+ * TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
+ * OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
+ * IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
+ * OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv)
+ * TELinkAttributesTlv(IPv4TERouterIdOfRemoteNodeTlv, IPv6TERouterIdofRemoteNodeTlv, AdministrativeGroupTlv
+ * MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
+ * LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv))
+ * in PcTERpt message.
+ */
+ @Test
+ public void teReportMessageTest25() throws PcepParseException {
+
+ byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x104, // common header
+ 0x0E, 0x10, 0x01, 0x00, // TE Object Header
+ 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, // TE-ID
+ 0x00, 0x0E, 0x00, 0x08, // Routing Universe TLV
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x65, 0x00, 0x24, // Local TE Node Descriptors TLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xEB, 0x00, 0x24, //RemoteTENodeDescriptorsTLV
+ 0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x11, 0x00, 0x04, //BGPLSidentifierTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x02, 0x58, 0x00, 0x04, //OSPFareaIDsubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x03, (byte) 0xE8, 0x00, 0x08, //RouterIDSubTlv
+ 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x11,
+ 0x04, 0x2E, 0x00, 0x1C, //TELinkDescriptorsTLV
+ 0x00, 0x04, 0x00, 0x08, //LinkLocalRemoteIdentifiersTlv
+ 0x01, 0x11, 0x00, 0x09,
+ 0x01, 0x21, 0x00, 0x09,
+ 0x00, 0x06, 0x00, 0x04, //IPv4InterfaceAddressTlv
+ 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x08, 0x00, 0x04, //IPv4NeighborAddressTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x04, (byte) 0xF3, 0x00, 0x28, //TENodeAttributesTlv
+ 0x03, (byte) 0xE9, 0x00, 0x04, //OpaqueNodeAttributeTlv
+ 0x01, 0x011, 0x01, 0x10,
+ 0x03, (byte) 0xEF, 0x00, 0x08, //NodeNameTlv
+ 0x08, 0x00, 0x01, 0x09,
+ 0x08, 0x00, 0x01, 0x09,
+ 0x00, 0x6B, 0x00, 0x08, //ISISAreaIdentifierTlv
+ 0x20, 0x01, 0x22, 0x01,
+ 0x20, 0x01, 0x22, 0x01,
+ 0x00, (byte) 0x86, 0x00, 0x04, //IPv4TERouterIdOfLocalNodeTlv
+ 0x00, 0x01, 0x01, 0x02,
+ 0x07, 0x69, 0x00, 0x48, //TELinkAttributesTlv
+ 0x05, 0x3C, 0x00, 0x04, //IPv4TERouterIdOfRemoteNodeTlv
+ 0x00, 0x07, 0x08, 0x00,
+ 0x00, 0x03, 0x00, 0x04, //AdministrativeGroupTlv
+ 0x00, 0x09, 0x08, 0x00,
+ 0x00, 0x09, 0x00, 0x04, //MaximumLinkBandwidthTlv
+ 0x00, 0x09, 0x00, 0x00,
+ 0x00, 0x0a, 0x00, 0x04, //MaximumReservableLinkBandwidthTlv
+ 0x00, 0x10, 0x00, 0x00,
+ 0x00, 0x0b, 0x00, 0x04, //UnreservedBandwidthTlv
+ 0x00, 0x00, (byte) 0x90, 0x00,
+ 0x34, 0x58, 0x00, 0x04, //TEDefaultMetricTlv
+ 0x00, (byte) 0x99, 0x09, 0x00,
+ 0x00, 0x14, 0x00, 0x02, //LinkProtectionTypeTlv
+ 0x09, 0x00, 0x00, 0x00,
+ 0x04, 0x46, 0x00, 0x01, //MPLSProtocolMaskTlv
+ (byte) 0x80, 0x00, 0x00, 0x00,
+ 0x04, 0x47, 0x00, 0x03, //IGPMetricTlv
+ 0x09, (byte) 0x89, 0x07, 0x00
+ };
+
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(teReportMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ byte[] testReportMsg = {0};
+
+ assertThat(message, instanceOf(PcepTEReportMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+
+ int readLen = buf.writerIndex();
+ testReportMsg = new byte[readLen];
+ buf.readBytes(testReportMsg, 0, readLen);
+
+ assertThat(testReportMsg, is(teReportMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgExtTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgExtTest.java
new file mode 100644
index 00000000..1f956173
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgExtTest.java
@@ -0,0 +1,1275 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.Matchers.instanceOf;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepUpdateMsg;
+
+/**
+ * Test cases for PCEP update message.
+ */
+public class PcepUpdateMsgExtTest {
+
+ /**
+ * This test case is for SRP object(symbolic path tlv), LSP object(StatefulLspDbVerTlv), ERO object,
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest1() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x8c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x38, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulIPv4LspIdentidiersTlv), ERO object,
+ * LSPA, Bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest2() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSP object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object, ERO object, LSPA, bandwidth object
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest3() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspErrorCodeTlv), ERO object,bandwidth object
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest4() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspDbVerTlv), ERO object,bandwidth object
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest5() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(SymbolicPathNameTlv), ERO object, LSPA, bandwidth object
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest6() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(SymbolicPathNameTlv), ERO object,
+ * bandwidth object Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest7() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulIPv4LspIdentidiersTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest8() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulRsvpErrorSpecTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest9() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x18, 0x00, 0x00, 0x10, 0x03,
+ 0x00, 0x15, 0x00, 0x0c, //StatefulRsvpErrorSpecTlv
+ 0x00, 0x0c, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x05,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulRsvpErrorSpecTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest10() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPa object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspDbVerTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest11() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(SymbolicPathNameTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest12() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(SymbolicPathNameTlv), ERO object,LSPA
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest13() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulIPv4LspIdentidiersTlv), ERO object,LSPA
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest14() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object, ERO object,LSPA
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest15() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //lspa object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspErrorCodeTlv), ERO object,LSPA
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest16() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspDbVerTlv), ERO object,LSPA
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest17() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(SymbolicPathNameTlv), ERO object,LSPA
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest18() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(SymbolicPathNameTlv), ERO object,
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest19() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulIPv4LspIdentidiersTlv), ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest20() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object, ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest21() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspErrorCodeTlv), ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest22() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspDbVerTlv), ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest23() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(SymbolicPathNameTlv), ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest24() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(SymbolicPathNameTlv), ERO object,
+ * Bandwidth , metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest25() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulIPv4LspIdentidiersTlv), ERO object,
+ * LSPA object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest26() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object, ERO object,
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest27() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x34,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object, LSP object(StatefulLspErrorCodeTlv), ERO object,
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest28() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(StatefulLspErrorCodeTlv), ERO object,
+ * lspa object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest29() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(StatefulLspErrorCodeTlv), ERO object,
+ * bandwidth object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest30() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(SymbolicPathNameTlv), LSP object(StatefulLspErrorCodeTlv), ERO object,
+ * metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest31() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case is for SRP object(symbolic path tlv), LSP object(StatefulLspDbVerTlv), ERO object,
+ * Metric object in PcepUpdate message.
+ */
+ @Test
+ public void pcepUpdateMsgTest32() throws PcepParseException {
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x14, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x17, 0x00, 0x08, //StatefulLspDbVerTlv
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO Object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+}
+
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgTest.java
new file mode 100644
index 00000000..e965bfeb
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/PcepUpdateMsgTest.java
@@ -0,0 +1,1427 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.core.Is.is;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import static org.hamcrest.MatcherAssert.assertThat;
+import org.junit.Test;
+import org.onosproject.pcepio.exceptions.PcepParseException;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepMessageReader;
+import org.onosproject.pcepio.protocol.PcepUpdateMsg;
+
+public class PcepUpdateMsgTest {
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), ERO in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest1() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x30,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, //StatefulIPv4LspIdentidiersTlv
+ 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x04 }; //ERO object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP(SymbolicPathNameTlv), LSP (StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO, LSPA, Metric-list in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest2() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x94,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object // lsp object
+ 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, //StatefulIPv4LspIdentidiersTlv
+ 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x24, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01,
+ 0x01, 0x02, 0x04, 0x00, 0x01, 0x08, 0x12, 0x01, 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
+ * ERO objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest3() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x38,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x04 }; //ERO object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv), ERO objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest4() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x04 }; //ERO object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv), ERO objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest5() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x40,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x04 }; //ERO object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest6() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x04 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest7() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x04}; //ERO object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject) objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest8() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x50,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x0c, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject) objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest9() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest10() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x6c,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest11() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest12() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest13() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric Object objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest14() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest15() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),LSPA, metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest16() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x60,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),LSPA objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest17() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1c, 0x00, 0x00, 0x10, 0x05, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00 };
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest18() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x4c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject),Metric-list objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest19() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x58,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20, //Metric object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv),ERO (IPv4SubObject, IPv4SubObject),LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest20() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), Bandwidth objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest21() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x48,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest22() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5C,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 }; //Bandwidth object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest23() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest24() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest25() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x70,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x24, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv) ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth,
+ * Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest26() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
+ * StatefulLspErrorCodeTlv) ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth,
+ * Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest27() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x78,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
+ * SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),
+ * LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest28() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest29() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x68,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
+ (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP,
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest30() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x08, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20}; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (StatefulLspErrorCodeTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest31() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP,
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest32() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x54,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x8, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest33() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x5c,
+ 0x21, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+
+ /**
+ * This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
+ * ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message.
+ */
+ @Test
+ public void pcepUpdateMsgTest34() throws PcepParseException {
+
+ byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x64,
+ 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x20, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x03, //LSP object
+ 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
+ 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
+ 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
+ 0x01, 0x01, 0x04, 0x00,
+ 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
+ 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
+ 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
+
+ byte[] testupdateMsg = {0};
+ ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ buffer.writeBytes(updateMsg);
+
+ PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
+ PcepMessage message = null;
+
+ message = reader.readFrom(buffer);
+
+ assertThat(message, instanceOf(PcepUpdateMsg.class));
+ ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ message.writeTo(buf);
+ testupdateMsg = buf.array();
+
+ int readLen = buf.writerIndex() - 0;
+ testupdateMsg = new byte[readLen];
+ buf.readBytes(testupdateMsg, 0, readLen);
+
+ assertThat(testupdateMsg, is(updateMsg));
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RemoteTENodeDescriptorsTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RemoteTENodeDescriptorsTlvTest.java
new file mode 100644
index 00000000..3b189c0b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RemoteTENodeDescriptorsTlvTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.AutonomousSystemTlv;
+import org.onosproject.pcepio.types.BGPLSidentifierTlv;
+import org.onosproject.pcepio.types.PcepValueType;
+import org.onosproject.pcepio.types.RemoteTENodeDescriptorsTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Remote TE Node Descriptors tlv.
+ */
+public class RemoteTENodeDescriptorsTlvTest {
+
+ private final AutonomousSystemTlv autonomousSystemTlv1 = new AutonomousSystemTlv(10);
+ private final BGPLSidentifierTlv bGPLSidentifierTlv1 = new BGPLSidentifierTlv(20);
+
+ private final AutonomousSystemTlv autonomousSystemTlv2 = new AutonomousSystemTlv(20);
+ private final BGPLSidentifierTlv bGPLSidentifierTlv2 = new BGPLSidentifierTlv(30);
+
+ private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV1 = new LinkedList<>();
+ private final boolean a = llRemoteTENodeDescriptorSubTLV1.add(autonomousSystemTlv1);
+ private final boolean b = llRemoteTENodeDescriptorSubTLV1.add(bGPLSidentifierTlv1);
+
+ private final LinkedList<PcepValueType> llRemoteTENodeDescriptorSubTLV2 = new LinkedList<>();
+ private final boolean c = llRemoteTENodeDescriptorSubTLV2.add(autonomousSystemTlv2);
+ private final boolean d = llRemoteTENodeDescriptorSubTLV2.add(bGPLSidentifierTlv2);
+
+ private final RemoteTENodeDescriptorsTlv tlv1 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
+ private final RemoteTENodeDescriptorsTlv sameAsTlv1 =
+ RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV1);
+ private final RemoteTENodeDescriptorsTlv tlv2 = RemoteTENodeDescriptorsTlv.of(llRemoteTENodeDescriptorSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RouterIDSubTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RouterIDSubTlvTest.java
new file mode 100644
index 00000000..022fd414
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RouterIDSubTlvTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.RouterIDSubTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Router ID Sub tlv.
+ */
+public class RouterIDSubTlvTest {
+
+ private final byte[] value1 = {1, 2 };
+ private final Short length1 = 2;
+ private final RouterIDSubTlv tlv1 = RouterIDSubTlv.of(value1, length1);
+
+ private final Short length2 = 2;
+ private final RouterIDSubTlv tlv2 = RouterIDSubTlv.of(value1, length2);
+
+ private final byte[] value3 = {1, 2, 3 };
+ private final Short length3 = 3;
+ private final RouterIDSubTlv tlv3 = RouterIDSubTlv.of(value3, length3);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RoutingUniverseTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RoutingUniverseTlvTest.java
new file mode 100644
index 00000000..9b119c90
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/RoutingUniverseTlvTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.RoutingUniverseTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Equality test for RoutingUniverseTlv.
+ */
+public class RoutingUniverseTlvTest {
+
+ private final RoutingUniverseTlv tlv1 = RoutingUniverseTlv.of(2);
+ private final RoutingUniverseTlv tlv2 = RoutingUniverseTlv.of(2);
+ private final RoutingUniverseTlv tlv3 = RoutingUniverseTlv.of(3);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SharedRiskLinkGroupTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SharedRiskLinkGroupTlvTest.java
new file mode 100644
index 00000000..ad62f61b
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SharedRiskLinkGroupTlvTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.SharedRiskLinkGroupTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Shared Risk Link Group tlv.
+ */
+public class SharedRiskLinkGroupTlvTest {
+
+ private final int[] raw = {1 };
+ private final Short hLength = 2;
+ private final SharedRiskLinkGroupTlv tlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
+
+ private final SharedRiskLinkGroupTlv sameAsTlv1 = SharedRiskLinkGroupTlv.of(raw, hLength);
+
+ private final int[] raw2 = {2 };
+ private final Short hLength2 = 3;
+ private final SharedRiskLinkGroupTlv tlv2 = SharedRiskLinkGroupTlv.of(raw2, hLength2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SrEroSubObjectTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SrEroSubObjectTest.java
new file mode 100644
index 00000000..47ea5842
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SrEroSubObjectTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.protocol.PcepNai;
+import org.onosproject.pcepio.types.SrEroSubObject;
+
+import com.google.common.testing.EqualsTester;
+
+public class SrEroSubObjectTest {
+
+ private final boolean bFFlag = false;
+ private final boolean bSFlag = false;
+ private final boolean bCFlag = false;
+ private final boolean bMFlag = false;
+ private final byte st = 1;
+ private final int sID = 1;
+ private final PcepNai nai = null;
+
+ private final SrEroSubObject tlv1 = SrEroSubObject.of(st, bFFlag, bSFlag, bCFlag, bMFlag, sID, nai);
+
+ private final boolean bFFlag1 = false;
+ private final boolean bSFlag1 = false;
+ private final boolean bCFlag1 = false;
+ private final boolean bMFlag1 = false;
+ private final byte st1 = 1;
+ private final int sID1 = 1;
+ private final PcepNai nai1 = null;
+
+ private final SrEroSubObject tlv2 = SrEroSubObject.of(st1, bFFlag1, bSFlag1, bCFlag1, bMFlag1, sID1, nai1);
+
+ private final boolean bFFlag2 = true;
+ private final boolean bSFlag2 = true;
+ private final boolean bCFlag2 = true;
+ private final boolean bMFlag2 = true;
+ private final byte st2 = 2;
+ private final int sID2 = 2;
+ private final PcepNai nai2 = null;
+
+ private final SrEroSubObject tlv3 = SrEroSubObject.of(st2, bFFlag2, bSFlag2, bCFlag2, bMFlag2, sID2, nai2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulIPv4LspIdentidiersTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulIPv4LspIdentidiersTlvTest.java
new file mode 100644
index 00000000..f03c8ba3
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulIPv4LspIdentidiersTlvTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.StatefulIPv4LspIdentidiersTlv;
+
+import com.google.common.testing.EqualsTester;
+
+public class StatefulIPv4LspIdentidiersTlvTest {
+
+ private final int ipv4IngressAddress = 1;
+ private final short lspId = 1;
+ private final short tunnelId = 1;
+ private final int extendedTunnelId = 1;
+ private final int ipv4EgressAddress = 1;
+
+ private final StatefulIPv4LspIdentidiersTlv tlv1 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress, lspId,
+ tunnelId, extendedTunnelId, ipv4EgressAddress);
+
+ private final int ipv4IngressAddress1 = 1;
+ private final short lspId1 = 1;
+ private final short tunnelId1 = 1;
+ private final int extendedTunnelId1 = 1;
+ private final int ipv4EgressAddress1 = 1;
+
+ private final StatefulIPv4LspIdentidiersTlv tlv2 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress1, lspId1,
+ tunnelId1, extendedTunnelId1, ipv4EgressAddress1);
+
+ private final int ipv4IngressAddress2 = 2;
+ private final short lspId2 = 2;
+ private final short tunnelId2 = 2;
+ private final int extendedTunnelId2 = 2;
+ private final int ipv4EgressAddress2 = 2;
+
+ private final StatefulIPv4LspIdentidiersTlv tlv3 = StatefulIPv4LspIdentidiersTlv.of(ipv4IngressAddress2, lspId2,
+ tunnelId2, extendedTunnelId2, ipv4EgressAddress2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspDbVerTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspDbVerTlvTest.java
new file mode 100644
index 00000000..21bb3468
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspDbVerTlvTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.StatefulLspDbVerTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Stateful Lsp Db Ver tlv.
+ */
+public class StatefulLspDbVerTlvTest {
+
+ private final StatefulLspDbVerTlv tlv1 = StatefulLspDbVerTlv.of(1);
+ private final StatefulLspDbVerTlv tlv2 = StatefulLspDbVerTlv.of(1);
+ private final StatefulLspDbVerTlv tlv3 = StatefulLspDbVerTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspErrorCodeTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspErrorCodeTlvTest.java
new file mode 100644
index 00000000..8137ca0c
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulLspErrorCodeTlvTest.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.StatefulLspErrorCodeTlv;
+import com.google.common.testing.EqualsTester;
+
+public class StatefulLspErrorCodeTlvTest {
+
+ private final StatefulLspErrorCodeTlv tlv1 = StatefulLspErrorCodeTlv.of(1);
+ private final StatefulLspErrorCodeTlv tlv2 = StatefulLspErrorCodeTlv.of(1);
+ private final StatefulLspErrorCodeTlv tlv3 = StatefulLspErrorCodeTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulPceCapabilityTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulPceCapabilityTlvTest.java
new file mode 100644
index 00000000..29018d55
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/StatefulPceCapabilityTlvTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.StatefulPceCapabilityTlv;
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Stateful Pce Capability tlv.
+ */
+public class StatefulPceCapabilityTlvTest {
+
+ private final StatefulPceCapabilityTlv tlv1 = StatefulPceCapabilityTlv.of(1);
+ private final StatefulPceCapabilityTlv tlv2 = StatefulPceCapabilityTlv.of(1);
+ private final StatefulPceCapabilityTlv tlv3 = StatefulPceCapabilityTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SymbolicPathNameTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SymbolicPathNameTlvTest.java
new file mode 100644
index 00000000..718bbb66
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/SymbolicPathNameTlvTest.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.SymbolicPathNameTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for Symbolic path tlv.
+ */
+public class SymbolicPathNameTlvTest {
+
+ private final byte[] value1 = {0x41 };
+ private final Short length1 = 2;
+ private final SymbolicPathNameTlv tlv1 = SymbolicPathNameTlv.of(value1, length1);
+
+ private final byte[] value2 = {0x41 };
+ private final Short length2 = 2;
+ private final SymbolicPathNameTlv tlv2 = SymbolicPathNameTlv.of(value1, length2);
+
+ private final byte[] value3 = {0x41, 0x43 };
+ private final Short length3 = 3;
+ private final SymbolicPathNameTlv tlv3 = SymbolicPathNameTlv.of(value3, length3);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TEDefaultMetricTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TEDefaultMetricTlvTest.java
new file mode 100644
index 00000000..32fa0af8
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TEDefaultMetricTlvTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.TEDefaultMetricTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for TE Default Metric tlv.
+ */
+public class TEDefaultMetricTlvTest {
+
+ private final TEDefaultMetricTlv tlv1 = TEDefaultMetricTlv.of(1);
+ private final TEDefaultMetricTlv tlv2 = TEDefaultMetricTlv.of(1);
+ private final TEDefaultMetricTlv tlv3 = TEDefaultMetricTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkAttributesTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkAttributesTlvTest.java
new file mode 100644
index 00000000..1e2101a9
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkAttributesTlvTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.AdministrativeGroupTlv;
+import org.onosproject.pcepio.types.MaximumReservableLinkBandwidthTlv;
+import org.onosproject.pcepio.types.PcepValueType;
+import org.onosproject.pcepio.types.TELinkAttributesTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for TE Link Attribute Tlv.
+ */
+public class TELinkAttributesTlvTest {
+
+ private final AdministrativeGroupTlv administrativeGroupTlv1 = new AdministrativeGroupTlv(10);
+ private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv1 =
+ new MaximumReservableLinkBandwidthTlv(20);
+
+ private final AdministrativeGroupTlv administrativeGroupTlv2 = new AdministrativeGroupTlv(20);
+ private final MaximumReservableLinkBandwidthTlv maximumReservableLinkBandwidthTlv2 =
+ new MaximumReservableLinkBandwidthTlv(30);
+
+ private final LinkedList<PcepValueType> llLinkAttributesSubTLV1 = new LinkedList<>();
+ private final boolean a = llLinkAttributesSubTLV1.add(administrativeGroupTlv1);
+ private final boolean b = llLinkAttributesSubTLV1.add(maximumReservableLinkBandwidthTlv1);
+
+ private final LinkedList<PcepValueType> llLinkAttributesSubTLV2 = new LinkedList<>();
+
+ private final boolean c = llLinkAttributesSubTLV2.add(administrativeGroupTlv2);
+ private final boolean d = llLinkAttributesSubTLV2.add(maximumReservableLinkBandwidthTlv2);
+
+ private final TELinkAttributesTlv tlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
+ private final TELinkAttributesTlv sameAsTlv1 = TELinkAttributesTlv.of(llLinkAttributesSubTLV1);
+ private final TELinkAttributesTlv tlv2 = TELinkAttributesTlv.of(llLinkAttributesSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkDescriptorsTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkDescriptorsTlvTest.java
new file mode 100644
index 00000000..89565b3f
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TELinkDescriptorsTlvTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4InterfaceAddressTlv;
+import org.onosproject.pcepio.types.LinkLocalRemoteIdentifiersTlv;
+import org.onosproject.pcepio.types.PcepValueType;
+import org.onosproject.pcepio.types.TELinkDescriptorsTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for TE link descriptors Tlv.
+ */
+public class TELinkDescriptorsTlvTest {
+ private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv1 = new
+ LinkLocalRemoteIdentifiersTlv(10, 10);
+ private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv1 = new IPv4InterfaceAddressTlv(0x01010101);
+
+ private final LinkLocalRemoteIdentifiersTlv linkLocalRemoteIdentifiersTlv2 = new
+ LinkLocalRemoteIdentifiersTlv(20, 20);
+ private final IPv4InterfaceAddressTlv iPv4InterfaceAddressTlv2 = new IPv4InterfaceAddressTlv(0x02020202);
+
+ private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs1 = new LinkedList<>();
+ private final boolean a = llLinkDescriptorsSubTLVs1.add(linkLocalRemoteIdentifiersTlv1);
+ private final boolean b = llLinkDescriptorsSubTLVs1.add(iPv4InterfaceAddressTlv1);
+
+ private final LinkedList<PcepValueType> llLinkDescriptorsSubTLVs2 = new LinkedList<>();
+ private final boolean c = llLinkDescriptorsSubTLVs2.add(linkLocalRemoteIdentifiersTlv2);
+ private final boolean d = llLinkDescriptorsSubTLVs2.add(iPv4InterfaceAddressTlv2);
+
+ private final TELinkDescriptorsTlv tlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
+ private final TELinkDescriptorsTlv sameAstlv1 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs1);
+ private final TELinkDescriptorsTlv tlv2 = TELinkDescriptorsTlv.of(llLinkDescriptorsSubTLVs2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAstlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TENodeAttributesTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TENodeAttributesTlvTest.java
new file mode 100644
index 00000000..17d44091
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TENodeAttributesTlvTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.IPv4TERouterIdOfLocalNodeTlv;
+import org.onosproject.pcepio.types.NodeFlagBitsTlv;
+import org.onosproject.pcepio.types.PcepValueType;
+import org.onosproject.pcepio.types.TENodeAttributesTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for TE Node Attribute tlv.
+ */
+public class TENodeAttributesTlvTest {
+
+ private final NodeFlagBitsTlv nodeFlagBitsTlv1 = new NodeFlagBitsTlv((byte) 10);
+ private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv1 = new
+ IPv4TERouterIdOfLocalNodeTlv(0x01010101);
+
+ private final NodeFlagBitsTlv nodeFlagBitsTlv2 = new NodeFlagBitsTlv((byte) 20);
+ private final IPv4TERouterIdOfLocalNodeTlv iPv4TERouterIdOfLocalNodeTlv2 = new
+ IPv4TERouterIdOfLocalNodeTlv(0x02020202);
+
+ private final LinkedList<PcepValueType> llNodeAttributesSubTLV1 = new LinkedList<>();
+ private final boolean a = llNodeAttributesSubTLV1.add(nodeFlagBitsTlv1);
+ private final boolean b = llNodeAttributesSubTLV1.add(iPv4TERouterIdOfLocalNodeTlv1);
+
+ private final LinkedList<PcepValueType> llNodeAttributesSubTLV2 = new LinkedList<>();
+
+ private final boolean c = llNodeAttributesSubTLV2.add(nodeFlagBitsTlv2);
+ private final boolean d = llNodeAttributesSubTLV2.add(iPv4TERouterIdOfLocalNodeTlv2);
+
+ private final TENodeAttributesTlv tlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
+ private final TENodeAttributesTlv sameAsTlv1 = TENodeAttributesTlv.of(llNodeAttributesSubTLV1);
+ private final TENodeAttributesTlv tlv2 = TENodeAttributesTlv.of(llNodeAttributesSubTLV2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, sameAsTlv1).addEqualityGroup(tlv2).testEquals();
+ }
+
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TedCapabilityTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TedCapabilityTlvTest.java
new file mode 100644
index 00000000..4e18e867
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/TedCapabilityTlvTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.TedCapabilityTlv;
+
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Test case for TED Capability tlv.
+ */
+public class TedCapabilityTlvTest {
+
+ private final TedCapabilityTlv tlv1 = TedCapabilityTlv.of(1);
+ private final TedCapabilityTlv tlv2 = TedCapabilityTlv.of(1);
+ private final TedCapabilityTlv tlv3 = TedCapabilityTlv.of(2);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+}
diff --git a/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/UnreservedBandwidthTlvTest.java b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/UnreservedBandwidthTlvTest.java
new file mode 100644
index 00000000..e4cb9b15
--- /dev/null
+++ b/framework/src/onos/pcep/pcepio/src/test/java/org/onosproject/pcepio/UnreservedBandwidthTlvTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.pcepio;
+
+import org.junit.Test;
+import org.onosproject.pcepio.types.UnreservedBandwidthTlv;
+import com.google.common.testing.EqualsTester;
+
+/**
+ * Unit Test case for Unreserved Bandwidth Tlv.
+ */
+public class UnreservedBandwidthTlvTest {
+
+ // Objects of unreserved bandwidth tlv
+ private final UnreservedBandwidthTlv tlv1 = UnreservedBandwidthTlv.of(100);
+ private final UnreservedBandwidthTlv tlv2 = UnreservedBandwidthTlv.of(100);
+ private final UnreservedBandwidthTlv tlv3 = UnreservedBandwidthTlv.of(200);
+
+ @Test
+ public void basics() {
+ new EqualsTester().addEqualityGroup(tlv1, tlv2).addEqualityGroup(tlv3).testEquals();
+ }
+
+}