Mahesh Poojary S
Committed by Gerrit Code Review

[ONOS-2623] UT test cases for Open and Error messages.

Change-Id: I13736e921b0678573095c8a600b12af70dc524d1
...@@ -22,6 +22,10 @@ import org.onosproject.pcepio.protocol.PcepBandwidthObject; ...@@ -22,6 +22,10 @@ import org.onosproject.pcepio.protocol.PcepBandwidthObject;
22 import org.onosproject.pcepio.protocol.PcepCloseMsg; 22 import org.onosproject.pcepio.protocol.PcepCloseMsg;
23 import org.onosproject.pcepio.protocol.PcepEndPointsObject; 23 import org.onosproject.pcepio.protocol.PcepEndPointsObject;
24 import org.onosproject.pcepio.protocol.PcepEroObject; 24 import org.onosproject.pcepio.protocol.PcepEroObject;
25 +import org.onosproject.pcepio.protocol.PcepErrorInfo;
26 +import org.onosproject.pcepio.protocol.PcepError;
27 +import org.onosproject.pcepio.protocol.PcepErrorMsg;
28 +import org.onosproject.pcepio.protocol.PcepErrorObject;
25 import org.onosproject.pcepio.protocol.PcepFactory; 29 import org.onosproject.pcepio.protocol.PcepFactory;
26 import org.onosproject.pcepio.protocol.PcepInitiateMsg; 30 import org.onosproject.pcepio.protocol.PcepInitiateMsg;
27 import org.onosproject.pcepio.protocol.PcepKeepaliveMsg; 31 import org.onosproject.pcepio.protocol.PcepKeepaliveMsg;
...@@ -31,6 +35,8 @@ import org.onosproject.pcepio.protocol.PcepMessage; ...@@ -31,6 +35,8 @@ import org.onosproject.pcepio.protocol.PcepMessage;
31 import org.onosproject.pcepio.protocol.PcepMessageReader; 35 import org.onosproject.pcepio.protocol.PcepMessageReader;
32 import org.onosproject.pcepio.protocol.PcepMetricObject; 36 import org.onosproject.pcepio.protocol.PcepMetricObject;
33 import org.onosproject.pcepio.protocol.PcepMsgPath; 37 import org.onosproject.pcepio.protocol.PcepMsgPath;
38 +import org.onosproject.pcepio.protocol.PcepOpenMsg;
39 +import org.onosproject.pcepio.protocol.PcepOpenObject;
34 import org.onosproject.pcepio.protocol.PcepSrpObject; 40 import org.onosproject.pcepio.protocol.PcepSrpObject;
35 import org.onosproject.pcepio.protocol.PcepUpdateMsg; 41 import org.onosproject.pcepio.protocol.PcepUpdateMsg;
36 import org.onosproject.pcepio.protocol.PcepUpdateRequest; 42 import org.onosproject.pcepio.protocol.PcepUpdateRequest;
...@@ -41,15 +47,13 @@ public class PcepFactoryVer1 implements PcepFactory { ...@@ -41,15 +47,13 @@ public class PcepFactoryVer1 implements PcepFactory {
41 public static final PcepFactoryVer1 INSTANCE = new PcepFactoryVer1(); 47 public static final PcepFactoryVer1 INSTANCE = new PcepFactoryVer1();
42 48
43 @Override 49 @Override
44 - public org.onosproject.pcepio.protocol.PcepOpenMsg.Builder buildOpenMsg() { 50 + public PcepOpenMsg.Builder buildOpenMsg() {
45 - // TODO Auto-generated method stub 51 + return new PcepOpenMsgVer1.Builder();
46 - return null;
47 } 52 }
48 53
49 @Override 54 @Override
50 - public org.onosproject.pcepio.protocol.PcepOpenObject.Builder buildOpenObject() { 55 + public PcepOpenObject.Builder buildOpenObject() {
51 - // TODO Auto-generated method stub 56 + return new PcepOpenObjectVer1.Builder();
52 - return null;
53 } 57 }
54 58
55 @Override 59 @Override
...@@ -180,15 +184,13 @@ public class PcepFactoryVer1 implements PcepFactory { ...@@ -180,15 +184,13 @@ public class PcepFactoryVer1 implements PcepFactory {
180 } 184 }
181 185
182 @Override 186 @Override
183 - public org.onosproject.pcepio.protocol.PcepErrorMsg.Builder buildPcepErrorMsg() { 187 + public PcepErrorMsg.Builder buildPcepErrorMsg() {
184 - // TODO Auto-generated method stub 188 + return new PcepErrorMsgVer1.Builder();
185 - return null;
186 } 189 }
187 190
188 @Override 191 @Override
189 - public org.onosproject.pcepio.protocol.PcepErrorObject.Builder buildPcepErrorObject() { 192 + public PcepErrorObject.Builder buildPcepErrorObject() {
190 - // TODO Auto-generated method stub 193 + return new PcepErrorObjectVer1.Builder();
191 - return null;
192 } 194 }
193 195
194 @Override 196 @Override
...@@ -198,15 +200,13 @@ public class PcepFactoryVer1 implements PcepFactory { ...@@ -198,15 +200,13 @@ public class PcepFactoryVer1 implements PcepFactory {
198 } 200 }
199 201
200 @Override 202 @Override
201 - public org.onosproject.pcepio.protocol.PcepErrorInfo.Builder buildPcepErrorInfo() { 203 + public PcepErrorInfo.Builder buildPcepErrorInfo() {
202 - // TODO Auto-generated method stub 204 + return new PcepErrorInfoVer1.Builder();
203 - return null;
204 } 205 }
205 206
206 @Override 207 @Override
207 - public org.onosproject.pcepio.protocol.PcepError.Builder buildPcepError() { 208 + public PcepError.Builder buildPcepError() {
208 - // TODO Auto-generated method stub 209 + return new PcepErrorVer1.Builder();
209 - return null;
210 } 210 }
211 211
212 @Override 212 @Override
......
...@@ -73,8 +73,7 @@ public abstract class PcepMessageVer1 { ...@@ -73,8 +73,7 @@ public abstract class PcepMessageVer1 {
73 case OPEN_MSG_TYPE: 73 case OPEN_MSG_TYPE:
74 log.debug("OPEN MESSAGE is received"); 74 log.debug("OPEN MESSAGE is received");
75 // message type value 1 means it is open message 75 // message type value 1 means it is open message
76 - // return 76 + return PcepOpenMsgVer1.READER.readFrom(cb.readBytes(length));
77 - // TODO: Read open message from channel buffer.
78 case KEEPALIVE_MSG_TYPE: 77 case KEEPALIVE_MSG_TYPE:
79 log.debug("KEEPALIVE MESSAGE is received"); 78 log.debug("KEEPALIVE MESSAGE is received");
80 // message type value 2 means it is Keepalive message 79 // message type value 2 means it is Keepalive message
...@@ -82,8 +81,7 @@ public abstract class PcepMessageVer1 { ...@@ -82,8 +81,7 @@ public abstract class PcepMessageVer1 {
82 case ERROR_MSG_TYPE: 81 case ERROR_MSG_TYPE:
83 log.debug("ERROR MESSAGE is received"); 82 log.debug("ERROR MESSAGE is received");
84 // message type value 6 means it is error message 83 // message type value 6 means it is error message
85 - // return 84 + return PcepErrorMsgVer1.READER.readFrom(cb.readBytes(length));
86 - // TODO: Read Error message from channel buffer.
87 case REPORT_MSG_TYPE: 85 case REPORT_MSG_TYPE:
88 log.debug("REPORT MESSAGE is received"); 86 log.debug("REPORT MESSAGE is received");
89 // message type value 10 means it is Report message 87 // message type value 10 means it is Report message
......