diff options
Diffstat (limited to 'framework/src/onos/core/store/dist/src/test')
8 files changed, 78 insertions, 51 deletions
diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/cluster/messaging/impl/ClusterCommunicationManagerTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/cluster/messaging/impl/ClusterCommunicationManagerTest.java index 0dcc6a10..daeaa12c 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/cluster/messaging/impl/ClusterCommunicationManagerTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/cluster/messaging/impl/ClusterCommunicationManagerTest.java @@ -109,7 +109,7 @@ public class ClusterCommunicationManagerTest { assertEquals("incorrect event node", nodeId, delegate.nodeId); } - enum Op { DETECTED, VANISHED, REMOVED }; + enum Op { DETECTED, VANISHED, REMOVED } private class TestDelegate implements ClusterNodesDelegate { diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/MatchTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/MatchTest.java index 7ff94c88..952393aa 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/MatchTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/MatchTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.store.consistent.impl; import static junit.framework.TestCase.assertEquals; diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/ResultTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/ResultTest.java index 2a3bab87..2d329d14 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/ResultTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/ResultTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.store.consistent.impl; import static junit.framework.TestCase.assertEquals; diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java index 84dc9153..ab53710b 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/consistent/impl/UpdateResultTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.onosproject.store.consistent.impl; import static junit.framework.TestCase.assertEquals; @@ -15,8 +30,8 @@ public class UpdateResultTest { @Test public void testGetters() { - Versioned<String> oldValue = new Versioned<String>("a", 1); - Versioned<String> newValue = new Versioned<String>("b", 2); + Versioned<String> oldValue = new Versioned<>("a", 1); + Versioned<String> newValue = new Versioned<>("b", 2); UpdateResult<String, String> ur = new UpdateResult<>(true, "foo", "k", oldValue, newValue); @@ -29,8 +44,8 @@ public class UpdateResultTest { @Test public void testToMapEvent() { - Versioned<String> oldValue = new Versioned<String>("a", 1); - Versioned<String> newValue = new Versioned<String>("b", 2); + Versioned<String> oldValue = new Versioned<>("a", 1); + Versioned<String> newValue = new Versioned<>("b", 2); UpdateResult<String, String> ur1 = new UpdateResult<>(true, "foo", "k", oldValue, newValue); MapEvent<String, String> event1 = ur1.toMapEvent(); @@ -59,8 +74,8 @@ public class UpdateResultTest { @Test public void testMap() { - Versioned<String> oldValue = new Versioned<String>("a", 1); - Versioned<String> newValue = new Versioned<String>("b", 2); + Versioned<String> oldValue = new Versioned<>("a", 1); + Versioned<String> newValue = new Versioned<>("b", 2); UpdateResult<String, String> ur1 = new UpdateResult<>(true, "foo", "k", oldValue, newValue); UpdateResult<Integer, Integer> ur2 = ur1.map(s -> s.length(), s -> s.length()); diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java index 43b11f52..3a168936 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java @@ -802,31 +802,22 @@ public class GossipDeviceStoreTest { @Test public final void testEvents() throws InterruptedException { final CountDownLatch addLatch = new CountDownLatch(1); - DeviceStoreDelegate checkAdd = new DeviceStoreDelegate() { - @Override - public void notify(DeviceEvent event) { - assertEquals(DEVICE_ADDED, event.type()); - assertDevice(DID1, SW1, event.subject()); - addLatch.countDown(); - } + DeviceStoreDelegate checkAdd = event -> { + assertEquals(DEVICE_ADDED, event.type()); + assertDevice(DID1, SW1, event.subject()); + addLatch.countDown(); }; final CountDownLatch updateLatch = new CountDownLatch(1); - DeviceStoreDelegate checkUpdate = new DeviceStoreDelegate() { - @Override - public void notify(DeviceEvent event) { - assertEquals(DEVICE_UPDATED, event.type()); - assertDevice(DID1, SW2, event.subject()); - updateLatch.countDown(); - } + DeviceStoreDelegate checkUpdate = event -> { + assertEquals(DEVICE_UPDATED, event.type()); + assertDevice(DID1, SW2, event.subject()); + updateLatch.countDown(); }; final CountDownLatch removeLatch = new CountDownLatch(1); - DeviceStoreDelegate checkRemove = new DeviceStoreDelegate() { - @Override - public void notify(DeviceEvent event) { - assertEquals(DEVICE_REMOVED, event.type()); - assertDevice(DID1, SW2, event.subject()); - removeLatch.countDown(); - } + DeviceStoreDelegate checkRemove = event -> { + assertEquals(DEVICE_REMOVED, event.type()); + assertDevice(DID1, SW2, event.subject()); + removeLatch.countDown(); }; DeviceDescription description = diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java index d429752c..76ff8045 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/flow/impl/ReplicaInfoManagerTest.java @@ -101,7 +101,7 @@ public class ReplicaInfoManagerTest { // fake MastershipEvent eventDispatcher.post(new MastershipEvent(Type.MASTER_CHANGED, DID1, - new RoleInfo(NID1, new LinkedList<NodeId>()))); + new RoleInfo(NID1, new LinkedList<>()))); assertTrue(latch.await(1, TimeUnit.SECONDS)); } diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/impl/TimestampedTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/impl/TimestampedTest.java index 0f67572f..c47eb27a 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/impl/TimestampedTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/impl/TimestampedTest.java @@ -65,7 +65,7 @@ public class TimestampedTest { @Test public final void testValue() { - final Integer n = Integer.valueOf(42); + final Integer n = 42; Timestamped<Integer> tsv = new Timestamped<>(n, TS_1_1); assertSame(n, tsv.value()); diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/link/impl/GossipLinkStoreTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/link/impl/GossipLinkStoreTest.java index bf7af464..f8b5b860 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/link/impl/GossipLinkStoreTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/link/impl/GossipLinkStoreTest.java @@ -548,31 +548,22 @@ public class GossipLinkStoreTest { final LinkKey linkId1 = LinkKey.linkKey(d1P1, d2P2); final CountDownLatch addLatch = new CountDownLatch(1); - LinkStoreDelegate checkAdd = new LinkStoreDelegate() { - @Override - public void notify(LinkEvent event) { - assertEquals(LINK_ADDED, event.type()); - assertLink(linkId1, INDIRECT, event.subject()); - addLatch.countDown(); - } + LinkStoreDelegate checkAdd = event -> { + assertEquals(LINK_ADDED, event.type()); + assertLink(linkId1, INDIRECT, event.subject()); + addLatch.countDown(); }; final CountDownLatch updateLatch = new CountDownLatch(1); - LinkStoreDelegate checkUpdate = new LinkStoreDelegate() { - @Override - public void notify(LinkEvent event) { - assertEquals(LINK_UPDATED, event.type()); - assertLink(linkId1, DIRECT, event.subject()); - updateLatch.countDown(); - } + LinkStoreDelegate checkUpdate = event -> { + assertEquals(LINK_UPDATED, event.type()); + assertLink(linkId1, DIRECT, event.subject()); + updateLatch.countDown(); }; final CountDownLatch removeLatch = new CountDownLatch(1); - LinkStoreDelegate checkRemove = new LinkStoreDelegate() { - @Override - public void notify(LinkEvent event) { - assertEquals(LINK_REMOVED, event.type()); - assertLink(linkId1, DIRECT, event.subject()); - removeLatch.countDown(); - } + LinkStoreDelegate checkRemove = event -> { + assertEquals(LINK_REMOVED, event.type()); + assertLink(linkId1, DIRECT, event.subject()); + removeLatch.countDown(); }; linkStore.setDelegate(checkAdd); |