Clean up 80/61280/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.sk>
Mon, 7 Aug 2017 11:48:17 +0000 (13:48 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 7 Aug 2017 14:25:36 +0000 (16:25 +0200)
- Migrate Futures.addCallback
- Move test to shorter package

Change-Id: I7c5f8f9743cd7220414d68d043ca912261edec4d
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/openconfig-api/src/test/java/org/opendaylight/yang/gen/v1/http/openconfig/net/yang/bgp/policy/rev151009/CommunitySetCommunityMemberBuilderTest.java [moved from bgp/openconfig-api/src/test/java/org/opendaylight/yang/gen/v1/http/openconfig/net/yang/bgp/policy/rev151009/routing/policy/defined/sets/bgp/defined/sets/community/sets/CommunitySetCommunityMemberBuilderTest.java with 85% similarity]
bgp/openconfig-api/src/test/java/org/opendaylight/yang/gen/v1/http/openconfig/net/yang/bgp/policy/rev151009/ExtCommunitySetExtCommunityMemberBuilderTest.java [moved from bgp/openconfig-api/src/test/java/org/opendaylight/yang/gen/v1/http/openconfig/net/yang/bgp/policy/rev151009/routing/policy/defined/sets/bgp/defined/sets/ext/community/sets/ExtCommunitySetExtCommunityMemberBuilderTest.java with 85% similarity]
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/Generic4OctASEcHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/four/octect/as/specific/Generic4OctASEcHandlerTest.java with 90% similarity]
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/RouteOrigin4OctectASEcHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/four/octect/as/specific/RouteOrigin4OctectASEcHandlerTest.java with 95% similarity]
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/RouteTarget4OctectASEcHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/four/octect/as/specific/RouteTarget4OctectASEcHandlerTest.java with 90% similarity]
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPStatefulPeerProposal.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/TopologyNodeState.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/InstructionDeployerImpl.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImpl.java

@@ -6,12 +6,13 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.community.sets;
+package org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009;
 
 
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.community.sets.CommunitySet.CommunityMember;
+import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.community.sets.CommunitySetCommunityMemberBuilder;
 
 public class CommunitySetCommunityMemberBuilderTest {
 
@@ -6,11 +6,12 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.ext.community.sets;
+package org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009;
 
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.ext.community.sets.ExtCommunitySet.ExtCommunityMember;
+import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.defined.sets.bgp.defined.sets.ext.community.sets.ExtCommunitySetExtCommunityMemberBuilder;
 
 public class ExtCommunitySetExtCommunityMemberBuilderTest {
 
@@ -6,10 +6,10 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific;
+package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
 
-import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandlerTest.AS_COMMON;
-import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandlerTest.INPUT;
+import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteOrigin4OctectASEcHandlerTest.AS_COMMON;
+import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteOrigin4OctectASEcHandlerTest.INPUT;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -18,6 +18,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
+import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.Generic4OctASEcHandler;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.As4GenericSpecExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.As4GenericSpecExtendedCommunityCaseBuilder;
@@ -6,7 +6,7 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific;
+package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -15,6 +15,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
+import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandler;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.as._4.spec.common.As4SpecificCommon;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.as._4.spec.common.As4SpecificCommonBuilder;
@@ -6,10 +6,10 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific;
+package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
 
-import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandlerTest.AS_COMMON;
-import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandlerTest.INPUT;
+import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteOrigin4OctectASEcHandlerTest.AS_COMMON;
+import static org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteOrigin4OctectASEcHandlerTest.INPUT;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -18,6 +18,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
+import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteTarget4OctectASEcHandler;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.As4RouteOriginExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.As4RouteTargetExtendedCommunityCase;
index 06b8910e6c90a866711a1211682ddeb234603434..8308ba5706d342cadb17ba120a040104aa99a8f8 100755 (executable)
@@ -12,6 +12,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
 import io.netty.util.concurrent.FutureListener;
 import java.net.InetAddress;
 import java.util.ArrayList;
@@ -211,7 +212,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements PCEPSessi
                 LOG.error("Failed to update internal state for session {}, terminating it", AbstractTopologySessionListener.this.session, t);
                 AbstractTopologySessionListener.this.session.close(TerminationReason.UNKNOWN);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     protected void updatePccState(final PccSyncState pccSyncState) {
@@ -233,7 +234,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements PCEPSessi
                 LOG.error("Failed to update internal state for session {}", AbstractTopologySessionListener.this.session, t);
                 AbstractTopologySessionListener.this.session.close(TerminationReason.UNKNOWN);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     protected boolean isTriggeredSyncInProcess() {
@@ -319,7 +320,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements PCEPSessi
                 ctx.notifyRequests();
                 session.close(TerminationReason.UNKNOWN);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     @Override
index dbcf4e588cf7710ceeb4956f48e5fff8aebea6a2..97341410baea8c4b6f30da49cc81c8fa4f2ca7a0 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
@@ -72,7 +73,7 @@ public final class PCEPStatefulPeerProposal {
                         LOG.warn("Failed to read toplogy {}.", InstanceIdentifier.keyOf(
                             PCEPStatefulPeerProposal.this.topologyId), t);
                     }
-                });
+                }, MoreExecutors.directExecutor());
             }
         }
     }
