Phaneendra Manda
Committed by Gerrit Code Review

PcIntiateMsg UT updated for adding javadoc, remove log and if check

Change-Id: Ie15db6bd2af729091779b186f1c84e2b411ab058
......@@ -15,13 +15,9 @@
*/
package org.onosproject.pcepio;
import java.util.Arrays;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepFactories;
......@@ -35,16 +31,10 @@ public class PcepInitiateMsgTest {
protected static final Logger log = LoggerFactory.getLogger(PcepInitiateMsgTest.class);
@Before
public void startUp() {
}
@After
public void tearDown() {
}
/**
* This test case checks for srp, lsp, end-point, ERO objects in PcInitiate message.
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest1() throws PcepParseException {
......@@ -68,13 +58,12 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -83,19 +72,15 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PCInitiate messages are not equal ", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp and lsp objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest2() throws PcepParseException {
/* srp, lsp.
......@@ -114,13 +99,12 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -129,19 +113,17 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate(with R flag set) messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS, ERO objects
* in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest3() throws PcepParseException {
......@@ -168,13 +150,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -183,19 +163,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspErrorCodeTlv), END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest4() throws PcepParseException {
......@@ -222,13 +199,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -237,19 +212,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
* END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest5() throws PcepParseException {
......@@ -275,13 +247,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -290,19 +260,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv),
* END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest6() throws PcepParseException {
......@@ -328,13 +295,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -343,19 +308,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest7() throws PcepParseException {
......@@ -380,13 +342,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -395,19 +355,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest8() throws PcepParseException {
......@@ -431,13 +388,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -446,19 +401,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv),
* END-POINT, ERO objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest9() throws PcepParseException {
......@@ -480,13 +432,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -495,19 +445,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, StatefulRsvpErrorSpecTlv)
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest10() throws PcepParseException {
......@@ -529,13 +476,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -544,19 +489,16 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspErrorCodeTlv) objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest11() throws PcepParseException {
......@@ -578,13 +520,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -593,19 +533,17 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate(with R flag set) messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest12() throws PcepParseException {
......@@ -626,13 +564,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -641,19 +577,16 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate(with R flag set) messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv)
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest13() throws PcepParseException {
......@@ -673,13 +606,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -688,19 +619,16 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate(with R flag set) messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv)
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest14() throws PcepParseException {
......@@ -720,13 +648,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -735,19 +661,17 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate(with R flag set) messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv)
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest15() throws PcepParseException {
......@@ -766,13 +690,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -781,19 +703,16 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest16() throws PcepParseException {
......@@ -815,13 +734,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -830,19 +747,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest17() throws PcepParseException {
......@@ -865,13 +779,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -880,19 +792,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest18() throws PcepParseException {
//srp,lsp (StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth,metric-list
......@@ -915,13 +824,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -930,19 +837,17 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest19() throws PcepParseException {
//srp,lsp(all tlvs),end-point,ero,lspa,bandwidth,metric-list
......@@ -967,13 +872,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -982,19 +885,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
* lsp(SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv) objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest20() throws PcepParseException {
/* srp,lsp (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, srp,
......@@ -1020,13 +920,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateDeletionMsg = buf.array();
......@@ -1035,19 +933,17 @@ public class PcepInitiateMsgTest {
testInitiateDeletionMsg = new byte[iReadLen];
buf.readBytes(testInitiateDeletionMsg, 0, iReadLen);
if (Arrays.equals(initiateDeletionMsg, testInitiateDeletionMsg)) {
Assert.assertArrayEquals(initiateDeletionMsg, testInitiateDeletionMsg);
log.debug("PCInitiate Msg are equal :" + initiateDeletionMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateDeletionMsg, testInitiateDeletionMsg);
}
/**
* This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest21() throws PcepParseException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
......@@ -1079,13 +975,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1094,19 +988,17 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest22() throws PcepParseException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
......@@ -1140,13 +1032,10 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1155,19 +1044,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest23() throws PcepParseException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
......@@ -1202,13 +1088,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1217,19 +1101,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,lspa,bandwidth
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest24() throws PcepParseException {
/*srp,lsp(StatefulIPv4LspIdentidiersTlv),end-point,ero,
......@@ -1264,13 +1145,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1279,19 +1158,16 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* 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.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest25() throws PcepParseException {
......@@ -1329,13 +1205,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1344,19 +1218,18 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* 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.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest26() throws PcepParseException {
......@@ -1395,13 +1268,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1410,19 +1281,18 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* 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.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest27() throws PcepParseException {
......@@ -1463,13 +1333,11 @@ public class PcepInitiateMsgTest {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1478,16 +1346,7 @@ public class PcepInitiateMsgTest {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
}
\ No newline at end of file
......
......@@ -15,12 +15,9 @@
*/
package org.onosproject.pcepio;
import java.util.Arrays;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepFactories;
......@@ -34,16 +31,13 @@ public class PcepInitiateMsgTest2 {
protected static final Logger log = LoggerFactory.getLogger(PcepInitiateMsgTest.class);
@Before
public void startUp() {
}
@After
public void tearDown() {
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
* END-POINTS, ERO, LSPA, BANDWIDTH, METRIC-LIST objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest1() throws PcepParseException {
......@@ -76,13 +70,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -91,19 +82,18 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv,
* StatefulRsvpErrorSpecTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest2() throws PcepParseException {
......@@ -137,13 +127,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -152,19 +139,17 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv,
* StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv), END-POINTS,
* ERO, LSPA, BANDWIDTH objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest3() throws PcepParseException {
......@@ -197,13 +182,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -212,19 +194,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv, StatefulRsvpErrorSpecTlv),
* END-POINTS, ERO, LSPA objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest4() throws PcepParseException {
......@@ -256,13 +235,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -271,19 +247,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest5() throws PcepParseException {
......@@ -313,13 +286,11 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate",
(message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -328,19 +299,18 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest6() throws PcepParseException {
......@@ -371,13 +341,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -386,19 +353,17 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv, StatefulLspErrorCodeTlv), END-POINTS, ERO,
* LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest7() throws PcepParseException {
......@@ -430,13 +395,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -445,19 +407,17 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH, METRIC OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest8() throws PcepParseException {
......@@ -488,13 +448,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -503,19 +460,18 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest9() throws PcepParseException {
......@@ -545,13 +501,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -560,19 +513,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest10() throws PcepParseException {
......@@ -599,13 +549,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -614,19 +561,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest11() throws PcepParseException {
......@@ -655,13 +599,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
......@@ -669,19 +610,17 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv), END-POINTS, ERO, LSPA, BANDWIDTH OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest12() throws PcepParseException {
......@@ -709,13 +648,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -724,19 +660,17 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspDbVerTlv), END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest13() throws PcepParseException {
......@@ -765,13 +699,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -780,19 +711,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINTS, ERO, LSPA, BANDWIDTH , METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest14() throws PcepParseException {
......@@ -820,13 +748,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -835,19 +760,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINTS, ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest15() throws PcepParseException {
......@@ -874,13 +796,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -889,19 +808,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest16() throws PcepParseException {
......@@ -927,13 +843,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -942,19 +855,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest17() throws PcepParseException {
......@@ -978,13 +888,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -993,19 +900,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest18() throws PcepParseException {
......@@ -1030,13 +934,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1045,19 +946,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest19() throws PcepParseException {
......@@ -1083,13 +981,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1098,19 +993,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest20() throws PcepParseException {
......@@ -1135,13 +1026,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1150,19 +1038,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest21() throws PcepParseException {
......@@ -1186,13 +1071,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1201,19 +1083,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (StatefulIPv4LspIdentidiersTlv), END-POINTS, ERO,
* LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest22() throws PcepParseException {
......@@ -1236,13 +1114,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1251,19 +1126,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest23() throws PcepParseException {
......@@ -1287,13 +1159,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1302,19 +1171,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv),
* END-POINTS, ERO, LSPA BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest25() throws PcepParseException {
......@@ -1339,13 +1205,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1354,19 +1217,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv), END-POINTS,
* ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest26() throws PcepParseException {
......@@ -1393,13 +1253,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1408,19 +1265,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO, LSPA,
* BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest27() throws PcepParseException {
......@@ -1444,13 +1298,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1459,19 +1310,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv), END-POINTS, ERO,
* LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest28() throws PcepParseException {
......@@ -1494,13 +1341,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1509,19 +1353,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest29() throws PcepParseException {
......@@ -1543,13 +1384,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1558,19 +1396,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, SymbolicPathNameTlv),
* END-POINTS, ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest30() throws PcepParseException {
......@@ -1593,13 +1427,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1608,19 +1439,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP (SymbolicPathNameTlv), END-POINTS, ERO, LSPA OBJECT
* objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest31() throws PcepParseException {
......@@ -1642,13 +1469,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1657,19 +1481,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
* ERO, LSPA, BANDWIDTH, METRIC OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest32() throws PcepParseException {
......@@ -1695,13 +1515,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1710,19 +1527,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
* ERO, LSPA, BANDWIDTH OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest33() throws PcepParseException {
......@@ -1747,13 +1561,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1762,19 +1573,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
* ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest34() throws PcepParseException {
......@@ -1798,13 +1606,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1813,19 +1618,15 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal", initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
* ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest35() throws PcepParseException {
......@@ -1850,13 +1651,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1865,19 +1663,16 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
/**
* This test case checks for SRP, LSP ( StatefulLspDbVerTlv), END-POINTS,
* ERO, LSPA OBJECT objects in PcInitiate message.
*
* @throws PcepParseException when message paring fails
*/
@Test
public void initiateMessageTest36() throws PcepParseException {
......@@ -1901,13 +1696,10 @@ public class PcepInitiateMsgTest2 {
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
try {
message = reader.readFrom(buffer);
} catch (PcepParseException e) {
e.printStackTrace();
}
if (message instanceof PcepInitiateMsg) {
Assert.assertTrue("PcepMessage is not instance of PcInitiate", (message instanceof PcepInitiateMsg));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testInitiateCreationMsg = buf.array();
......@@ -1916,17 +1708,9 @@ public class PcepInitiateMsgTest2 {
testInitiateCreationMsg = new byte[iReadLen];
buf.readBytes(testInitiateCreationMsg, 0, iReadLen);
if (Arrays.equals(initiateCreationMsg, testInitiateCreationMsg)) {
Assert.assertArrayEquals(initiateCreationMsg, testInitiateCreationMsg);
log.debug("PCInitiate Msg are equal :" + initiateCreationMsg);
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
} else {
Assert.fail("test case failed");
log.debug("not equal");
}
Assert.assertArrayEquals("PcInitiate messages are not equal",
initiateCreationMsg, testInitiateCreationMsg);
}
}
......