Refactor classes names 92/30492/2
authorClaudio D. Gasparini <cgaspari@cisco.com>
Wed, 2 Dec 2015 15:43:49 +0000 (16:43 +0100)
committerClaudio D. Gasparini <cgaspari@cisco.com>
Wed, 2 Dec 2015 16:42:59 +0000 (17:42 +0100)
Refactor classes name to have same stetic in capitals
all, like BGP and PCEP.

Change-Id: I58fb5a3524e2628a4b7555621e34b2d1f3c3c362
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/Main.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImpl.java [moved from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccDispatcherImpl.java with 93% similarity]
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCReconnectPromise.java [moved from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccReconnectPromise.java with 80% similarity]
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSessionListener.java [moved from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccSessionListener.java with 96% similarity]
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java [moved from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccTunnelManagerImpl.java with 96% similarity]
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImplTest.java [moved from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccDispatcherImplTest.java with 96% similarity]
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSessionListenerTest.java [moved from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccSessionListenerTest.java with 94% similarity]
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImplTest.java [moved from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccTunnelManagerImplTest.java with 93% similarity]
pcep/testtool/src/test/java/org/opendaylight/protocol/pcep/testtool/PCCMock.java

index b03185ccf626760e6deeb261b28638d7caac9ab1..4cfd1cf35e75908678cf3a091578877c7aa55676 100644 (file)
@@ -115,9 +115,9 @@ public final class Main {
             final String password, final long reconnectTime, final int redelegationTimeout, final int stateTimeout, final Timer timer) throws InterruptedException, ExecutionException {
         startActivators();
         InetAddress currentAddress = localAddress.getAddress();
-        final PccDispatcherImpl pccDispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
+        final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
         for (int i = 0; i < pccCount; i++) {
-            final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(lspsPerPcc, currentAddress,
+            final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(lspsPerPcc, currentAddress,
                     redelegationTimeout, stateTimeout, timer);
             createPCC(pcerr, new InetSocketAddress(currentAddress, localAddress.getPort()),
                     remoteAddress, getSessionNegotiatorFactory(keepalive, deadtimer), pccDispatcher, password, reconnectTime, tunnelManager);
@@ -126,7 +126,7 @@ public final class Main {
     }
 
     private static void createPCC(final boolean pcerr, final InetSocketAddress localAddress,
-            final List<InetSocketAddress> remoteAddress, final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf, final PccDispatcherImpl pccDispatcher,
+            final List<InetSocketAddress> remoteAddress, final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf, final PCCDispatcherImpl pccDispatcher,
             final String password, final long reconnectTime, final PccTunnelManager tunnelManager) throws InterruptedException, ExecutionException {
 
         for (final InetSocketAddress pceAddress : remoteAddress) {
@@ -134,7 +134,7 @@ public final class Main {
                     new PCEPSessionListenerFactory() {
                         @Override
                         public PCEPSessionListener getSessionListener() {
-                            return new PccSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcerr);
+                            return new PCCSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcerr);
                         }
                     }, snf, getKeyMapping(pceAddress.getAddress(), password), localAddress);
         }
similarity index 93%
rename from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccDispatcherImpl.java
rename to pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImpl.java
index 5f51934ab4f159e30857c133f501b33e293c7bd9..05a6d16988c9d7eba72fce4825396752d78ad2ab 100644 (file)
@@ -41,9 +41,9 @@ import org.opendaylight.tcpmd5.netty.MD5NioSocketChannelFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public final class PccDispatcherImpl implements PccDispatcher, AutoCloseable {
+public final class PCCDispatcherImpl implements PccDispatcher, AutoCloseable {
 
-    private static final Logger LOG = LoggerFactory.getLogger(PccDispatcherImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(PCCDispatcherImpl.class);
 
     private static final int RECONNECT_STRATEGY_TIMEOUT = 2000;
 
@@ -51,7 +51,7 @@ public final class PccDispatcherImpl implements PccDispatcher, AutoCloseable {
     private final MD5ChannelFactory<?> cf;
     private final NioEventLoopGroup workerGroup;
 
-    public PccDispatcherImpl(final MessageRegistry registry) {
+    public PCCDispatcherImpl(final MessageRegistry registry) {
         this.workerGroup = new NioEventLoopGroup();
         this.factory = new PCEPHandlerFactory(registry);
         this.cf = new MD5NioSocketChannelFactory(DeafultKeyAccessFactory.getKeyAccessFactory());
@@ -93,14 +93,14 @@ public final class PccDispatcherImpl implements PccDispatcher, AutoCloseable {
         setChannelFactory(b, keys);
         b.option(ChannelOption.SO_KEEPALIVE, true);
         b.option(ChannelOption.MAX_MESSAGES_PER_READ, 1);
-        final PccReconnectPromise promise = new PccReconnectPromise(remoteAddress,
+        final PCCReconnectPromise promise = new PCCReconnectPromise(remoteAddress,
                 reconnectTime == -1 ? getNeverReconnectStrategyFactory() : getTimedReconnectStrategyFactory(reconnectTime), b);
         final ChannelInitializer<SocketChannel> channelInitializer = new ChannelInitializer<SocketChannel>() {
             @Override
             protected void initChannel(final SocketChannel ch) throws Exception {
-                ch.pipeline().addLast(PccDispatcherImpl.this.factory.getDecoders());
+                ch.pipeline().addLast(PCCDispatcherImpl.this.factory.getDecoders());
                 ch.pipeline().addLast("negotiator", negotiatorFactory.getSessionNegotiator(listenerFactory, ch, promise, null));
-                ch.pipeline().addLast(PccDispatcherImpl.this.factory.getEncoders());
+                ch.pipeline().addLast(PCCDispatcherImpl.this.factory.getEncoders());
                 ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {
                     @Override
                     public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
@@ -112,7 +112,7 @@ public final class PccDispatcherImpl implements PccDispatcher, AutoCloseable {
                             LOG.debug("Connection to {} was dropped during negotiation, reattempting", remoteAddress);
                         }
                         LOG.debug("Reconnecting after connection to {} was dropped", remoteAddress);
-                        PccDispatcherImpl.this.createClient(remoteAddress, reconnectTime, listenerFactory, negotiatorFactory,
+                        PCCDispatcherImpl.this.createClient(remoteAddress, reconnectTime, listenerFactory, negotiatorFactory,
                                 keys, localAddress);
                     }
                 });
similarity index 80%
rename from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccReconnectPromise.java
rename to pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCReconnectPromise.java
index 92321563638a784cf99e108ff2cf769e38c0e66d..152f4e8099322ce8bfaefa21bfbb15ef5fbc29e1 100644 (file)
@@ -25,9 +25,9 @@ import org.opendaylight.protocol.pcep.PCEPSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
+public class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
 
-    private static final Logger LOG = LoggerFactory.getLogger(PccReconnectPromise.class);
+    private static final Logger LOG = LoggerFactory.getLogger(PCCReconnectPromise.class);
 
     private final InetSocketAddress address;
     private final Bootstrap b;
@@ -36,7 +36,7 @@ public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
     @GuardedBy("this")
     private Future<?> pending;
 
-    public PccReconnectPromise(final InetSocketAddress address, final ReconnectStrategyFactory rsf, final Bootstrap b) {
+    public PCCReconnectPromise(final InetSocketAddress address, final ReconnectStrategyFactory rsf, final Bootstrap b) {
         this.address = address;
         this.b = b;
         this.reconnectStrategy = rsf.createReconnectStrategy();
@@ -46,7 +46,7 @@ public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
         try {
             this.b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.reconnectStrategy.getConnectTimeout());
             final ChannelFuture cf = this.b.connect(this.address);
-            cf.addListener(new BootstrapConnectListener(PccReconnectPromise.this));
+            cf.addListener(new BootstrapConnectListener(PCCReconnectPromise.this));
             this.pending = cf;
         } catch (final Exception e) {
             LOG.info("Failed to connect to {}", this.address, e);
@@ -89,17 +89,17 @@ public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
         public void operationComplete(final ChannelFuture cf) throws Exception {
 
             synchronized (this.lock) {
-                if (PccReconnectPromise.this.isCancelled()) {
+                if (PCCReconnectPromise.this.isCancelled()) {
                     if (cf.isSuccess()) {
-                        PccReconnectPromise.LOG.debug("Closing channels for cancelled promise {}");
+                        PCCReconnectPromise.LOG.debug("Closing channels for cancelled promise {}");
                         cf.channel().close();
                     }
                 } else if (cf.isSuccess()) {
-                    PccReconnectPromise.LOG.debug("Promise connection is successful.");
+                    PCCReconnectPromise.LOG.debug("Promise connection is successful.");
                 } else {
-                    PccReconnectPromise.LOG.debug("Attempt to reconnect using reconnect strategy ...");
-                    final Future<Void> rf = PccReconnectPromise.this.reconnectStrategy.scheduleReconnect(cf.cause());
-                    rf.addListener(new PccReconnectPromise.BootstrapConnectListener.ReconnectStrategyListener());
+                    PCCReconnectPromise.LOG.debug("Attempt to reconnect using reconnect strategy ...");
+                    final Future<Void> rf = PCCReconnectPromise.this.reconnectStrategy.scheduleReconnect(cf.cause());
+                    rf.addListener(new PCCReconnectPromise.BootstrapConnectListener.ReconnectStrategyListener());
                 }
             }
         }
@@ -109,13 +109,13 @@ public class PccReconnectPromise extends DefaultPromise<PCEPSession> {
             @Override
             public void operationComplete(final Future<Void> f ) {
                 synchronized (BootstrapConnectListener.this.lock) {
-                    if (!PccReconnectPromise.this.isCancelled()) {
+                    if (!PCCReconnectPromise.this.isCancelled()) {
                         if (f.isSuccess()) {
-                            PccReconnectPromise.LOG.debug("ReconnectStrategy has scheduled a retry.");
-                            PccReconnectPromise.this.connect();
+                            PCCReconnectPromise.LOG.debug("ReconnectStrategy has scheduled a retry.");
+                            PCCReconnectPromise.this.connect();
                         } else {
-                            PccReconnectPromise.LOG.debug("ReconnectStrategy has failed. No attempts will be made.");
-                            PccReconnectPromise.this.setFailure(f.cause());
+                            PCCReconnectPromise.LOG.debug("ReconnectStrategy has failed. No attempts will be made.");
+                            PCCReconnectPromise.this.setFailure(f.cause());
                         }
                     }
                 }
similarity index 96%
rename from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccSessionListener.java
rename to pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSessionListener.java
index 855590e6c4bdb7745a36049fa79b31ec4f597563..b2be1fdb31a8c53f9072dd81951a470eb9c8b7c0 100644 (file)
@@ -27,16 +27,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class PccSessionListener implements PCEPSessionListener, PccSession {
+public class PCCSessionListener implements PCEPSessionListener, PccSession {
 
-    private static final Logger LOG = LoggerFactory.getLogger(PccSessionListener.class);
+    private static final Logger LOG = LoggerFactory.getLogger(PCCSessionListener.class);
 
     private final boolean errorMode;
     private final PccTunnelManager tunnelManager;
     private final int sessionId;
     private PCEPSession session;
 
-    public PccSessionListener(final int sessionId, final PccTunnelManager tunnelManager, final boolean errorMode) {
+    public PCCSessionListener(final int sessionId, final PccTunnelManager tunnelManager, final boolean errorMode) {
         this.errorMode = errorMode;
         this.tunnelManager = tunnelManager;
         this.sessionId = sessionId;
similarity index 96%
rename from pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PccTunnelManagerImpl.java
rename to pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java
index 8ad7bc4c6f8f6462a5149185b552f69d11db15a4..700cb885cc8bf7a275a7d8750ee8c1a7111c348f 100644 (file)
@@ -59,7 +59,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
 
-public class PccTunnelManagerImpl implements PccTunnelManager {
+public class PCCTunnelManagerImpl implements PccTunnelManager {
 
     private static final Subobject DEFAULT_ENDPOINT_HOP = getDefaultEROEndpointHop();
     private static final String ENDPOINT_ADDRESS = "1.1.1.1";
@@ -79,8 +79,8 @@ public class PccTunnelManagerImpl implements PccTunnelManager {
     private final int redelegationTimeout;
     private final int stateTimeout;
 
-    public PccTunnelManagerImpl(final int lspsCount, final InetAddress address, final int redelegationTimeout,
-            final int stateTimeout, final Timer timer) {
+    public PCCTunnelManagerImpl(final int lspsCount, final InetAddress address, final int redelegationTimeout,
+                                final int stateTimeout, final Timer timer) {
         Preconditions.checkArgument(lspsCount >= 0);
         Preconditions.checkNotNull(address);
         this.redelegationTimeout = redelegationTimeout;
@@ -278,7 +278,7 @@ public class PccTunnelManagerImpl implements PccTunnelManager {
                 @Override
                 public void run(final Timeout timeout) throws Exception {
                     if (tunnel.getType() == LspType.PCE_LSP) {
-                        PccTunnelManagerImpl.this.tunnels.remove(plspId);
+                        PCCTunnelManagerImpl.this.tunnels.remove(plspId);
                         //report tunnel removal to all
                         sendToAll(tunnel, plspId, Collections.<Subobject>emptyList(), createSrp(0), new PathBuilder().build(),
                                 createLsp(plspId.getValue(), false, Optional.<Tlvs>absent(), false, true));
@@ -294,20 +294,20 @@ public class PccTunnelManagerImpl implements PccTunnelManager {
             @Override
             public void run(final Timeout timeout) throws Exception {
                 //remove delegation
-                PccTunnelManagerImpl.this.setDelegation(plspId, null);
+                PCCTunnelManagerImpl.this.setDelegation(plspId, null);
                 //delegate to another PCE
                 int index = session.getId();
-                for (int i = 1; i < PccTunnelManagerImpl.this.sessions.size(); i++) {
+                for (int i = 1; i < PCCTunnelManagerImpl.this.sessions.size(); i++) {
                     index++;
-                    if (index == PccTunnelManagerImpl.this.sessions.size()) {
+                    if (index == PCCTunnelManagerImpl.this.sessions.size()) {
                         index = 0;
                     }
-                    final PccSession nextSession = PccTunnelManagerImpl.this.sessions.get(index);
+                    final PccSession nextSession = PCCTunnelManagerImpl.this.sessions.get(index);
                     if (nextSession != null) {
                         tunnel.cancelTimeouts();
                         final Tlvs tlvs = createLspTlvs(plspId.getValue(), true,
-                                getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), PccTunnelManagerImpl.this.address),
-                                PccTunnelManagerImpl.this.address, PccTunnelManagerImpl.this.address, Optional.of(tunnel.getPathName()));
+                                getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), PCCTunnelManagerImpl.this.address),
+                                PCCTunnelManagerImpl.this.address, PCCTunnelManagerImpl.this.address, Optional.of(tunnel.getPathName()));
                         nextSession.sendReport(createPcRtpMessage(
                                 createLsp(plspId.getValue(), true, Optional.<Tlvs> fromNullable(tlvs), true, false), NO_SRP,
                                 tunnel.getLspState()));
similarity index 96%
rename from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccDispatcherImplTest.java
rename to pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImplTest.java
index ed94d3ab14ccdc8d53668b9fa6e9da19aa2f9147..450b4d35255668ee14914146481d4c1fdb5a35fd 100644 (file)
@@ -30,12 +30,12 @@ import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
 import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
 
-public class PccDispatcherImplTest {
+public class PCCDispatcherImplTest {
 
     private static final List<PCEPCapability> CAPS = new ArrayList<>();
     private static final PCEPSessionProposalFactory PROPOSAL = new BasePCEPSessionProposalFactory(30, 120, CAPS);
 
-    private PccDispatcherImpl dispatcher;
+    private PCCDispatcherImpl dispatcher;
     private final DefaultPCEPSessionNegotiatorFactory nf = new DefaultPCEPSessionNegotiatorFactory(PROPOSAL, 0);
     private PCEPDispatcher pcepDispatcher;
     private InetSocketAddress serverAddress;
@@ -48,7 +48,7 @@ public class PccDispatcherImplTest {
     public void setUp() {
         this.workerGroup = new NioEventLoopGroup();
         this.bossGroup = new NioEventLoopGroup();
-        this.dispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
+        this.dispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
         this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry(),
                 this.nf, this.bossGroup, this.workerGroup);
         this.serverAddress = new InetSocketAddress("127.0.5.0", getRandomPort());
similarity index 94%
rename from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccSessionListenerTest.java
rename to pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSessionListenerTest.java
index d74a99d49d3fbd47be766aa103276dbfe5ef49e0..94c5509637eb7865eb1e953324fe5934b9f0537c 100644 (file)
@@ -50,7 +50,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
 
-public class PccSessionListenerTest {
+public class PCCSessionListenerTest {
 
     @Mock
     private PCEPSession mockedSession;
@@ -66,7 +66,7 @@ public class PccSessionListenerTest {
         Mockito.doAnswer(new Answer<Void>() {
             @Override
             public Void answer(final InvocationOnMock invocation) throws Throwable {
-                PccSessionListenerTest.this.sendMessages.add((Message) invocation.getArguments()[0]);
+                PCCSessionListenerTest.this.sendMessages.add((Message) invocation.getArguments()[0]);
                 return null;
             }
         }).when(mockedSession).sendMessage(Mockito.any(Message.class));
@@ -79,7 +79,7 @@ public class PccSessionListenerTest {
 
     @Test
     public void testOnMessage() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         listener.onMessage(mockedSession, createUpdMsg(true));
         Mockito.verify(tunnelManager).reportToAll(Mockito.any(Updates.class), Mockito.any(PccSession.class));
         listener.onMessage(mockedSession, createUpdMsg(false));
@@ -94,28 +94,28 @@ public class PccSessionListenerTest {
 
     @Test
     public void testOnMessageErrorMode() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, true);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, true);
         listener.onMessage(mockedSession, createUpdMsg(true));
         Mockito.verify(mockedSession).sendMessage(Mockito.any(Message.class));
     }
 
     @Test
     public void testOnSessionUp() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         listener.onSessionUp(mockedSession);
         Mockito.verify(tunnelManager).onSessionUp(Mockito.any(PccSession.class));
     }
 
     @Test
     public void testOnSessionDown() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         listener.onSessionDown(mockedSession, new Exception());
         Mockito.verify(tunnelManager).onSessionDown(Mockito.any(PccSession.class));
     }
 
     @Test
     public void testSendError() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         listener.onSessionUp(mockedSession);
         listener.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.ATTEMPT_2ND_SESSION, 0));
         Mockito.verify(mockedSession).sendMessage(Mockito.<Message>any());
@@ -123,7 +123,7 @@ public class PccSessionListenerTest {
 
     @Test
     public void testSendReport() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         listener.onSessionUp(mockedSession);
         listener.sendReport(null);
         Mockito.verify(mockedSession).sendMessage(Mockito.<Message>any());
@@ -131,7 +131,7 @@ public class PccSessionListenerTest {
 
     @Test
     public void testGetId() {
-        final PccSessionListener listener = new PccSessionListener(1, tunnelManager, false);
+        final PCCSessionListener listener = new PCCSessionListener(1, tunnelManager, false);
         Assert.assertEquals(1, listener.getId());
     }
 
similarity index 93%
rename from pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PccTunnelManagerImplTest.java
rename to pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImplTest.java
index 304ecde7c986af8168566c3ac9e9fa6d0b1a9d43..d3f38b36e158aeee1d9b6d5201fb206fcd3e3fb9 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.IpPrefixCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefixBuilder;
 
-public class PccTunnelManagerImplTest {
+public class PCCTunnelManagerImplTest {
 
     private static final InetAddress ADDRESS = InetAddresses.forString("1.2.4.5");
     private static final Timer TIMER = new HashedWheelTimer();
@@ -101,7 +101,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testOnSessionUp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         //1 reported LSP + 1 end-of-sync marker
@@ -112,7 +112,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testOnSessionDownAndDelegateBack() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 1, 10, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, 10, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         Mockito.verify(session1, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
@@ -125,7 +125,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testOnSessionDownAndDelegateToOther() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, -1, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, -1, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         Mockito.verify(session1, Mockito.times(2)).sendReport(Mockito.any(Pcrpt.class));
@@ -140,7 +140,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReportToAll() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.reportToAll(createUpdate(1), session1);
@@ -150,7 +150,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReportToAllUnknownLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.reportToAll(createUpdate(2), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -159,7 +159,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReportToAllNonDelegatedLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.reportToAll(createUpdate(1), session2);
@@ -169,7 +169,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReturnDelegationPccLsp() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 1, -1, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 1, -1, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.returnDelegation(createUpdate(1), session1);
@@ -182,7 +182,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReturnDelegationUnknownLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.returnDelegation(createUpdate(2), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -191,7 +191,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReturnDelegationNonDelegatedLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.returnDelegation(createUpdate(1), session2);
@@ -201,7 +201,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testAddTunnel() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.addTunnel(createRequests(1), session1);
@@ -211,7 +211,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testRemoveTunnel() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.addTunnel(createRequests(1), session1);
@@ -222,7 +222,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testRemoveTunnelUnknownLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.removeTunnel(createRequests(1), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -231,7 +231,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testRemoveTunnelNotPceInitiatedLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.removeTunnel(createRequests(1), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -240,7 +240,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testRemoveTunnelNotDelegated() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.addTunnel(createRequests(1), session1);
@@ -251,7 +251,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testTakeDelegation() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, -1, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, -1, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.addTunnel(createRequests(1), session1);
@@ -266,7 +266,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testTakeDelegationUnknownLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.takeDelegation(createRequests(1), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -275,7 +275,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testTakeDelegationNotPceInitiatedLsp() {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(1, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.takeDelegation(createRequests(1), session1);
         Mockito.verify(session1, Mockito.times(1)).sendError(Mockito.any(Pcerr.class));
@@ -284,7 +284,7 @@ public class PccTunnelManagerImplTest {
 
     @Test
     public void testReturnDelegationNoRetake() throws InterruptedException {
-        final PccTunnelManager tunnelManager = new PccTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
+        final PccTunnelManager tunnelManager = new PCCTunnelManagerImpl(0, ADDRESS, 0, 0, TIMER);
         tunnelManager.onSessionUp(session1);
         tunnelManager.onSessionUp(session2);
         tunnelManager.addTunnel(createRequests(1), session1);
index 6989e1c11ee33ee547afe6d4747d85cbdf17f82d..96caa3901e12e060b0b3fcecd5e38e2c8fd22724 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
-import org.opendaylight.protocol.pcep.pcc.mock.PccDispatcherImpl;
+import org.opendaylight.protocol.pcep.pcc.mock.PCCDispatcherImpl;
 import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
 
 public class PCCMock {
@@ -28,7 +28,7 @@ public class PCCMock {
         final PCEPSessionProposalFactory proposal = new BasePCEPSessionProposalFactory((short) 120, (short) 30, caps);
         final PCEPSessionNegotiatorFactory snf = new DefaultPCEPSessionNegotiatorFactory(proposal, 0);
 
-        try (final PccDispatcherImpl pccDispatcher = new PccDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry())) {
+        try (final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry())) {
             pccDispatcher.createClient(new InetSocketAddress("127.0.0.3", 12345), -1, new PCEPSessionListenerFactory() {
                 @Override
                 public PCEPSessionListener getSessionListener() {