Simple{Device,Link}Store test
Change-Id: I2463248be1ba9d4640e5e9d5110825c747e9094c
Showing
6 changed files
with
7 additions
and
11 deletions
| ... | @@ -41,6 +41,9 @@ import com.google.common.collect.Sets; | ... | @@ -41,6 +41,9 @@ import com.google.common.collect.Sets; |
| 41 | import com.hazelcast.config.Config; | 41 | import com.hazelcast.config.Config; |
| 42 | import com.hazelcast.core.Hazelcast; | 42 | import com.hazelcast.core.Hazelcast; |
| 43 | 43 | ||
| 44 | +/** | ||
| 45 | + * Test of the Hazelcast based distributed DeviceStore implementation. | ||
| 46 | + */ | ||
| 44 | public class DistributedDeviceStoreTest { | 47 | public class DistributedDeviceStoreTest { |
| 45 | 48 | ||
| 46 | private static final ProviderId PID = new ProviderId("of", "foo"); | 49 | private static final ProviderId PID = new ProviderId("of", "foo"); | ... | ... |
| ... | @@ -34,16 +34,14 @@ import com.google.common.collect.Iterables; | ... | @@ -34,16 +34,14 @@ import com.google.common.collect.Iterables; |
| 34 | import com.hazelcast.config.Config; | 34 | import com.hazelcast.config.Config; |
| 35 | import com.hazelcast.core.Hazelcast; | 35 | import com.hazelcast.core.Hazelcast; |
| 36 | 36 | ||
| 37 | +/** | ||
| 38 | + * Test of the Hazelcast based distributed LinkStore implementation. | ||
| 39 | + */ | ||
| 37 | public class DistributedLinkStoreTest { | 40 | public class DistributedLinkStoreTest { |
| 38 | 41 | ||
| 39 | private static final ProviderId PID = new ProviderId("of", "foo"); | 42 | private static final ProviderId PID = new ProviderId("of", "foo"); |
| 40 | private static final DeviceId DID1 = deviceId("of:foo"); | 43 | private static final DeviceId DID1 = deviceId("of:foo"); |
| 41 | private static final DeviceId DID2 = deviceId("of:bar"); | 44 | private static final DeviceId DID2 = deviceId("of:bar"); |
| 42 | -// private static final String MFR = "whitebox"; | ||
| 43 | -// private static final String HW = "1.1.x"; | ||
| 44 | -// private static final String SW1 = "3.8.1"; | ||
| 45 | -// private static final String SW2 = "3.9.5"; | ||
| 46 | -// private static final String SN = "43311-12345"; | ||
| 47 | 45 | ||
| 48 | private static final PortNumber P1 = PortNumber.portNumber(1); | 46 | private static final PortNumber P1 = PortNumber.portNumber(1); |
| 49 | private static final PortNumber P2 = PortNumber.portNumber(2); | 47 | private static final PortNumber P2 = PortNumber.portNumber(2); | ... | ... |
| ... | @@ -101,9 +101,6 @@ public class SimpleDeviceStore | ... | @@ -101,9 +101,6 @@ public class SimpleDeviceStore |
| 101 | synchronized (this) { | 101 | synchronized (this) { |
| 102 | devices.put(deviceId, device); | 102 | devices.put(deviceId, device); |
| 103 | availableDevices.add(deviceId); | 103 | availableDevices.add(deviceId); |
| 104 | - | ||
| 105 | - // For now claim the device as a master automatically. | ||
| 106 | - // roles.put(deviceId, MastershipRole.MASTER); | ||
| 107 | } | 104 | } |
| 108 | return new DeviceEvent(DeviceEvent.Type.DEVICE_ADDED, device, null); | 105 | return new DeviceEvent(DeviceEvent.Type.DEVICE_ADDED, device, null); |
| 109 | } | 106 | } |
| ... | @@ -189,7 +186,7 @@ public class SimpleDeviceStore | ... | @@ -189,7 +186,7 @@ public class SimpleDeviceStore |
| 189 | new DefaultPort(device, portDescription.portNumber(), | 186 | new DefaultPort(device, portDescription.portNumber(), |
| 190 | portDescription.isEnabled()); | 187 | portDescription.isEnabled()); |
| 191 | ports.put(port.number(), updatedPort); | 188 | ports.put(port.number(), updatedPort); |
| 192 | - return new DeviceEvent(PORT_UPDATED, device, port); | 189 | + return new DeviceEvent(PORT_UPDATED, device, updatedPort); |
| 193 | } | 190 | } |
| 194 | return null; | 191 | return null; |
| 195 | } | 192 | } | ... | ... |
| ... | @@ -51,8 +51,6 @@ public class SimpleLinkStore | ... | @@ -51,8 +51,6 @@ public class SimpleLinkStore |
| 51 | private final Multimap<DeviceId, Link> srcLinks = HashMultimap.create(); | 51 | private final Multimap<DeviceId, Link> srcLinks = HashMultimap.create(); |
| 52 | private final Multimap<DeviceId, Link> dstLinks = HashMultimap.create(); | 52 | private final Multimap<DeviceId, Link> dstLinks = HashMultimap.create(); |
| 53 | 53 | ||
| 54 | - private static final Set<Link> EMPTY = ImmutableSet.of(); | ||
| 55 | - | ||
| 56 | @Activate | 54 | @Activate |
| 57 | public void activate() { | 55 | public void activate() { |
| 58 | log.info("Started"); | 56 | log.info("Started"); | ... | ... |
core/store/trivial/src/test/java/org/onlab/onos/net/trivial/impl/SimpleDeviceStoreTest.java
0 → 100644
This diff is collapsed. Click to expand it.
core/store/trivial/src/test/java/org/onlab/onos/net/trivial/impl/SimpleLinkStoreTest.java
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment