added test for lldp provider
Change-Id: I31e7c21840d48c38ec60ec7437657daccc185846
Showing
3 changed files
with
14 additions
and
0 deletions
... | @@ -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 | } | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment