Fix for SfcProviderRpc and IpSgtDistribution failures 80/63480/3
authorMichal Cmarada <mcmarada@cisco.com>
Mon, 25 Sep 2017 15:39:05 +0000 (17:39 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Mon, 25 Sep 2017 16:04:55 +0000 (16:04 +0000)
SFC removed static implementation of SfcProviderRpc. This patch creates an
an instance of SfcProviderRpc in SfcManager to be used instead of static
implementation.
IpSgtDistribution tests were failing because of errors in pom files. Once
BindingNormalizedNodeCodec was refactored in MDSal tests failed because
of class not found exception. Pom files were fixed to address this issue.

Change-Id: If323f84f98995751b755b0aab3be04e88fc4f24e
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
renderers/ofoverlay/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/SfcManager.java
sxp-integration/ip-sgt-distribution-service/pom.xml
sxp-integration/pom.xml
sxp-integration/sxp-ep-provider/pom.xml
sxp-integration/sxp-ise-adapter/pom.xml

index 9da882ef38064a97407ac656034c3dc02a97989d..5bec98442b1292581cc31e834b377d0972b8b319 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay;
 
 import com.google.common.base.Optional;
+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;
@@ -73,6 +74,7 @@ public class SfcManager implements AutoCloseable, DataTreeChangeListener<ActionI
     private final ExecutorService executor;
     private final InstanceIdentifier<ActionInstance> allActionInstancesIid;
     private final ListenerRegistration<?> actionListener;
+    private final SfcProviderRpc sfcProviderRpc;
 
     /*
      * local cache of the RSP first hops that we've requested from SFC,
@@ -110,8 +112,10 @@ public class SfcManager implements AutoCloseable, DataTreeChangeListener<ActionI
     public SfcManager(DataBroker dataBroker,
                       RpcProviderRegistry rpcRegistry,
                       ExecutorService executor) {
+        Preconditions.checkNotNull(dataBroker, "Databroker for SfcManager must not be null!");
         this.dataBroker = dataBroker;
         this.executor = executor;
+        this.sfcProviderRpc = new SfcProviderRpc(dataBroker);
         /*
          * Use thread-safe type only because we use an executor
          */
@@ -345,8 +349,7 @@ public class SfcManager implements AutoCloseable, DataTreeChangeListener<ActionI
                        .setName(pv.getStringValue());
             // TODO: make async
             Future<RpcResult<ReadRenderedServicePathFirstHopOutput>> result =
-                SfcProviderRpc.getSfcProviderRpc()
-                              .readRenderedServicePathFirstHop(builder.build());
+                sfcProviderRpc.readRenderedServicePathFirstHop(builder.build());
 
             try {
                 RpcResult<ReadRenderedServicePathFirstHopOutput> output =
index faa47cba86ec1bf47f16446d69a2bcac3d31e331..cab9305ee4ef057b696b0b5b93016257782c8b2b 100644 (file)
@@ -7,13 +7,12 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.mdsal</groupId>
-        <artifactId>binding-parent</artifactId>
-        <version>0.12.0-SNAPSHOT</version>
-        <relativePath/>
+        <groupId>org.opendaylight.groupbasedpolicy</groupId>
+        <artifactId>sxp-integration</artifactId>
+        <version>0.7.0-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
 
-    <groupId>org.opendaylight.groupbasedpolicy</groupId>
     <artifactId>ip-sgt-distribution-service</artifactId>
     <version>0.7.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
         <sxp.version>1.6.0-SNAPSHOT</sxp.version>
     </properties>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-               <groupId>org.opendaylight.controller</groupId>
-                <artifactId>mdsal-artifacts</artifactId>
-                <version>1.7.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.opendaylight.sxp</groupId>
-                <artifactId>sxp-core</artifactId>
-                <version>${sxp.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.opendaylight.sxp</groupId>
-                <artifactId>sxp-api</artifactId>
-                <version>${sxp.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.opendaylight.sxp</groupId>
-                <artifactId>sxp-controller</artifactId>
-                <version>${sxp.version}</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
index 0f1ee80660afff7c675c9667e55d56095e5e36d9..2da6f2a431516b38fd7bb97bd52344e169b02e44 100644 (file)
                 <artifactId>sxp-core</artifactId>
                 <version>${sxp.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.sxp</groupId>
+                <artifactId>sxp-controller</artifactId>
+                <version>${sxp.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -75,9 +80,8 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
-             <artifactId>sal-binding-broker-impl</artifactId>
-             <type>test-jar</type>
-             <scope>test</scope>
+            <artifactId>sal-binding-broker-impl</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>
index 772e0746c41ce228aadca3b6b31689538918620b..f6d64d13cf1b5132b7620832cecb19b276f46e81 100755 (executable)
             <artifactId>slf4j-log4j12</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-module-junit4</artifactId>
index 9d3fc043aa6e60ce38d3eabf473255877ce9f806..3b714a0bf9aac98f8947e511c0af8f61b50e924c 100755 (executable)
             <artifactId>powermock-api-mockito</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <!-- project build -->