index b9403da534b15501996713a113cb35d59257def4..607c3ce35bf33aa85f88adf2a45cc10063992213 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -91,7 +92,7 @@ final class TopologyNodeState implements AutoCloseable, TransactionChainListener
                 public void onFailure(final Throwable t) {
                     LOG.error("Failed to cleanup internal state for session {}", TopologyNodeState.this.nodeId, t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
 
         this.lastReleased = System.nanoTime();
@@ -122,7 +123,7 @@ final class TopologyNodeState implements AutoCloseable, TransactionChainListener
                 public void onFailure(final Throwable t) {
                     LOG.error("Failed to get topology node {}", TopologyNodeState.this.nodeId, t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         } else {
             putTopologyNode();
         }
index 12c52dd5a2fccd3bfff6222d065dfd56af475a88..d3d986354bb87de5cb2f781f6cb515b5d2b33905 100644 (file)
@@ -92,7 +92,7 @@ public final class InstructionDeployerImpl implements IntructionDeployer,
                 public void onFailure(final Throwable t) {
                     LOG.error("Failed to initialize Instruction Instance {}.", WriteConfiguration.this.instructionId, t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
 
         void remove() {
@@ -110,7 +110,7 @@ public final class InstructionDeployerImpl implements IntructionDeployer,
                 public void onFailure(final Throwable t) {
                     LOG.error("Failed to remove Instruction Instance {}.", WriteConfiguration.this.instructionId, t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
     }
 
@@ -138,7 +138,7 @@ public final class InstructionDeployerImpl implements IntructionDeployer,
             public void onFailure(final Throwable t) {
                 LOG.error("Failed to initialize Instruction Instance {}.", InstructionDeployerImpl.this.iid, t);
             }
-        });
+        }, MoreExecutors.directExecutor());
 
         this.registration = dataProvider.registerDataTreeChangeListener(
             new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, this.iid), this);
index 1d5f8130705fc6b8c0a4983128f6e3e4ae45d115..b5c3f00a29d9cdb71e45d0f8fe451addbc58eece 100644 (file)
@@ -13,6 +13,7 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import io.netty.util.Timeout;
 import io.netty.util.Timer;
@@ -120,7 +121,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
                     public void onFailure(final Throwable t) {
                         LOG.error("Failed to update Instruction Queue {}", ProgrammingServiceImpl.this.qid, t);
                     }
-                });
+                }, MoreExecutors.directExecutor());
             }
 
             try {
@@ -147,7 +148,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
                 public void onFailure(final Throwable t) {
                     LOG.error("Failed to remove Instruction Queue {}", ProgrammingServiceImpl.this.qid, t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
     }
 
@@ -189,7 +190,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
             public void onFailure(final Throwable t) {
                 LOG.error("Failed to add Instruction Queue {}", ProgrammingServiceImpl.this.qid, t);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     @Override
@@ -396,7 +397,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
                 public void onFailure(final Throwable t) {
                     LOG.error("Instruction {} failed to execute", i.getId(), t);
                 }
-            });
+            }, MoreExecutors.directExecutor());
         }
 
     }
@@ -426,7 +427,7 @@ public final class ProgrammingServiceImpl implements AutoCloseable, ClusterSingl
             public void onFailure(final Throwable t) {
                 LOG.error("Failed to shutdown Instruction Queue {}", ProgrammingServiceImpl.this.qid, t);
             }
-        });
+        }, MoreExecutors.directExecutor());
         return future;
     }