alshabib

added test for lldp provider

Change-Id: I31e7c21840d48c38ec60ec7437657daccc185846
...@@ -24,7 +24,7 @@ public class DefaultInboundPacket implements InboundPacket { ...@@ -24,7 +24,7 @@ public class DefaultInboundPacket implements InboundPacket {
24 * @param parsed parsed ethernet frame 24 * @param parsed parsed ethernet frame
25 * @param unparsed unparsed raw bytes 25 * @param unparsed unparsed raw bytes
26 */ 26 */
27 - public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed, 27 + public DefaultInboundPacket(ConnectPoint receivedFrom, Ethernet parsed,
28 ByteBuffer unparsed) { 28 ByteBuffer unparsed) {
29 this.receivedFrom = receivedFrom; 29 this.receivedFrom = receivedFrom;
30 this.parsed = parsed; 30 this.parsed = parsed;
......
...@@ -83,6 +83,7 @@ public class LinkDiscovery implements TimerTask { ...@@ -83,6 +83,7 @@ public class LinkDiscovery implements TimerTask {
83 private final PacketService pktService; 83 private final PacketService pktService;
84 private final MastershipService mastershipService; 84 private final MastershipService mastershipService;
85 private Timeout timeout; 85 private Timeout timeout;
86 + private boolean isStopped;
86 87
87 /** 88 /**
88 * Instantiates discovery manager for the given physical switch. Creates a 89 * Instantiates discovery manager for the given physical switch. Creates a
...@@ -289,11 +290,13 @@ public class LinkDiscovery implements TimerTask { ...@@ -289,11 +290,13 @@ public class LinkDiscovery implements TimerTask {
289 290
290 public void stop() { 291 public void stop() {
291 timeout.cancel(); 292 timeout.cancel();
293 + isStopped = true;
292 } 294 }
293 295
294 public void start() { 296 public void start() {
295 timeout = Timer.getTimer().newTimeout(this, 0, 297 timeout = Timer.getTimer().newTimeout(this, 0,
296 TimeUnit.MILLISECONDS); 298 TimeUnit.MILLISECONDS);
299 + isStopped = false;
297 } 300 }
298 301
299 /** 302 /**
...@@ -352,4 +355,15 @@ public class LinkDiscovery implements TimerTask { ...@@ -352,4 +355,15 @@ public class LinkDiscovery implements TimerTask {
352 } 355 }
353 } 356 }
354 357
358 + public boolean containsPort(Long portNumber) {
359 + if (slowPorts.contains(portNumber) || fastPorts.contains(portNumber)) {
360 + return true;
361 + }
362 + return false;
363 + }
364 +
365 + public boolean isStopped() {
366 + return isStopped;
367 + }
368 +
355 } 369 }
......