SureshBR
Committed by Gerrit Code Review

UT for Pcep TE Report updated with assertThat

Change-Id: Iba408ef8fe321c9b7bdf3b5a5fb9f66f02c9ffa7
......@@ -17,7 +17,6 @@ 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;
......@@ -25,26 +24,28 @@ 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.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest1() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x28, // common header
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, 0x0C, // Local TE Node Descriptors TLV
0x00, 0x64, 0x00, 0x04, //AutonomousSystem Tlv
0x00, 0x00, 0x00, 0x11 };
0x00, 0x00, 0x00, 0x11};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(teReportMsg);
......@@ -55,35 +56,34 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
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.
* T E Object (Routing Universe TLV, Local TE Node Descriptors TLV(AutonomousSystemTlv)) with different TE-ID.
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest2() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x28, // common header
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, 0x0C, // Local TE Node Descriptors TLV
0x00, 0x64, 0x00, 0x04, //AutonomousSystemTlv
0x00, 0x00, 0x00, 0x11 };
0x00, 0x00, 0x00, 0x11};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(teReportMsg);
......@@ -94,31 +94,29 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
* This test case checks for TE Object (Routing Universe TLV)
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest3() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x1c, // common header
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 };
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(teReportMsg);
......@@ -129,15 +127,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -145,13 +143,11 @@ public class PcepTEReportMsgTest {
* TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv.
* OSPFareaIDsubTlv, RouterIDSubTlv)).
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest4() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x44, // common header
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
......@@ -177,15 +173,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -193,13 +189,11 @@ public class PcepTEReportMsgTest {
* TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest5() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x3C, // common header
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
......@@ -223,28 +217,26 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
* This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(OSPFareaIDsubTlv,
* RouterIDSubTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest6() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x34, // common header
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
......@@ -266,27 +258,25 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
* This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(RouterIDSubTlv)).
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest7() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x2C, // common header
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
......@@ -306,27 +296,25 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
* This test case checks for TE Object (Routing Universe TLV,Local TE Node Descriptors TLV)
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest8() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x20, // common header
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
......@@ -344,15 +332,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -361,13 +349,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv.
* OSPFareaIDsubTlv, RouterIDSubTlv)).
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest9() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x6C, // common header
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
......@@ -404,15 +390,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -421,13 +407,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest10() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x64, // common header
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
......@@ -462,15 +446,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -478,13 +462,11 @@ public class PcepTEReportMsgTest {
* TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(OSPFareaIDsubTlv, RouterIDSubTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest11() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x5C, // common header
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
......@@ -517,15 +499,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -533,13 +515,11 @@ public class PcepTEReportMsgTest {
* TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(RouterIDSubTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest12() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x54, // common header
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
......@@ -570,15 +550,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -586,13 +566,11 @@ public class PcepTEReportMsgTest {
* TE Object (Routing Universe TLV,Local TE Node Descriptors TLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV)
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest13() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, 0x48, // common header
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
......@@ -620,15 +598,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -638,13 +616,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest14() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0x8C, // common header
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
......@@ -689,15 +665,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -707,13 +683,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest15() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0x80, // common header
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
......@@ -755,15 +729,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -772,13 +746,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(IPv4NeighborAddressTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest16() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0x78, // common header
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
......@@ -818,15 +790,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -835,13 +807,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV)
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest17() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0x70, // common header
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
......@@ -879,15 +849,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -897,13 +867,11 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest18() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0xC0, // common header
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
......@@ -961,15 +929,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -980,13 +948,11 @@ public class PcepTEReportMsgTest {
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(NodeFlagBitsTlv
* OpaqueNodeAttributeTlv, NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest19() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0xC0, // common header
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
......@@ -1044,15 +1010,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1061,15 +1027,13 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
* NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
* NodeNameTlv, ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest20() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0xB8, // common header
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
......@@ -1125,15 +1089,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1142,15 +1106,13 @@ public class PcepTEReportMsgTest {
* OSPFareaIDsubTlv, RouterIDSubTlv), RemoteTENodeDescriptorsTLV(AutonomousSystemTlv, BGPLSidentifierTlv
* OSPFareaIDsubTlv, RouterIDSubTlv), TELinkDescriptorsTLV(LinkLocalRemoteIdentifiersTlv.
* IPv4InterfaceAddressTlv, IPv4NeighborAddressTlv), TENodeAttributesTlv(OpaqueNodeAttributeTlv
* ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
* ISISAreaIdentifierTlv, IPv4TERouterIdOfLocalNodeTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest21() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x00, (byte) 0xAC, // common header
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
......@@ -1203,15 +1165,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1226,13 +1188,11 @@ public class PcepTEReportMsgTest {
* LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv.
* OpaqueLinkAttributeTlv, LinkNameTlv)).
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest22() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x01, (byte) 0x20, // common header
byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x20, // 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
......@@ -1314,15 +1274,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1337,13 +1297,11 @@ public class PcepTEReportMsgTest {
* LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv
* OpaqueLinkAttributeTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest23() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x01, (byte) 0x18, // common header
byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x18, // 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
......@@ -1423,15 +1381,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1445,13 +1403,11 @@ public class PcepTEReportMsgTest {
* MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
* LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv:, SharedRiskLinkGroupTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest24() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x01, (byte) 0x10, // common header
byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, (byte) 0x10, // 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
......@@ -1529,15 +1485,15 @@ public class PcepTEReportMsgTest {
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
/**
......@@ -1551,13 +1507,11 @@ public class PcepTEReportMsgTest {
* MaximumLinkBandwidthTlv, MaximumReservableLinkBandwidthTlv, UnreservedBandwidthTlv, TEDefaultMetricTlv
* LinkProtectionTypeTlv, MPLSProtocolMaskTlv, IGPMetricTlv))
* in PcTERpt message.
*
* @throws PcepParseException while parsing PCEP message
*/
@Test
public void teReportMessageTest25() throws PcepParseException {
byte[] teReportMsg = new byte[] {0x20, 0x0E, 0x01, 0x04, // common header
byte[] teReportMsg = new byte[]{0x20, 0x0E, 0x01, 0x04, // 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
......@@ -1633,14 +1587,14 @@ public class PcepTEReportMsgTest {
byte[] testReportMsg = {0};
Assert.assertTrue("PcepMessage is not instance of PcTERpt", message instanceof PcepTEReportMsg);
assertThat(message, instanceOf(PcepTEReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex() - 0;
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
Assert.assertArrayEquals("PcTERpt messages are not equal", teReportMsg, testReportMsg);
assertThat(testReportMsg, is(teReportMsg));
}
}
......