Refactor PCE and PCEP test adapters to remove redundant classes
Change-Id: I407c3dcd42588c03ba7f5c438d0bf61409d64d69
diff --git a/apps/pce/app/BUCK b/apps/pce/app/BUCK
index 7637aaf..7f3869f 100644
--- a/apps/pce/app/BUCK
+++ b/apps/pce/app/BUCK
@@ -18,6 +18,7 @@
TEST_DEPS = [
'//lib:TEST_REST',
+ '//incubator/api:onos-incubator-api-tests',
]
osgi_jar_with_tests (
diff --git a/apps/pce/app/pom.xml b/apps/pce/app/pom.xml
index 83c7690..ad15d28 100644
--- a/apps/pce/app/pom.xml
+++ b/apps/pce/app/pom.xml
@@ -115,5 +115,12 @@
<artifactId>onos-apps-pce-bandwidthmgmt</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-incubator-api</artifactId>
+ <classifier>tests</classifier>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PceManagerTest.java b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PceManagerTest.java
index 9cf7069..95a464e 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PceManagerTest.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PceManagerTest.java
@@ -37,6 +37,7 @@
import org.onosproject.incubator.net.tunnel.TunnelEvent;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelListener;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.mastership.MastershipServiceAdapter;
import org.onosproject.net.AnnotationKeys;
import org.onosproject.net.Annotations;
@@ -71,7 +72,6 @@
import org.onosproject.pce.pcestore.api.PceStore;
import org.onosproject.pce.util.MockDeviceService;
import org.onosproject.pce.util.PceStoreAdapter;
-import org.onosproject.pce.util.TunnelServiceAdapter;
import org.onosproject.pcep.api.DeviceCapability;
import org.onosproject.pcep.api.TeLinkConfig;
import org.onosproject.store.service.TestStorageService;
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java b/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java
deleted file mode 100644
index 5ff558c..0000000
--- a/apps/pce/app/src/test/java/org/onosproject/pce/util/TunnelServiceAdapter.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.pce.util;
-
-import java.util.Collection;
-
-import org.onosproject.core.ApplicationId;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.incubator.net.tunnel.Tunnel.Type;
-import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
-import org.onosproject.incubator.net.tunnel.TunnelId;
-import org.onosproject.incubator.net.tunnel.TunnelListener;
-import org.onosproject.incubator.net.tunnel.TunnelName;
-import org.onosproject.incubator.net.tunnel.TunnelService;
-import org.onosproject.incubator.net.tunnel.TunnelSubscription;
-import org.onosproject.net.Annotations;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.ElementId;
-import org.onosproject.net.Path;
-
-/**
- * Provides test implementation of class TunnelService.
- */
-public class TunnelServiceAdapter implements TunnelService {
-
- @Override
- public void addListener(TunnelListener listener) {
- }
-
- @Override
- public void removeListener(TunnelListener listener) {
- }
-
- @Override
- public Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelName tunnelName,
- Annotations... annotations) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst,
- Annotations... annotations) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type,
- Annotations... annotations) {
- return null;
- }
-
- @Override
- public TunnelId setupTunnel(ApplicationId producerId, ElementId srcElementId, Tunnel tunnel, Path path) {
- return null;
- }
-
- @Override
- public boolean downTunnel(ApplicationId producerId, TunnelId tunnelId) {
- return false;
- }
-
- @Override
- public boolean returnTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) {
- return false;
- }
-
- @Override
- public boolean returnTunnel(ApplicationId consumerId, TunnelName tunnelName, Annotations... annotations) {
- return false;
- }
-
- @Override
- public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type,
- Annotations... annotations) {
- return false;
- }
-
- @Override
- public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst,
- Annotations... annotations) {
- return false;
- }
-
- @Override
- public Tunnel queryTunnel(TunnelId tunnelId) {
- return null;
- }
-
- @Override
- public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> queryTunnel(Type type) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) {
- return null;
- }
-
- @Override
- public Collection<Tunnel> queryAllTunnels() {
- return null;
- }
-
- @Override
- public int tunnelCount() {
- return 0;
- }
-
- @Override
- public Iterable<Tunnel> getTunnels(DeviceId deviceId) {
- return null;
- }
-}
diff --git a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepControllerAdapter.java b/apps/pcep-api/src/test/java/org/onosproject/pcep/api/PcepControllerAdapter.java
similarity index 83%
rename from providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepControllerAdapter.java
rename to apps/pcep-api/src/test/java/org/onosproject/pcep/api/PcepControllerAdapter.java
index 086bbf1..8163634 100644
--- a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepControllerAdapter.java
+++ b/apps/pcep-api/src/test/java/org/onosproject/pcep/api/PcepControllerAdapter.java
@@ -14,16 +14,9 @@
* limitations under the License.
*/
-package org.onosproject.provider.pcep.topology.impl;
+package org.onosproject.pcep.api;
import org.onosproject.net.DeviceId;
-import org.onosproject.pcep.api.PcepController;
-import org.onosproject.pcep.api.PcepDpid;
-import org.onosproject.pcep.api.PcepLinkListener;
-import org.onosproject.pcep.api.PcepSwitch;
-import org.onosproject.pcep.api.PcepSwitchListener;
-import org.onosproject.pcep.api.PcepTunnel;
-import org.onosproject.pcep.api.PcepTunnelListener;
/**
* Implementation of PCEP controller.
diff --git a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapAdapter.java b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapAdapter.java
deleted file mode 100644
index d7740ae..0000000
--- a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapAdapter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.vtnrsc.util;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.BiFunction;
-
-import org.onosproject.store.service.EventuallyConsistentMap;
-import org.onosproject.store.service.EventuallyConsistentMapListener;
-
-/**
- * Testing adapter for EventuallyConsistentMap.
- */
-public class VtnEventuallyConsistentMapAdapter<K, V> implements EventuallyConsistentMap<K, V> {
-
- @Override
- public String name() {
- return null;
- }
-
- @Override
- public int size() {
- return 0;
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- @Override
- public boolean containsKey(K key) {
- return false;
- }
-
- @Override
- public boolean containsValue(V value) {
- return false;
- }
-
- @Override
- public V get(K key) {
- return null;
- }
-
- @Override
- public void put(K key, V value) {
-
- }
-
- @Override
- public V remove(K key) {
- return null;
- }
-
- @Override
- public void remove(K key, V value) {
-
- }
-
- @Override
- public V compute(K key, BiFunction<K, V, V> recomputeFunction) {
- return null;
- }
-
- @Override
- public void putAll(Map<? extends K, ? extends V> m) {
-
- }
-
- @Override
- public void clear() {
-
- }
-
- @Override
- public Set<K> keySet() {
- return null;
- }
-
- @Override
- public Collection<V> values() {
- return null;
- }
-
- @Override
- public Set<Map.Entry<K, V>> entrySet() {
- return null;
- }
-
- @Override
- public void addListener(EventuallyConsistentMapListener<K, V> listener) {
-
- }
-
- @Override
- public void removeListener(EventuallyConsistentMapListener<K, V> listener) {
-
- }
-}
diff --git a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
index 38ceb0b..3f5e50e 100644
--- a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
+++ b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
@@ -31,6 +31,8 @@
import org.onosproject.store.Timestamp;
import static org.onosproject.store.service.EventuallyConsistentMapEvent.Type.*;
+
+import org.onosproject.store.service.EventuallyConsistentMapAdapter;
import org.onosproject.store.service.EventuallyConsistentMapListener;
import org.onosproject.store.service.EventuallyConsistentMapEvent;
import org.onosproject.store.service.EventuallyConsistentMapBuilder;
@@ -40,7 +42,7 @@
* Testing version of an Eventually Consistent Map.
*/
-public final class VtnEventuallyConsistentMapTest<K, V> extends VtnEventuallyConsistentMapAdapter<K, V> {
+public final class VtnEventuallyConsistentMapTest<K, V> extends EventuallyConsistentMapAdapter<K, V> {
private final HashMap<K, V> map;
private final String mapName;
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/LabelResourceAdapter.java b/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceAdapter.java
similarity index 74%
rename from protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/LabelResourceAdapter.java
rename to incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceAdapter.java
index 92ebbe6..d09a1de 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/LabelResourceAdapter.java
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/resource/label/LabelResourceAdapter.java
@@ -13,27 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.pcelabelstore.util;
+package org.onosproject.incubator.net.resource.label;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Random;
-import java.util.Set;
-
-import org.onosproject.incubator.net.resource.label.DefaultLabelResource;
-import org.onosproject.incubator.net.resource.label.LabelResource;
-import org.onosproject.incubator.net.resource.label.LabelResourceAdminService;
-import org.onosproject.incubator.net.resource.label.LabelResourceDelegate;
-import org.onosproject.incubator.net.resource.label.LabelResourceEvent;
-import org.onosproject.incubator.net.resource.label.LabelResourceId;
-import org.onosproject.incubator.net.resource.label.LabelResourceListener;
-import org.onosproject.incubator.net.resource.label.LabelResourcePool;
-import org.onosproject.incubator.net.resource.label.LabelResourceProvider;
-import org.onosproject.incubator.net.resource.label.LabelResourceProviderRegistry;
-import org.onosproject.incubator.net.resource.label.LabelResourceProviderService;
-import org.onosproject.incubator.net.resource.label.LabelResourceService;
+import com.google.common.collect.Multimap;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceEvent;
@@ -42,14 +24,19 @@
import org.onosproject.net.provider.AbstractListenerProviderRegistry;
import org.onosproject.net.provider.AbstractProviderService;
-import com.google.common.collect.Multimap;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Random;
+import java.util.Set;
+
+import static com.google.common.base.Preconditions.checkNotNull;
/**
* Provides test implementation of class LabelResourceService.
*/
public class LabelResourceAdapter
extends AbstractListenerProviderRegistry<LabelResourceEvent, LabelResourceListener,
- LabelResourceProvider, LabelResourceProviderService>
+ LabelResourceProvider, LabelResourceProviderService>
implements LabelResourceService, LabelResourceAdminService, LabelResourceProviderRegistry {
public static final long GLOBAL_LABEL_SPACE_MIN = 4097;
public static final long GLOBAL_LABEL_SPACE_MAX = 5121;
@@ -62,36 +49,36 @@
public boolean createDevicePool(DeviceId deviceId,
LabelResourceId beginLabel,
LabelResourceId endLabel) {
- return true;
+ return true;
}
@Override
public boolean createGlobalPool(LabelResourceId beginLabel,
LabelResourceId endLabel) {
- return true;
+ return true;
}
@Override
public boolean destroyDevicePool(DeviceId deviceId) {
- return true;
+ return true;
}
@Override
public boolean destroyGlobalPool() {
- return true;
+ return true;
}
public long getLabelId(long min, long max) {
- return random.nextInt((int) max - (int) min + 1) + (int) min;
+ return random.nextInt((int) max - (int) min + 1) + (int) min;
}
@Override
public Collection<LabelResource> applyFromDevicePool(DeviceId deviceId,
- long applyNum) {
+ long applyNum) {
Collection<LabelResource> labelList = new LinkedList<>();
LabelResource label = new DefaultLabelResource(deviceId,
- LabelResourceId.labelResourceId(
- getLabelId(LOCAL_LABEL_SPACE_MIN, LOCAL_LABEL_SPACE_MAX)));
+ LabelResourceId.labelResourceId(
+ getLabelId(LOCAL_LABEL_SPACE_MIN, LOCAL_LABEL_SPACE_MAX)));
labelList.add(label);
return labelList;
}
@@ -100,50 +87,50 @@
public Collection<LabelResource> applyFromGlobalPool(long applyNum) {
Collection<LabelResource> labelList = new LinkedList<>();
LabelResource label = new DefaultLabelResource(DeviceId.deviceId("foo"),
- LabelResourceId.labelResourceId(
- getLabelId(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)));
+ LabelResourceId.labelResourceId(
+ getLabelId(GLOBAL_LABEL_SPACE_MIN, GLOBAL_LABEL_SPACE_MAX)));
labelList.add(label);
return labelList;
}
@Override
public boolean releaseToDevicePool(Multimap<DeviceId, LabelResource> release) {
- return true;
+ return true;
}
@Override
public boolean releaseToGlobalPool(Set<LabelResourceId> release) {
- return true;
+ return true;
}
@Override
public boolean isDevicePoolFull(DeviceId deviceId) {
- return false;
+ return false;
}
@Override
public boolean isGlobalPoolFull() {
- return false;
+ return false;
}
@Override
public long getFreeNumOfDevicePool(DeviceId deviceId) {
- return 4;
+ return 4;
}
@Override
public long getFreeNumOfGlobalPool() {
- return 4;
+ return 4;
}
@Override
public LabelResourcePool getDeviceLabelResourcePool(DeviceId deviceId) {
- return null;
+ return null;
}
@Override
public LabelResourcePool getGlobalLabelResourcePool() {
- return null;
+ return null;
}
private class InternalLabelResourceDelegate implements LabelResourceDelegate {
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelServiceAdapter.java b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelServiceAdapter.java
similarity index 88%
rename from providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelServiceAdapter.java
rename to incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelServiceAdapter.java
index f883315..303a582 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelServiceAdapter.java
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/tunnel/TunnelServiceAdapter.java
@@ -13,23 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.provider.pcep.tunnel.impl;
+package org.onosproject.incubator.net.tunnel;
import org.onosproject.core.ApplicationId;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
-import org.onosproject.incubator.net.tunnel.TunnelId;
-import org.onosproject.incubator.net.tunnel.TunnelListener;
-import org.onosproject.incubator.net.tunnel.TunnelName;
-import org.onosproject.incubator.net.tunnel.TunnelService;
-import org.onosproject.incubator.net.tunnel.TunnelSubscription;
import org.onosproject.net.Annotations;
import org.onosproject.net.DeviceId;
import org.onosproject.net.ElementId;
+import org.onosproject.net.Path;
import java.util.Collection;
import java.util.Collections;
-import org.onosproject.net.Path;
public class TunnelServiceAdapter implements TunnelService {
@Override
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PcepClientAdapter.java b/protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientAdapter.java
similarity index 93%
rename from protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PcepClientAdapter.java
rename to protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientAdapter.java
index 7ab16ef..6e503ef 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PcepClientAdapter.java
+++ b/protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientAdapter.java
@@ -13,26 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.pcelabelstore.util;
+package org.onosproject.pcep.server;
-import static org.junit.Assert.assertNotNull;
+import org.jboss.netty.channel.Channel;
+import org.onosproject.pcepio.protocol.PcepFactories;
+import org.onosproject.pcepio.protocol.PcepFactory;
+import org.onosproject.pcepio.protocol.PcepMessage;
+import org.onosproject.pcepio.protocol.PcepStateReport;
+import org.onosproject.pcepio.protocol.PcepVersion;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.RejectedExecutionException;
-import org.jboss.netty.channel.Channel;
-import org.onosproject.pcep.server.ClientCapability;
-import org.onosproject.pcep.server.PccId;
-import org.onosproject.pcep.server.LspKey;
-import org.onosproject.pcep.server.PcepClient;
-import org.onosproject.pcep.server.PcepSyncStatus;
-import org.onosproject.pcepio.protocol.PcepFactories;
-import org.onosproject.pcepio.protocol.PcepFactory;
-import org.onosproject.pcepio.protocol.PcepMessage;
-import org.onosproject.pcepio.protocol.PcepStateReport;
-import org.onosproject.pcepio.protocol.PcepVersion;
+import static org.junit.Assert.assertNotNull;
/**
* Representation of PCEP client adapter.
@@ -94,7 +89,7 @@
@Override
public final PccId getPccId() {
return this.pccId;
- };
+ }
@Override
public final String getStringId() {
diff --git a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java b/protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientControllerAdapter.java
similarity index 76%
rename from providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java
rename to protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientControllerAdapter.java
index 5e3a58e..80e6561 100644
--- a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java
+++ b/protocols/pcep/server/api/src/test/java/org/onosproject/pcep/server/PcepClientControllerAdapter.java
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.provider.pcep.topology.impl;
+package org.onosproject.pcep.server;
-
+import com.google.common.collect.Sets;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Deactivate;
import org.onlab.packet.IpAddress;
@@ -24,13 +24,6 @@
import org.onosproject.incubator.net.tunnel.LabelStack;
import org.onosproject.incubator.net.tunnel.Tunnel;
import org.onosproject.net.Path;
-import org.onosproject.pcep.server.ClientCapability;
-import org.onosproject.pcep.server.PccId;
-import org.onosproject.pcep.server.PcepClient;
-import org.onosproject.pcep.server.PcepClientController;
-import org.onosproject.pcep.server.PcepClientListener;
-import org.onosproject.pcep.server.PcepEventListener;
-import org.onosproject.pcep.server.PcepNodeListener;
import org.onosproject.pcep.server.driver.PcepAgent;
import org.onosproject.pcepio.protocol.PcepError;
import org.onosproject.pcepio.protocol.PcepErrorInfo;
@@ -41,16 +34,14 @@
import org.onosproject.pcepio.protocol.PcepVersion;
import org.onosproject.pcepio.types.PcepValueType;
-import com.google.common.collect.Sets;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import static org.onosproject.pcepio.types.PcepErrorDetailInfo.ERROR_TYPE_19;
import static org.onosproject.pcepio.types.PcepErrorDetailInfo.ERROR_VALUE_5;
@@ -89,7 +80,7 @@
}
PcepClientAdapter pc = new PcepClientAdapter();
if (pccId.ipAddress().equals(IpAddress.valueOf(0xC010103))
- || pccId.ipAddress().equals(IpAddress.valueOf(0xB6024E22))) {
+ || pccId.ipAddress().equals(IpAddress.valueOf(0xB6024E22))) {
pc.setCapability(new ClientCapability(true, false, false, false, false));
} else {
pc.setCapability(new ClientCapability(true, true, true, false, false));
@@ -142,62 +133,62 @@
PcepClient pc = getClient(pccId);
switch (msg.getType()) {
- case NONE:
- break;
- case OPEN:
- break;
- case KEEP_ALIVE:
- //log.debug("Sending Keep Alive Message to {" + pccIpAddress.toString() + "}");
- pc.sendMessage(Collections.singletonList(pc.factory().buildKeepaliveMsg().build()));
- break;
- case PATH_COMPUTATION_REQUEST:
- break;
- case PATH_COMPUTATION_REPLY:
- break;
- case NOTIFICATION:
- break;
- case ERROR:
- break;
- case CLOSE:
- //log.debug("Sending Close Message to { }", pccIpAddress.toString());
- pc.sendMessage(Collections.singletonList(pc.factory().buildCloseMsg().build()));
- break;
- case INITIATE:
- if (!pc.capability().pcInstantiationCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case REPORT:
- //Only update the listener if respective capability is supported else send PCEP-ERR msg
- if (pc.capability().statefulPceCapability()) {
- for (PcepEventListener l : pcepEventListener) {
- l.handleMessage(pccId, msg);
+ case NONE:
+ break;
+ case OPEN:
+ break;
+ case KEEP_ALIVE:
+ //log.debug("Sending Keep Alive Message to {" + pccIpAddress.toString() + "}");
+ pc.sendMessage(Collections.singletonList(pc.factory().buildKeepaliveMsg().build()));
+ break;
+ case PATH_COMPUTATION_REQUEST:
+ break;
+ case PATH_COMPUTATION_REPLY:
+ break;
+ case NOTIFICATION:
+ break;
+ case ERROR:
+ break;
+ case CLOSE:
+ //log.debug("Sending Close Message to { }", pccIpAddress.toString());
+ pc.sendMessage(Collections.singletonList(pc.factory().buildCloseMsg().build()));
+ break;
+ case INITIATE:
+ if (!pc.capability().pcInstantiationCapability()) {
+ pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
+ ERROR_TYPE_19, ERROR_VALUE_5)));
}
- } else {
- // Send PCEP-ERROR message.
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case UPDATE:
- if (!pc.capability().statefulPceCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case LABEL_UPDATE:
- if (!pc.capability().pceccCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case MAX:
- break;
- case END:
- break;
- default:
- break;
+ break;
+ case REPORT:
+ //Only update the listener if respective capability is supported else send PCEP-ERR msg
+ if (pc.capability().statefulPceCapability()) {
+ for (PcepEventListener l : pcepEventListener) {
+ l.handleMessage(pccId, msg);
+ }
+ } else {
+ // Send PCEP-ERROR message.
+ pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
+ ERROR_TYPE_19, ERROR_VALUE_5)));
+ }
+ break;
+ case UPDATE:
+ if (!pc.capability().statefulPceCapability()) {
+ pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
+ ERROR_TYPE_19, ERROR_VALUE_5)));
+ }
+ break;
+ case LABEL_UPDATE:
+ if (!pc.capability().pceccCapability()) {
+ pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
+ ERROR_TYPE_19, ERROR_VALUE_5)));
+ }
+ break;
+ case MAX:
+ break;
+ case END:
+ break;
+ default:
+ break;
}
}
@@ -341,3 +332,4 @@
return false;
}
}
+
diff --git a/protocols/pcep/server/ctl/BUCK b/protocols/pcep/server/ctl/BUCK
index e247e20..29e7fbf 100644
--- a/protocols/pcep/server/ctl/BUCK
+++ b/protocols/pcep/server/ctl/BUCK
@@ -11,7 +11,15 @@
'//lib:netty',
]
+TEST_DEPS = [
+ '//lib:TEST',
+ '//lib:TEST_ADAPTERS',
+ '//incubator/api:onos-incubator-api-tests',
+ '//protocols/pcep/server/api:onos-protocols-pcep-server-api-tests',
+]
+
osgi_jar_with_tests (
deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
)
diff --git a/protocols/pcep/server/ctl/pom.xml b/protocols/pcep/server/ctl/pom.xml
index b6fae75..ad22a9a 100644
--- a/protocols/pcep/server/ctl/pom.xml
+++ b/protocols/pcep/server/ctl/pom.xml
@@ -55,6 +55,26 @@
<artifactId>onos-core-serializers</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-api</artifactId>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-incubator-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-pcep-server-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
</dependencies>
<build>
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PceLabelStoreAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/api/PceLabelStoreAdapter.java
similarity index 91%
rename from protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PceLabelStoreAdapter.java
rename to protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/api/PceLabelStoreAdapter.java
index 23ed95f..598fb78 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/PceLabelStoreAdapter.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/api/PceLabelStoreAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,22 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.pcelabelstore.util;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+package org.onosproject.pcelabelstore.api;
import org.onosproject.incubator.net.resource.label.LabelResourceId;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link;
-import org.onosproject.pcelabelstore.api.LspLocalLabelInfo;
-import org.onosproject.pcelabelstore.api.PceLabelStore;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.stream.Collectors;
/**
* Provides test implementation of PceStore.
@@ -89,14 +87,14 @@
@Override
public Map<DeviceId, LabelResourceId> getGlobalNodeLabels() {
- return globalNodeLabelMap.entrySet().stream()
- .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()));
+ return globalNodeLabelMap.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()));
}
@Override
public Map<Link, LabelResourceId> getAdjLabels() {
- return adjLabelMap.entrySet().stream()
- .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()));
+ return adjLabelMap.entrySet().stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()));
}
@Override
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java
index 7b3a92c..856c1fd 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java
@@ -15,49 +15,50 @@
*/
package org.onosproject.pcelabelstore.label;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.hamcrest.Matchers.nullValue;
-import static org.onosproject.net.Link.Type.DIRECT;
-import java.util.Iterator;
-import java.util.List;
-import java.util.LinkedList;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onlab.graph.ScalarWeight;
import org.onlab.packet.IpAddress;
import org.onosproject.core.GroupId;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
-import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint;
-import org.onosproject.incubator.net.tunnel.TunnelName;
-import org.onosproject.incubator.net.tunnel.TunnelId;
-import org.onosproject.incubator.net.tunnel.DefaultTunnel;
+import org.onosproject.incubator.net.resource.label.LabelResourceAdapter;
import org.onosproject.incubator.net.resource.label.LabelResourceId;
import org.onosproject.incubator.net.resource.label.LabelResourceService;
+import org.onosproject.incubator.net.tunnel.DefaultTunnel;
+import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint;
+import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.TunnelEndPoint;
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.incubator.net.tunnel.TunnelName;
import org.onosproject.net.AnnotationKeys;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.DefaultDevice;
+import org.onosproject.net.DefaultLink;
import org.onosproject.net.DefaultPath;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
+import org.onosproject.net.Link;
import org.onosproject.net.Path;
+import org.onosproject.net.PortNumber;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.pcelabelstore.api.LspLocalLabelInfo;
import org.onosproject.pcelabelstore.api.PceLabelStore;
-import org.onosproject.pcelabelstore.util.LabelResourceAdapter;
+import org.onosproject.pcelabelstore.api.PceLabelStoreAdapter;
import org.onosproject.pcelabelstore.util.MockDeviceService;
-import org.onosproject.pcelabelstore.util.PceLabelStoreAdapter;
import org.onosproject.pcep.server.impl.BasicPceccHandler;
import org.onosproject.pcep.server.impl.PcepClientControllerImpl;
-import org.onosproject.net.DefaultLink;
-import org.onosproject.net.Link;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.nullValue;
+import static org.onosproject.net.Link.Type.DIRECT;
/**
* Unit tests for BasicPceccHandler class.
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java
index a9bc3bc..cf832c4 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java
@@ -15,22 +15,14 @@
*/
package org.onosproject.pcelabelstore.label;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.hamcrest.Matchers.nullValue;
-import static org.onosproject.net.Link.Type.DIRECT;
-import java.util.Iterator;
-import java.util.List;
-import java.util.LinkedList;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onlab.graph.ScalarWeight;
import org.onlab.packet.IpAddress;
-import org.onosproject.incubator.net.resource.label.LabelResourceId;
+import org.onosproject.incubator.net.resource.label.LabelResourceAdapter;
import org.onosproject.incubator.net.resource.label.LabelResourceAdminService;
+import org.onosproject.incubator.net.resource.label.LabelResourceId;
import org.onosproject.incubator.net.resource.label.LabelResourceService;
import org.onosproject.incubator.net.tunnel.LabelStack;
import org.onosproject.net.AnnotationKeys;
@@ -38,25 +30,34 @@
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.DefaultDevice;
+import org.onosproject.net.DefaultLink;
import org.onosproject.net.DefaultPath;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
+import org.onosproject.net.Link;
import org.onosproject.net.Path;
+import org.onosproject.net.PortNumber;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.pcelabelstore.api.PceLabelStore;
-import org.onosproject.pcelabelstore.util.LabelResourceAdapter;
+import org.onosproject.pcelabelstore.api.PceLabelStoreAdapter;
import org.onosproject.pcelabelstore.util.MockDeviceService;
import org.onosproject.pcelabelstore.util.MockNetConfigRegistryAdapter;
import org.onosproject.pcelabelstore.util.MockPcepClientController;
-import org.onosproject.pcelabelstore.util.PceLabelStoreAdapter;
-import org.onosproject.pcelabelstore.util.PcepClientAdapter;
+import org.onosproject.pcep.server.PcepClientAdapter;
import org.onosproject.pcep.api.DeviceCapability;
import org.onosproject.pcep.server.PccId;
import org.onosproject.pcep.server.impl.PceccSrTeBeHandler;
import org.onosproject.pcepio.protocol.PcepVersion;
-import org.onosproject.net.DefaultLink;
-import org.onosproject.net.Link;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.nullValue;
+import static org.onosproject.net.Link.Type.DIRECT;
/**
* Unit tests for PceccSrTeBeHandler class.
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/ConsistentMapAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/ConsistentMapAdapter.java
deleted file mode 100644
index 8111693..0000000
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/ConsistentMapAdapter.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.pcelabelstore.util;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Executor;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-import java.util.function.Predicate;
-
-import org.onosproject.store.service.ConsistentMap;
-import org.onosproject.store.service.DistributedPrimitive;
-import org.onosproject.store.service.MapEventListener;
-import org.onosproject.store.service.Versioned;
-
-/**
- * Testing adapter for the consistent map.
- */
-public class ConsistentMapAdapter<K, V> implements ConsistentMap<K, V> {
-
- @Override
- public String name() {
- return null;
- }
-
- @Override
- public DistributedPrimitive.Type primitiveType() {
- return DistributedPrimitive.Type.CONSISTENT_MAP;
- }
-
- @Override
- public int size() {
- return 0;
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- @Override
- public boolean containsKey(K key) {
- return false;
- }
-
- @Override
- public boolean containsValue(V value) {
- return false;
- }
-
- @Override
- public Versioned<V> get(K key) {
- return null;
- }
-
- @Override
- public Versioned<V> getOrDefault(K key, V defaultValue) {
- return null;
- }
-
- @Override
- public Versioned<V> computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
- return null;
- }
-
- @Override
- public Versioned<V> compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
- return null;
- }
-
- @Override
- public Versioned<V> computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
- return null;
- }
-
- @Override
- public Versioned<V> computeIf(K key, Predicate<? super V> condition,
- BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
- return null;
- }
-
- @Override
- public Versioned<V> put(K key, V value) {
- return null;
- }
-
- @Override
- public Versioned<V> putAndGet(K key, V value) {
- return null;
- }
-
- @Override
- public Versioned<V> remove(K key) {
- return null;
- }
-
- @Override
- public void clear() {
-
- }
-
- @Override
- public Set<K> keySet() {
- return null;
- }
-
- @Override
- public Collection<Versioned<V>> values() {
- return null;
- }
-
- @Override
- public Set<Map.Entry<K, Versioned<V>>> entrySet() {
- return null;
- }
-
- @Override
- public Versioned<V> putIfAbsent(K key, V value) {
- return null;
- }
-
- @Override
- public boolean remove(K key, V value) {
- return false;
- }
-
- @Override
- public boolean remove(K key, long version) {
- return false;
- }
-
- @Override
- public Versioned replace(K key, V value) {
- return null;
- }
-
- @Override
- public boolean replace(K key, V oldValue, V newValue) {
- return false;
- }
-
- @Override
- public boolean replace(K key, long oldVersion, V newValue) {
- return false;
- }
-
- @Override
- public void addListener(MapEventListener<K, V> listener, Executor executor) {
-
- }
-
- @Override
- public void removeListener(MapEventListener<K, V> listener) {
-
- }
-
- @Override
- public Map<K, V> asJavaMap() {
- return null;
- }
-}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/DistributedSetAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/DistributedSetAdapter.java
deleted file mode 100644
index ae457b1..0000000
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/DistributedSetAdapter.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.pcelabelstore.util;
-
-import java.util.Collection;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-
-import org.onosproject.store.service.AsyncDistributedSet;
-import org.onosproject.store.service.SetEventListener;
-
-/**
- * Testing adapter for the distributed set.
- */
-public class DistributedSetAdapter<E> implements AsyncDistributedSet<E> {
- @Override
- public CompletableFuture<Void> addListener(SetEventListener<E> listener) {
- return null;
- }
-
- @Override
- public CompletableFuture<Void> removeListener(SetEventListener<E> listener) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> add(E element) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> remove(E element) {
- return null;
- }
-
- @Override
- public CompletableFuture<Integer> size() {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> isEmpty() {
- return null;
- }
-
- @Override
- public CompletableFuture<Void> clear() {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> contains(E element) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> addAll(Collection<? extends E> c) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> containsAll(Collection<? extends E> c) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> retainAll(Collection<? extends E> c) {
- return null;
- }
-
- @Override
- public CompletableFuture<Boolean> removeAll(Collection<? extends E> c) {
- return null;
- }
-
- @Override
- public CompletableFuture<? extends Set<E>> getAsImmutableSet() {
- return null;
- }
-
- @Override
- public String name() {
- return null;
- }
-}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/EventuallyConsistentMapAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/EventuallyConsistentMapAdapter.java
deleted file mode 100644
index c030369..0000000
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/EventuallyConsistentMapAdapter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.pcelabelstore.util;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.function.BiFunction;
-
-import org.onosproject.store.service.EventuallyConsistentMap;
-import org.onosproject.store.service.EventuallyConsistentMapListener;
-
-/**
- * Testing adapter for EventuallyConsistentMap.
- */
-public class EventuallyConsistentMapAdapter<K, V> implements EventuallyConsistentMap<K, V> {
-
- @Override
- public String name() {
- return null;
- }
-
- @Override
- public Type primitiveType() {
- return Type.EVENTUALLY_CONSISTENT_MAP;
- }
-
- @Override
- public int size() {
- return 0;
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- @Override
- public boolean containsKey(K key) {
- return false;
- }
-
- @Override
- public boolean containsValue(V value) {
- return false;
- }
-
- @Override
- public V get(K key) {
- return null;
- }
-
- @Override
- public void put(K key, V value) {
-
- }
-
- @Override
- public V remove(K key) {
- return null;
- }
-
- @Override
- public void remove(K key, V value) {
-
- }
-
- @Override
- public V compute(K key, BiFunction<K, V, V> recomputeFunction) {
- return null;
- }
-
- @Override
- public void putAll(Map<? extends K, ? extends V> m) {
-
- }
-
- @Override
- public void clear() {
-
- }
-
- @Override
- public Set<K> keySet() {
- return null;
- }
-
- @Override
- public Collection<V> values() {
- return null;
- }
-
- @Override
- public Set<Map.Entry<K, V>> entrySet() {
- return null;
- }
-
- @Override
- public void addListener(EventuallyConsistentMapListener<K, V> listener) {
-
- }
-
- @Override
- public void removeListener(EventuallyConsistentMapListener<K, V> listener) {
-
- }
-
- @Override
- public CompletableFuture<Void> destroy() {
- return CompletableFuture.completedFuture(null);
- }
-}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockDeviceService.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockDeviceService.java
index 5ff1f54..298fd39 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockDeviceService.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockDeviceService.java
@@ -15,23 +15,18 @@
*/
package org.onosproject.pcelabelstore.util;
+import org.onosproject.net.Device;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.device.DeviceListener;
+import org.onosproject.net.device.DeviceServiceAdapter;
+
import java.util.LinkedList;
import java.util.List;
-import org.onosproject.net.device.DeviceListener;
-import org.onosproject.net.device.PortStatistics;
-import org.onosproject.net.Device;
-import org.onosproject.net.Device.Type;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.MastershipRole;
-import org.onosproject.net.Port;
-import org.onosproject.net.PortNumber;
-import org.onosproject.net.device.DeviceService;
-
/**
* Test fixture for the device service.
*/
-public class MockDeviceService implements DeviceService {
+public class MockDeviceService extends DeviceServiceAdapter {
private List<Device> devices = new LinkedList<>();
private DeviceListener listener;
@@ -79,81 +74,4 @@
public DeviceListener getListener() {
return listener;
}
-
- @Override
- public void removeListener(DeviceListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public int getDeviceCount() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public Iterable<Device> getDevices() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Iterable<Device> getDevices(Type type) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Iterable<Device> getAvailableDevices(Type type) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public MastershipRole getRole(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<Port> getPorts(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<PortStatistics> getPortStatistics(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Port getPort(DeviceId deviceId, PortNumber portNumber) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isAvailable(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public String localStatus(DeviceId deviceId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public long getLastUpdatedInstant(DeviceId deviceId) {
- return 0;
- }
}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockNetConfigRegistryAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockNetConfigRegistryAdapter.java
index 785900b..b5a67fb 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockNetConfigRegistryAdapter.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/MockNetConfigRegistryAdapter.java
@@ -15,27 +15,22 @@
*/
package org.onosproject.pcelabelstore.util;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.config.Config;
-import org.onosproject.net.config.ConfigApplyDelegate;
-import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigListener;
-import org.onosproject.net.config.NetworkConfigRegistry;
-import org.onosproject.net.config.NetworkConfigService;
-import org.onosproject.net.config.SubjectFactory;
-import org.onosproject.pcep.api.DeviceCapability;
-
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.config.Config;
+import org.onosproject.net.config.ConfigApplyDelegate;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigRegistryAdapter;
+import org.onosproject.pcep.api.DeviceCapability;
+
+import java.util.HashMap;
+import java.util.Map;
/* Mock test for network config registry. */
-public class MockNetConfigRegistryAdapter implements NetworkConfigService, NetworkConfigRegistry {
+public class MockNetConfigRegistryAdapter extends NetworkConfigRegistryAdapter {
private ConfigFactory cfgFactory;
private Map<DeviceId, DeviceCapability> classConfig = new HashMap<>();
@@ -90,105 +85,4 @@
}
}
- @Override
- public void addListener(NetworkConfigListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void removeListener(NetworkConfigListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Set<ConfigFactory> getConfigFactories() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S, C extends Config<S>> Set<ConfigFactory<S, C>> getConfigFactories(Class<S> subjectClass) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S, C extends Config<S>> ConfigFactory<S, C> getConfigFactory(Class<C> configClass) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Set<Class> getSubjectClasses() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public SubjectFactory getSubjectFactory(String subjectClassKey) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public SubjectFactory getSubjectFactory(Class subjectClass) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Class<? extends Config> getConfigClass(String subjectClassKey, String configKey) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S> Set<S> getSubjects(Class<S> subjectClass) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S, C extends Config<S>> Set<S> getSubjects(Class<S> subjectClass, Class<C> configClass) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S> Set<? extends Config<S>> getConfigs(S subject) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S, C extends Config<S>> C applyConfig(S subject, Class<C> configClass, JsonNode json) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S, C extends Config<S>> C applyConfig(String subjectClassKey, S subject, String configKey, JsonNode json) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <S> void removeConfig(String subjectClassKey, S subject, String configKey) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public <S> void removeConfig(S subject) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public <S> void removeConfig() {
- // TODO Auto-generated method stub
-
- }
}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/StorageServiceAdapter.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/StorageServiceAdapter.java
deleted file mode 100644
index fed4cab..0000000
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/StorageServiceAdapter.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.pcelabelstore.util;
-
-import org.onosproject.store.service.AsyncDocumentTree;
-import org.onosproject.store.service.AsyncConsistentMultimap;
-import org.onosproject.store.service.AsyncConsistentTreeMap;
-import org.onosproject.store.service.AtomicCounterBuilder;
-import org.onosproject.store.service.AtomicCounterMapBuilder;
-import org.onosproject.store.service.AtomicIdGeneratorBuilder;
-import org.onosproject.store.service.AtomicValueBuilder;
-import org.onosproject.store.service.ConsistentMapBuilder;
-import org.onosproject.store.service.ConsistentMultimapBuilder;
-import org.onosproject.store.service.ConsistentTreeMapBuilder;
-import org.onosproject.store.service.DistributedLockBuilder;
-import org.onosproject.store.service.DistributedSetBuilder;
-import org.onosproject.store.service.DocumentTreeBuilder;
-import org.onosproject.store.service.EventuallyConsistentMapBuilder;
-import org.onosproject.store.service.LeaderElectorBuilder;
-import org.onosproject.store.service.Serializer;
-import org.onosproject.store.service.StorageService;
-import org.onosproject.store.service.Topic;
-import org.onosproject.store.service.TopicBuilder;
-import org.onosproject.store.service.TransactionContextBuilder;
-import org.onosproject.store.service.WorkQueue;
-
-/**
- * Adapter for the storage service.
- */
-public class StorageServiceAdapter implements StorageService {
- @Override
- public <K, V> EventuallyConsistentMapBuilder<K, V> eventuallyConsistentMapBuilder() {
- return null;
- }
-
- @Override
- public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
- return null;
- }
-
- @Override
- public <V> DocumentTreeBuilder<V> documentTreeBuilder() {
- return null;
- }
-
- @Override
- public <E> DistributedSetBuilder<E> setBuilder() {
- return null;
- }
-
- @Override
- public AtomicCounterBuilder atomicCounterBuilder() {
- return null;
- }
-
- @Override
- public AtomicIdGeneratorBuilder atomicIdGeneratorBuilder() {
- return null;
- }
-
- @Override
- public <V> AtomicValueBuilder<V> atomicValueBuilder() {
- return null;
- }
-
- @Override
- public TransactionContextBuilder transactionContextBuilder() {
- return null;
- }
-
- @Override
- public DistributedLockBuilder lockBuilder() {
- return null;
- }
-
- @Override
- public LeaderElectorBuilder leaderElectorBuilder() {
- return null;
- }
-
- @Override
- public <T> TopicBuilder<T> topicBuilder() {
- return null;
- }
-
- @Override
- public <E> WorkQueue<E> getWorkQueue(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <K, V> AsyncConsistentMultimap<K, V> getAsyncSetMultimap(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <V> AsyncConsistentTreeMap<V> getAsyncTreeMap(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <T> Topic<T> getTopic(String name, Serializer serializer) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <V> ConsistentTreeMapBuilder<V> consistentTreeMapBuilder() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <V> AsyncDocumentTree<V> getDocumentTree(String name, Serializer serializer) {
- return null;
- }
-
- public <K, V> ConsistentMultimapBuilder<K, V> consistentMultimapBuilder() {
- return null;
- }
-
- @Override
- public <K> AtomicCounterMapBuilder<K> atomicCounterMapBuilder() {
- return null;
- }
-}
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestConsistentMap.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestConsistentMap.java
index b67cdc9..4c02ba9 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestConsistentMap.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestConsistentMap.java
@@ -32,6 +32,7 @@
import org.onosproject.store.primitives.ConsistentMapBackedJavaMap;
import org.onosproject.store.service.AsyncConsistentMap;
import org.onosproject.store.service.ConsistentMap;
+import org.onosproject.store.service.ConsistentMapAdapter;
import org.onosproject.store.service.ConsistentMapBuilder;
import org.onosproject.store.service.MapEvent;
import org.onosproject.store.service.MapEventListener;
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestDistributedSet.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestDistributedSet.java
index 011aa08..aa4468a 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestDistributedSet.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestDistributedSet.java
@@ -21,6 +21,7 @@
import org.onosproject.store.primitives.DefaultDistributedSet;
import org.onosproject.store.service.AsyncDistributedSet;
import org.onosproject.store.service.DistributedSet;
+import org.onosproject.store.service.DistributedSetAdapter;
import org.onosproject.store.service.DistributedSetBuilder;
import org.onosproject.store.service.SetEvent;
import org.onosproject.store.service.SetEventListener;
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestEventuallyConsistentMap.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestEventuallyConsistentMap.java
index 9184352..7872355 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestEventuallyConsistentMap.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestEventuallyConsistentMap.java
@@ -30,6 +30,7 @@
import org.onosproject.cluster.NodeId;
import org.onosproject.store.Timestamp;
import org.onosproject.store.service.EventuallyConsistentMap;
+import org.onosproject.store.service.EventuallyConsistentMapAdapter;
import org.onosproject.store.service.EventuallyConsistentMapBuilder;
import org.onosproject.store.service.EventuallyConsistentMapEvent;
import org.onosproject.store.service.EventuallyConsistentMapListener;
diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestStorageService.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestStorageService.java
index 84ae028..cc09bef 100644
--- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestStorageService.java
+++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/util/TestStorageService.java
@@ -15,20 +15,14 @@
*/
package org.onosproject.pcelabelstore.util;
-import org.onosproject.store.service.AsyncConsistentMultimap;
-import org.onosproject.store.service.AsyncConsistentTreeMap;
-import org.onosproject.store.service.AsyncDocumentTree;
import org.onosproject.store.service.AtomicCounterBuilder;
import org.onosproject.store.service.AtomicValueBuilder;
import org.onosproject.store.service.ConsistentMapBuilder;
import org.onosproject.store.service.ConsistentMultimapBuilder;
import org.onosproject.store.service.DistributedSetBuilder;
import org.onosproject.store.service.EventuallyConsistentMapBuilder;
-import org.onosproject.store.service.LeaderElectorBuilder;
-import org.onosproject.store.service.Serializer;
-import org.onosproject.store.service.Topic;
+import org.onosproject.store.service.StorageServiceAdapter;
import org.onosproject.store.service.TransactionContextBuilder;
-import org.onosproject.store.service.WorkQueue;
public class TestStorageService extends StorageServiceAdapter {
@@ -68,33 +62,4 @@
throw new UnsupportedOperationException("transactionContextBuilder");
}
- @Override
- public LeaderElectorBuilder leaderElectorBuilder() {
- return null;
- }
-
- @Override
- public <E> WorkQueue<E> getWorkQueue(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <K, V> AsyncConsistentMultimap<K, V> getAsyncSetMultimap(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <V> AsyncConsistentTreeMap<V> getAsyncTreeMap(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <T> Topic<T> getTopic(String name, Serializer serializer) {
- return null;
- }
-
- @Override
- public <V> AsyncDocumentTree<V> getDocumentTree(String name, Serializer serializer) {
- return null;
- }
}
diff --git a/providers/pcep/topology/BUCK b/providers/pcep/topology/BUCK
index dbb033a..2299326 100644
--- a/providers/pcep/topology/BUCK
+++ b/providers/pcep/topology/BUCK
@@ -13,6 +13,13 @@
'//lib:netty',
]
+TEST_DEPS = [
+ '//lib:TEST',
+ '//protocols/pcep/server/api:onos-protocols-pcep-server-api-tests',
+ '//apps/pcep-api:onos-apps-pcep-api-tests',
+]
+
osgi_jar_with_tests (
deps = COMPILE_DEPS,
+ test_deps = TEST_DEPS,
)
diff --git a/providers/pcep/topology/pom.xml b/providers/pcep/topology/pom.xml
index c7f6e46..583615f 100644
--- a/providers/pcep/topology/pom.xml
+++ b/providers/pcep/topology/pom.xml
@@ -43,5 +43,19 @@
<artifactId>onos-optical-model</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-pcep-server-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-apps-pcep-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientAdapter.java b/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientAdapter.java
deleted file mode 100644
index 5174091..0000000
--- a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientAdapter.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.provider.pcep.topology.impl;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.RejectedExecutionException;
-
-import org.jboss.netty.channel.Channel;
-import org.onosproject.pcep.server.ClientCapability;
-import org.onosproject.pcep.server.PccId;
-import org.onosproject.pcep.server.LspKey;
-import org.onosproject.pcep.server.PcepClient;
-import org.onosproject.pcep.server.PcepSyncStatus;
-import org.onosproject.pcepio.protocol.PcepFactories;
-import org.onosproject.pcepio.protocol.PcepFactory;
-import org.onosproject.pcepio.protocol.PcepMessage;
-import org.onosproject.pcepio.protocol.PcepStateReport;
-import org.onosproject.pcepio.protocol.PcepVersion;
-
-/**
- * Representation of PCEP client adapter.
- */
-public class PcepClientAdapter implements PcepClient {
-
- private Channel channel;
- protected String channelId;
-
- private boolean connected;
- private PccId pccId;
- private ClientCapability capability;
-
- private PcepVersion pcepVersion;
- private PcepSyncStatus lspDbSyncStatus;
- private PcepSyncStatus labelDbSyncStatus;
- private Map<LspKey, Boolean> lspDelegationInfo = new HashMap<>();
-
- /**
- * Initialize instance with specified parameters.
- *
- * @param pccId PCC id
- * @param pcepVersion PCEP message version
- */
- public void init(PccId pccId, PcepVersion pcepVersion) {
- this.pccId = pccId;
- this.pcepVersion = pcepVersion;
- }
-
- @Override
- public final void disconnectClient() {
- this.channel.close();
- }
-
- @Override
- public final void sendMessage(PcepMessage m) {
- }
-
- @Override
- public final void sendMessage(List<PcepMessage> msgs) {
- try {
- PcepMessage pcepMsg = msgs.get(0);
- assertNotNull("PCEP MSG should be created.", pcepMsg);
- } catch (RejectedExecutionException e) {
- throw e;
- }
- }
-
- @Override
- public final boolean isConnected() {
- return this.connected;
- }
-
- @Override
- public String channelId() {
- return channelId;
- }
-
- @Override
- public final PccId getPccId() {
- return this.pccId;
- }
-
- @Override
- public final String getStringId() {
- return this.pccId.toString();
- }
-
- @Override
- public final void handleMessage(PcepMessage m) {
- }
-
- @Override
- public boolean isOptical() {
- return false;
- }
-
- @Override
- public PcepFactory factory() {
- return PcepFactories.getFactory(pcepVersion);
- }
-
- @Override
- public void setLspDbSyncStatus(PcepSyncStatus syncStatus) {
- this.lspDbSyncStatus = syncStatus;
- }
-
- @Override
- public PcepSyncStatus lspDbSyncStatus() {
- return lspDbSyncStatus;
- }
-
- @Override
- public void setLabelDbSyncStatus(PcepSyncStatus syncStatus) {
- this.labelDbSyncStatus = syncStatus;
- }
-
- @Override
- public PcepSyncStatus labelDbSyncStatus() {
- return labelDbSyncStatus;
- }
-
- @Override
- public void setCapability(ClientCapability capability) {
- this.capability = capability;
- }
-
- @Override
- public ClientCapability capability() {
- return capability;
- }
-
- @Override
- public void addNode(PcepClient pc) {
- }
-
- @Override
- public void deleteNode(PccId pccId) {
- }
-
- @Override
- public void setLspAndDelegationInfo(LspKey lspKey, boolean dFlag) {
- lspDelegationInfo.put(lspKey, dFlag);
- }
-
- @Override
- public Boolean delegationInfo(LspKey lspKey) {
- return lspDelegationInfo.get(lspKey);
- }
-
- @Override
- public void initializeSyncMsgList(PccId pccId) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public List<PcepStateReport> getSyncMsgList(PccId pccId) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void removeSyncMsgList(PccId pccId) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepTopologyProviderTest.java b/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepTopologyProviderTest.java
index 991122d..84231e0 100644
--- a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepTopologyProviderTest.java
+++ b/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepTopologyProviderTest.java
@@ -12,15 +12,10 @@
*/
package org.onosproject.provider.pcep.topology.impl;
-import static org.onosproject.net.Link.State.ACTIVE;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -50,18 +45,24 @@
import org.onosproject.net.link.LinkProviderService;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.pcep.api.DeviceCapability;
+import org.onosproject.pcep.api.PcepControllerAdapter;
import org.onosproject.pcep.server.ClientCapability;
import org.onosproject.pcep.server.PccId;
import org.onosproject.pcep.server.PcepClient;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
import org.onosproject.pcep.server.PcepNodeListener;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.nullValue;
+import static org.onosproject.net.Link.State.ACTIVE;
/**
* Test for PCEP topology provider.
*/
diff --git a/providers/pcep/tunnel/BUCK b/providers/pcep/tunnel/BUCK
index c230490..94bbc5e 100644
--- a/providers/pcep/tunnel/BUCK
+++ b/providers/pcep/tunnel/BUCK
@@ -14,6 +14,9 @@
'//lib:TEST_ADAPTERS',
'//lib:netty',
'//lib:netty-transport',
+ '//protocols/pcep/server/api:onos-protocols-pcep-server-api-tests',
+ '//apps/pcep-api:onos-apps-pcep-api-tests',
+ '//incubator/api:onos-incubator-api-tests',
]
osgi_jar_with_tests (
diff --git a/providers/pcep/tunnel/pom.xml b/providers/pcep/tunnel/pom.xml
index ce2871d..46f98ec 100644
--- a/providers/pcep/tunnel/pom.xml
+++ b/providers/pcep/tunnel/pom.xml
@@ -53,5 +53,26 @@
<artifactId>onos-pcep-server-impl</artifactId>
<version>${project.version} </version>
</dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-pcep-server-api</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-apps-pcep-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-incubator-api</artifactId>
+ <classifier>tests</classifier>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientAdapter.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientAdapter.java
deleted file mode 100644
index e96a2e2..0000000
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientAdapter.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.provider.pcep.tunnel.impl;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.RejectedExecutionException;
-
-import org.jboss.netty.channel.Channel;
-import org.onosproject.pcep.server.ClientCapability;
-import org.onosproject.pcep.server.LspKey;
-import org.onosproject.pcep.server.PccId;
-import org.onosproject.pcep.server.PcepClient;
-import org.onosproject.pcep.server.PcepSyncStatus;
-import org.onosproject.pcepio.protocol.PcepFactories;
-import org.onosproject.pcepio.protocol.PcepFactory;
-import org.onosproject.pcepio.protocol.PcepMessage;
-import org.onosproject.pcepio.protocol.PcepStateReport;
-import org.onosproject.pcepio.protocol.PcepVersion;
-
-/**
- * Representation of PCEP client adapter.
- */
-public class PcepClientAdapter implements PcepClient {
-
- private Channel channel;
- protected String channelId;
-
- private boolean connected;
- private PccId pccId;
- private ClientCapability capability;
-
- private PcepVersion pcepVersion;
- private PcepSyncStatus lspDbSyncStatus;
- private PcepSyncStatus labelDbSyncStatus;
- private Map<LspKey, Boolean> lspDelegationInfo = new HashMap<>();
- private Map<PccId, List<PcepStateReport>> sycRptCache = new HashMap<>();
-
- /**
- * Initialize instance with specified parameters.
- *
- * @param pccId PCC id
- * @param pcepVersion PCEP message version
- */
- public void init(PccId pccId, PcepVersion pcepVersion) {
- this.pccId = pccId;
- this.pcepVersion = pcepVersion;
- }
-
- @Override
- public final void disconnectClient() {
- this.channel.close();
- }
-
- @Override
- public final void sendMessage(PcepMessage m) {
- }
-
- @Override
- public final void sendMessage(List<PcepMessage> msgs) {
- try {
- PcepMessage pcepMsg = msgs.get(0);
- assertNotNull("PCEP MSG should be created.", pcepMsg);
- } catch (RejectedExecutionException e) {
- throw e;
- }
- }
-
- @Override
- public final boolean isConnected() {
- return this.connected;
- }
-
- @Override
- public String channelId() {
- return channelId;
- }
-
- @Override
- public final PccId getPccId() {
- return this.pccId;
- }
-
- @Override
- public final String getStringId() {
- return this.pccId.toString();
- }
-
- @Override
- public final void handleMessage(PcepMessage m) {
- }
-
- @Override
- public boolean isOptical() {
- return false;
- }
-
- @Override
- public PcepFactory factory() {
- return PcepFactories.getFactory(pcepVersion);
- }
-
- @Override
- public void setLspDbSyncStatus(PcepSyncStatus syncStatus) {
- this.lspDbSyncStatus = syncStatus;
- }
-
- @Override
- public PcepSyncStatus lspDbSyncStatus() {
- return lspDbSyncStatus;
- }
-
- @Override
- public void setLabelDbSyncStatus(PcepSyncStatus syncStatus) {
- this.labelDbSyncStatus = syncStatus;
- }
-
- @Override
- public PcepSyncStatus labelDbSyncStatus() {
- return labelDbSyncStatus;
- }
-
- @Override
- public void setCapability(ClientCapability capability) {
- this.capability = capability;
- }
-
- @Override
- public ClientCapability capability() {
- return capability;
- }
-
- @Override
- public void addNode(PcepClient pc) {
- }
-
- @Override
- public void deleteNode(PccId pccId) {
- }
-
- @Override
- public void setLspAndDelegationInfo(LspKey lspKey, boolean dFlag) {
- lspDelegationInfo.put(lspKey, dFlag);
- }
-
- @Override
- public Boolean delegationInfo(LspKey lspKey) {
- return lspDelegationInfo.get(lspKey);
- }
-
- @Override
- public void initializeSyncMsgList(PccId pccId) {
- List<PcepStateReport> rptMsgList = new LinkedList<>();
- sycRptCache.put(pccId, rptMsgList);
- }
-
- @Override
- public List<PcepStateReport> getSyncMsgList(PccId pccId) {
- return sycRptCache.get(pccId);
- }
-
- @Override
- public void removeSyncMsgList(PccId pccId) {
- sycRptCache.remove(pccId);
- }
-
- @Override
- public void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg) {
- List<PcepStateReport> rptMsgList = sycRptCache.get(pccId);
- rptMsgList.add(rptMsg);
- sycRptCache.put(pccId, rptMsgList);
- }
-}
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java
deleted file mode 100644
index 6d582a0..0000000
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.provider.pcep.tunnel.impl;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.onosproject.incubator.net.tunnel.DefaultLabelStack;
-import org.onosproject.incubator.net.tunnel.LabelStack;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.net.Path;
-import org.onosproject.pcep.server.PccId;
-import org.onosproject.pcep.server.PcepClient;
-import org.onosproject.pcep.server.PcepClientController;
-import org.onosproject.pcep.server.PcepClientListener;
-import org.onosproject.pcep.server.PcepEventListener;
-import org.onosproject.pcep.server.PcepNodeListener;
-import org.onosproject.pcep.server.driver.PcepAgent;
-import org.onosproject.pcepio.protocol.PcepError;
-import org.onosproject.pcepio.protocol.PcepErrorInfo;
-import org.onosproject.pcepio.protocol.PcepErrorMsg;
-import org.onosproject.pcepio.protocol.PcepErrorObject;
-import org.onosproject.pcepio.protocol.PcepFactory;
-import org.onosproject.pcepio.protocol.PcepMessage;
-import org.onosproject.pcepio.protocol.PcepVersion;
-import org.onosproject.pcepio.types.PcepValueType;
-
-import com.google.common.collect.Sets;
-
-import static org.onosproject.pcepio.types.PcepErrorDetailInfo.ERROR_TYPE_19;
-import static org.onosproject.pcepio.types.PcepErrorDetailInfo.ERROR_VALUE_5;
-
-/**
- * Representation of PCEP client controller adapter.
- */
-public class PcepClientControllerAdapter implements PcepClientController {
-
- protected ConcurrentHashMap<PccId, PcepClient> connectedClients =
- new ConcurrentHashMap<PccId, PcepClient>();
-
- protected PcepClientAgent agent = new PcepClientAgent();
- protected Set<PcepClientListener> pcepClientListener = new HashSet<>();
-
- protected Set<PcepEventListener> pcepEventListener = Sets.newHashSet();
- public Set<PcepNodeListener> pcepNodeListener = Sets.newHashSet();
-
- @Activate
- public void activate() {
- }
-
- @Deactivate
- public void deactivate() {
- }
-
- @Override
- public Collection<PcepClient> getClients() {
- return connectedClients.values();
- }
-
- @Override
- public PcepClient getClient(PccId pccId) {
- if (connectedClients.get(pccId) != null) {
- return connectedClients.get(pccId);
- }
- PcepClientAdapter pc = new PcepClientAdapter();
-
- pc.init(PccId.pccId(pccId.ipAddress()), PcepVersion.PCEP_1);
- connectedClients.put(pccId, pc);
- return pc;
- }
-
- @Override
- public void addListener(PcepClientListener listener) {
- if (!pcepClientListener.contains(listener)) {
- this.pcepClientListener.add(listener);
- }
- }
-
- @Override
- public void addNodeListener(PcepNodeListener listener) {
- pcepNodeListener.add(listener);
- }
-
- @Override
- public void removeNodeListener(PcepNodeListener listener) {
- pcepNodeListener.remove(listener);
- }
-
- @Override
- public void removeListener(PcepClientListener listener) {
- this.pcepClientListener.remove(listener);
- }
-
- @Override
- public void addEventListener(PcepEventListener listener) {
- pcepEventListener.add(listener);
- }
-
- @Override
- public void removeEventListener(PcepEventListener listener) {
- pcepEventListener.remove(listener);
- }
-
- @Override
- public void writeMessage(PccId pccId, PcepMessage msg) {
- this.getClient(pccId).sendMessage(msg);
- }
-
- @Override
- public void processClientMessage(PccId pccId, PcepMessage msg) {
-
- PcepClient pc = getClient(pccId);
-
- switch (msg.getType()) {
- case NONE:
- break;
- case OPEN:
- break;
- case KEEP_ALIVE:
- //log.debug("Sending Keep Alive Message to {" + pccIpAddress.toString() + "}");
- pc.sendMessage(Collections.singletonList(pc.factory().buildKeepaliveMsg().build()));
- break;
- case PATH_COMPUTATION_REQUEST:
- break;
- case PATH_COMPUTATION_REPLY:
- break;
- case NOTIFICATION:
- break;
- case ERROR:
- break;
- case CLOSE:
- //log.debug("Sending Close Message to { }", pccIpAddress.toString());
- pc.sendMessage(Collections.singletonList(pc.factory().buildCloseMsg().build()));
- break;
- case INITIATE:
- if (!pc.capability().pcInstantiationCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case REPORT:
- //Only update the listener if respective capability is supported else send PCEP-ERR msg
- if (pc.capability().statefulPceCapability()) {
- for (PcepEventListener l : pcepEventListener) {
- l.handleMessage(pccId, msg);
- }
- } else {
- // Send PCEP-ERROR message.
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case UPDATE:
- if (!pc.capability().statefulPceCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case LABEL_UPDATE:
- if (!pc.capability().pceccCapability()) {
- pc.sendMessage(Collections.singletonList(getErrMsg(pc.factory(),
- ERROR_TYPE_19, ERROR_VALUE_5)));
- }
- break;
- case MAX:
- break;
- case END:
- break;
- default:
- break;
- }
- }
-
- @Override
- public void closeConnectedClients() {
- PcepClient pc;
- for (PccId id : connectedClients.keySet()) {
- pc = getClient(id);
- pc.disconnectClient();
- }
- }
-
- private PcepErrorMsg getErrMsg(PcepFactory factory, byte errorType, byte errorValue) {
- LinkedList<PcepError> llPcepErr = new LinkedList<>();
-
- LinkedList<PcepErrorObject> llerrObj = new LinkedList<>();
- PcepErrorMsg errMsg;
-
- PcepErrorObject errObj = factory.buildPcepErrorObject().setErrorValue(errorValue).setErrorType(errorType)
- .build();
-
- llerrObj.add(errObj);
- PcepError pcepErr = factory.buildPcepError().setErrorObjList(llerrObj).build();
-
- llPcepErr.add(pcepErr);
-
- PcepErrorInfo errInfo = factory.buildPcepErrorInfo().setPcepErrorList(llPcepErr).build();
-
- errMsg = factory.buildPcepErrorMsg().setPcepErrorInfo(errInfo).build();
- return errMsg;
- }
-
- /**
- * Implementation of an Pcep Agent which is responsible for
- * keeping track of connected clients and the state in which
- * they are.
- */
- public class PcepClientAgent implements PcepAgent {
-
- @Override
- public boolean addConnectedClient(PccId pccId, PcepClient pc) {
-
- if (connectedClients.get(pccId) != null) {
- return false;
- } else {
- connectedClients.put(pccId, pc);
- for (PcepClientListener l : pcepClientListener) {
- l.clientConnected(pccId);
- }
- return true;
- }
- }
-
- @Override
- public boolean validActivation(PccId pccId) {
- if (connectedClients.get(pccId) == null) {
- //log.error("Trying to activate client but is not in "
- // + "connected switches: pccIp {}. Aborting ..", pccIpAddress.toString());
- return false;
- }
-
- return true;
- }
-
- @Override
- public void removeConnectedClient(PccId pccId) {
- connectedClients.remove(pccId);
- for (PcepClientListener l : pcepClientListener) {
- //log.warn("removal for {}", pccIpAddress.toString());
- l.clientDisconnected(pccId);
- }
- }
-
- @Override
- public void processPcepMessage(PccId pccId, PcepMessage m) {
- processClientMessage(pccId, m);
- }
-
- @Override
- public void addNode(PcepClient pc) {
- for (PcepNodeListener l : pcepNodeListener) {
- l.addDevicePcepConfig(pc);
- }
- }
-
- @Override
- public void deleteNode(PccId pccId) {
- for (PcepNodeListener l : pcepNodeListener) {
- l.deleteDevicePcepConfig(pccId);
- }
- }
-
- @Override
- public boolean analyzeSyncMsgList(PccId pccId) {
- // TODO Auto-generated method stub
- return false;
- }
- }
-
- @Override
- public LabelStack computeLabelStack(Path path) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public LinkedList<PcepValueType> createPcepLabelStack(DefaultLabelStack labelStack, Path path) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Map<String, List<String>> getPcepExceptions() {
- return null;
- }
-
- @Override
- public Map<Integer, Integer> getPcepErrorMsg() {
- return null;
- }
-
- @Override
- public Map<String, String> getPcepSessionMap() {
- return null;
- }
-
- @Override
- public Map<String, Byte> getPcepSessionIdMap() {
- return null;
- }
-
- @Override
- public void peerErrorMsg(String peerId, Integer errorType, Integer errValue) {
- return;
- }
-
- @Override
- public boolean allocateLocalLabel(Tunnel tunnel) {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepControllerAdapter.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepControllerAdapter.java
deleted file mode 100644
index b7482cb..0000000
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepControllerAdapter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.provider.pcep.tunnel.impl;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.pcep.api.PcepController;
-import org.onosproject.pcep.api.PcepDpid;
-import org.onosproject.pcep.api.PcepLinkListener;
-import org.onosproject.pcep.api.PcepSwitch;
-import org.onosproject.pcep.api.PcepSwitchListener;
-import org.onosproject.pcep.api.PcepTunnel;
-import org.onosproject.pcep.api.PcepTunnelListener;
-
-public class PcepControllerAdapter implements PcepController {
-
- @Override
- public Iterable<PcepSwitch> getSwitches() {
- return null;
- }
-
- @Override
- public PcepSwitch getSwitch(PcepDpid did) {
- return null;
- }
-
- @Override
- public void addListener(PcepSwitchListener listener) {
-
- }
-
- @Override
- public void removeListener(PcepSwitchListener listener) {
- }
-
- @Override
- public void addLinkListener(PcepLinkListener listener) {
- }
-
- @Override
- public void removeLinkListener(PcepLinkListener listener) {
- }
-
- @Override
- public void addTunnelListener(PcepTunnelListener listener) {
- }
-
- @Override
- public void removeTunnelListener(PcepTunnelListener listener) {
- }
-
- @Override
- public PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid, long srcPort, long dstPort, long bandwidth,
- String name) {
- return null;
- }
-
- @Override
- public Boolean deleteTunnel(String id) {
- return null;
- }
-
- @Override
- public Boolean updateTunnelBandwidth(String id, long bandwidth) {
- return null;
- }
-
- @Override
- public void getTunnelStatistics(String pcepTunnelId) {
-
- }
-}
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java
index 121557a..12579ae 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java
@@ -15,20 +15,6 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.onosproject.net.DefaultAnnotations.EMPTY;
-import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
-import static org.onosproject.pcep.server.LspType.SR_WITHOUT_SIGNALLING;
-import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -41,6 +27,7 @@
import org.onosproject.incubator.net.tunnel.Tunnel;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.mastership.MastershipServiceAdapter;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
@@ -53,10 +40,26 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.provider.ProviderId;
+import org.onosproject.pcep.api.PcepControllerAdapter;
import org.onosproject.pcep.server.ClientCapability;
import org.onosproject.pcep.server.PccId;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNot.not;
+import static org.onosproject.net.DefaultAnnotations.EMPTY;
+import static org.onosproject.pcep.server.LspType.SR_WITHOUT_SIGNALLING;
+import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
+import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
+
/**
* Test for PCEP release tunnel.
*/
@@ -68,7 +71,7 @@
private final PcepClientControllerAdapter controller = new PcepClientControllerAdapter();
private final PcepControllerAdapter ctl = new PcepControllerAdapter();
private final PcepTunnelApiMapper pcepTunnelAPIMapper = new PcepTunnelApiMapper();
- private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
+ private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
private final DeviceServiceAdapter deviceService = new DeviceServiceAdapter();
private final MastershipServiceAdapter mastershipService = new MastershipServiceAdapter();
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java
index b02e3e3..e176771 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java
@@ -15,20 +15,6 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import static org.onosproject.net.DefaultAnnotations.EMPTY;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.hamcrest.Matchers.nullValue;
-import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
-import static org.onosproject.pcep.server.LspType.SR_WITHOUT_SIGNALLING;
-import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -42,6 +28,7 @@
import org.onosproject.incubator.net.tunnel.Tunnel;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.mastership.MastershipServiceAdapter;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
@@ -54,8 +41,24 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.provider.ProviderId;
+import org.onosproject.pcep.api.PcepControllerAdapter;
import org.onosproject.pcep.server.ClientCapability;
import org.onosproject.pcep.server.PccId;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNot.not;
+import static org.onosproject.net.DefaultAnnotations.EMPTY;
+import static org.onosproject.pcep.server.LspType.SR_WITHOUT_SIGNALLING;
+import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
+import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
/**
* Test for PCEP setup tunnel.
@@ -67,7 +70,7 @@
private final TunnelProviderRegistryAdapter registry = new TunnelProviderRegistryAdapter();
private final PcepClientControllerAdapter controller = new PcepClientControllerAdapter();
private final PcepControllerAdapter ctl = new PcepControllerAdapter();
- private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
+ private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
private final DeviceServiceAdapter deviceService = new DeviceServiceAdapter();
private final MastershipServiceAdapter mastershipService = new MastershipServiceAdapter();
private static final Weight TEN_WEIGHT = ScalarWeight.toWeight(10);
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelAddedTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelAddedTest.java
index c9c0537..0db45cb 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelAddedTest.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelAddedTest.java
@@ -15,32 +15,8 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.onosproject.incubator.net.tunnel.Tunnel.Type.MPLS;
-import static org.onosproject.incubator.net.tunnel.Tunnel.State.INIT;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.BANDWIDTH;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LOCAL_LSP_ID;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.PCC_TUNNEL_ID;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.PLSP_ID;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.DELEGATE;
-import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
-import static org.onosproject.pcep.server.PcepSyncStatus.SYNCED;
-import static org.onosproject.net.Device.Type.ROUTER;
-import static org.onosproject.net.Link.State.ACTIVE;
-import static org.onosproject.net.MastershipRole.MASTER;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableSet;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.After;
@@ -53,6 +29,7 @@
import org.onosproject.incubator.net.tunnel.DefaultTunnel;
import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint;
import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel.State;
import org.onosproject.incubator.net.tunnel.Tunnel.Type;
import org.onosproject.incubator.net.tunnel.TunnelAdminService;
import org.onosproject.incubator.net.tunnel.TunnelDescription;
@@ -61,7 +38,7 @@
import org.onosproject.incubator.net.tunnel.TunnelName;
import org.onosproject.incubator.net.tunnel.TunnelProvider;
import org.onosproject.incubator.net.tunnel.TunnelProviderService;
-import org.onosproject.incubator.net.tunnel.Tunnel.State;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.mastership.MastershipServiceAdapter;
import org.onosproject.net.AnnotationKeys;
import org.onosproject.net.ConnectPoint;
@@ -79,18 +56,44 @@
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.link.LinkServiceAdapter;
import org.onosproject.net.provider.ProviderId;
+import org.onosproject.pcep.api.PcepControllerAdapter;
+import org.onosproject.pcep.server.ClientCapability;
+import org.onosproject.pcep.server.LspKey;
+import org.onosproject.pcep.server.PccId;
+import org.onosproject.pcep.server.PcepClientAdapter;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepFactories;
import org.onosproject.pcepio.protocol.PcepMessage;
import org.onosproject.pcepio.protocol.PcepMessageReader;
import org.onosproject.pcepio.protocol.PcepVersion;
-import org.onosproject.pcep.server.ClientCapability;
-import org.onosproject.pcep.server.LspKey;
-import org.onosproject.pcep.server.PccId;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableSet;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.incubator.net.tunnel.Tunnel.State.INIT;
+import static org.onosproject.incubator.net.tunnel.Tunnel.Type.MPLS;
+import static org.onosproject.net.Device.Type.ROUTER;
+import static org.onosproject.net.Link.State.ACTIVE;
+import static org.onosproject.net.MastershipRole.MASTER;
+import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.BANDWIDTH;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.DELEGATE;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LOCAL_LSP_ID;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.PCC_TUNNEL_ID;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.PLSP_ID;
+import static org.onosproject.pcep.server.PcepSyncStatus.SYNCED;
/**
* Tests handling of PCEP report message.
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java
index cb4123d..9f70e1e 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java
@@ -15,27 +15,18 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.IsNot.not;
-import static org.onosproject.net.DefaultAnnotations.EMPTY;
-import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.junit.After;
import org.junit.Test;
import org.onlab.graph.ScalarWeight;
import org.onlab.packet.IpAddress;
+import org.onosproject.cfg.ComponentConfigAdapter;
import org.onosproject.core.GroupId;
import org.onosproject.incubator.net.tunnel.DefaultTunnel;
import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint;
import org.onosproject.incubator.net.tunnel.Tunnel;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.mastership.MastershipServiceAdapter;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
@@ -48,9 +39,21 @@
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceServiceAdapter;
import org.onosproject.net.provider.ProviderId;
+import org.onosproject.pcep.api.PcepControllerAdapter;
import org.onosproject.pcep.server.ClientCapability;
import org.onosproject.pcep.server.PccId;
-import org.onosproject.cfg.ComponentConfigAdapter;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.core.IsNot.not;
+import static org.onosproject.net.DefaultAnnotations.EMPTY;
+import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
public class PcepTunnelProviderTest {
@@ -59,7 +62,7 @@
private final TunnelProviderRegistryAdapter registry = new TunnelProviderRegistryAdapter();
private final PcepClientControllerAdapter controller = new PcepClientControllerAdapter();
private final PcepControllerAdapter ctl = new PcepControllerAdapter();
- private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
+ private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
private final DeviceServiceAdapter deviceService = new DeviceServiceAdapter();
private final MastershipServiceAdapter mastershipService = new MastershipServiceAdapter();
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java
index 8d9f4e6..99e6e28 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java
@@ -15,19 +15,6 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.nullValue;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNot.not;
-import static org.onosproject.net.DefaultAnnotations.EMPTY;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.LOCAL_LSP_ID;
-import static org.onosproject.pcep.server.PcepAnnotationKeys.PLSP_ID;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -40,6 +27,7 @@
import org.onosproject.incubator.net.tunnel.Tunnel;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelName;
+import org.onosproject.incubator.net.tunnel.TunnelServiceAdapter;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultAnnotations;
@@ -50,15 +38,30 @@
import org.onosproject.net.Path;
import org.onosproject.net.PortNumber;
import org.onosproject.net.provider.ProviderId;
+import org.onosproject.pcep.api.PcepControllerAdapter;
import org.onosproject.pcep.server.ClientCapability;
import org.onosproject.pcep.server.LspKey;
import org.onosproject.pcep.server.PccId;
+import org.onosproject.pcep.server.PcepClientAdapter;
+import org.onosproject.pcep.server.PcepClientControllerAdapter;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv;
-import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNot.not;
+import static org.onosproject.net.DefaultAnnotations.EMPTY;
import static org.onosproject.pcep.server.LspType.SR_WITHOUT_SIGNALLING;
import static org.onosproject.pcep.server.LspType.WITHOUT_SIGNALLING_AND_WITHOUT_SR;
+import static org.onosproject.pcep.server.LspType.WITH_SIGNALLING;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LOCAL_LSP_ID;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.LSP_SIG_TYPE;
+import static org.onosproject.pcep.server.PcepAnnotationKeys.PLSP_ID;
/**
* Test for PCEP update tunnel.
*/
@@ -70,7 +73,7 @@
private final PcepClientControllerAdapter controller = new PcepClientControllerAdapter();
private final PcepControllerAdapter ctl = new PcepControllerAdapter();
private final PcepTunnelApiMapper pcepTunnelAPIMapper = new PcepTunnelApiMapper();
- private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
+ private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter();
@Before
public void setUp() throws IOException {
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelProviderRegistryAdapter.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelProviderRegistryAdapter.java
index 50c4892..250e376 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelProviderRegistryAdapter.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/TunnelProviderRegistryAdapter.java
@@ -15,17 +15,17 @@
*/
package org.onosproject.provider.pcep.tunnel.impl;
-import java.util.Set;
-
import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.Tunnel.State;
import org.onosproject.incubator.net.tunnel.TunnelDescription;
import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.incubator.net.tunnel.TunnelProvider;
import org.onosproject.incubator.net.tunnel.TunnelProviderRegistry;
import org.onosproject.incubator.net.tunnel.TunnelProviderService;
-import org.onosproject.incubator.net.tunnel.Tunnel.State;
import org.onosproject.net.provider.ProviderId;
+import java.util.Set;
+
public class TunnelProviderRegistryAdapter implements TunnelProviderRegistry {
TunnelProvider provider;