Partial submit() migration to commit() 58/72158/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 22 May 2018 10:15:50 +0000 (12:15 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 22 May 2018 10:15:50 +0000 (12:15 +0200)
Change-Id: I4610af88fe7cbce2259b90ca19842ee30d0952a7
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/BGPOperationalStateUtilsTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpDeployerImplTest.java
config-loader/bmp-monitors-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/bmp/BmpMonitorConfigFileProcessor.java
config-loader/protocols-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/protocols/ProtocolsConfigFileProcessor.java
config-loader/routing-policy-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/routing/policy/OpenconfigRoutingPolicyLoader.java
config-loader/topology-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/topology/NetworkTopologyConfigFileProcessor.java
pcep/topology/cli/src/test/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtilsTest.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java
pcep/topology/topology-stats/src/main/java/org/opendaylight/bgpcep/pcep/topology/stats/provider/TopologyStatsProviderImpl.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/PCEPTunnelTopologyProvider.java
testtool-util/src/test/java/org/opendaylight/protocol/util/CheckUtilTest.java

index 914a316078fdce952c08cb51028818aacac545bb..4cc0fa373b24e3f0db07546685acddd99ad34f43 100644 (file)
@@ -64,7 +64,7 @@ public class BGPOperationalStateUtilsTest extends AbstractConcurrentDataBrokerTe
                 .child(Protocol.class, new ProtocolKey(BGP.class, RIB_ID))
                 .augmentation(NetworkInstanceProtocol.class).child(Bgp.class);
         wt.put(LogicalDatastoreType.OPERATIONAL, bgpIID, bgp, true);
-        wt.submit().get();
+        wt.commit().get();
     }
 
     @Test
index d5206358f758903b1d5ab7d737d928ed4513dcf6..948911fc92e2a72d1a0de1bb0d99178fb86cb71d 100644 (file)
@@ -207,24 +207,24 @@ public class BgpDeployerImplTest extends DefaultRibPoliciesMockTest {
     private void createRib(final Global global) throws ExecutionException, InterruptedException {
         final WriteTransaction wr = getDataBroker().newWriteOnlyTransaction();
         wr.put(LogicalDatastoreType.CONFIGURATION, GLOBAL_II, global, true);
-        wr.submit().get();
+        wr.commit().get();
     }
 
     private void deleteRib() throws ExecutionException, InterruptedException {
         final WriteTransaction wr = getDataBroker().newWriteOnlyTransaction();
         wr.delete(LogicalDatastoreType.CONFIGURATION, BGP_II);
-        wr.submit().get();
+        wr.commit().get();
     }
 
     private void createNeighbor(final Neighbors neighbors) throws ExecutionException, InterruptedException {
         final WriteTransaction wr = getDataBroker().newWriteOnlyTransaction();
         wr.put(LogicalDatastoreType.CONFIGURATION, NEIGHBORS_II, neighbors, true);
-        wr.submit().get();
+        wr.commit().get();
     }
 
     private void deleteNeighbors() throws ExecutionException, InterruptedException {
         final WriteTransaction wr = getDataBroker().newWriteOnlyTransaction();
         wr.delete(LogicalDatastoreType.CONFIGURATION, NEIGHBORS_II);
-        wr.submit().get();
+        wr.commit().get();
     }
 }
\ No newline at end of file
index 68dfb47c78c4faca710b699bafe7d3a359efac03..cdd78b906e67377c2488824e78487c11650589e9 100644 (file)
@@ -100,7 +100,7 @@ public final class BmpMonitorConfigFileProcessor implements ConfigFileProcessor,
                 .forEach(bi -> processBmpMonitorConfig((BmpMonitorConfig) bi.getValue(), wtx));
 
         try {
-            wtx.submit().get();
+            wtx.commit().get();
         } catch (final ExecutionException | InterruptedException e) {
             LOG.warn("Failed to create Bmp config", e);
         }
index 8cd47f4a1522f27afcbe74778051e7cfdeae73e1..0183068041e043ca897c69ae05399a9086cf6c56 100644 (file)
@@ -95,7 +95,7 @@ public final class ProtocolsConfigFileProcessor implements ConfigFileProcessor,
             }
         }
         try {
-            wtx.submit().get();
+            wtx.commit().get();
         } catch (final ExecutionException | InterruptedException e) {
             LOG.warn("Failed to create Protocol", e);
         }
index c4725c55d57380244a09f29f8bb851ce63cd36d1..6c175c891726c6df4a2a69627af763124f45fc59 100644 (file)
@@ -74,7 +74,7 @@ public final class OpenconfigRoutingPolicyLoader implements ConfigFileProcessor,
                 WriteTransaction.CREATE_MISSING_PARENTS);
 
         try {
-            wtx.submit().get();
+            wtx.commit().get();
         } catch (final ExecutionException | InterruptedException e) {
             LOG.warn("Failed to create Routing Policy config", e);
         }
index fb187fe61e02075b9a00827fbd475315614e2bb6..6074009ee464d4d7ec95dbf252b43bff32039125 100644 (file)
@@ -95,7 +95,7 @@ public final class NetworkTopologyConfigFileProcessor implements ConfigFileProce
             }
         }
         try {
-            wtx.submit().get();
+            wtx.commit().get();
         } catch (final ExecutionException | InterruptedException e) {
             LOG.warn("Failed to create Network Topologies", e);
         }
index 20a56060b12aa1fe06a7b0b610b4967d636283ec..2f6628f26d63e3568ecf946ae1b65009419f6a5d 100644 (file)
@@ -87,7 +87,7 @@ public class PcepStateUtilsTest extends AbstractConcurrentDataBrokerTest {
                 .child(Topology.class, new TopologyKey(new TopologyId(PCEP_TOPOLOGY)))
                 .child(Node.class, new NodeKey(new NodeId(NODE_ID))).build();
         wt.put(LogicalDatastoreType.OPERATIONAL, topology, node, true);
-        wt.submit().get();
+        wt.commit().get();
     }
 
     private PcepSessionState createPcepSessionState() {
index 0e7af2f1491daab38bd261e96454581346600194..56190f935714761a6acaaa046844e2496bf7becc 100755 (executable)
@@ -110,7 +110,7 @@ final class ServerSessionManager implements PCEPSessionListenerFactory, Topology
                                 new TopologyPcepBuilder().build()).build()).build())
                 .setNode(new ArrayList<>()).build(), true);
         try {
-            tx.submit().get();
+            tx.commit().get();
             LOG.info("PCEP Topology {} created successfully.", topologyId.getValue());
             ServerSessionManager.this.isClosed.set(false);
         } catch (final ExecutionException | InterruptedException throwable) {
index e7f27a02f8db2fa5f2c1d9b5f29d354b43efd127..3a5632319dba5e4a90cf9ec75b2dd4bda19df334 100644 (file)
@@ -113,7 +113,7 @@ public final class TopologyStatsProviderImpl implements TransactionChainListener
             for (final KeyedInstanceIdentifier<Node, NodeKey> statId : this.statsMap.keySet()) {
                 wTx.delete(LogicalDatastoreType.OPERATIONAL, statId);
             }
-            wTx.submit().get();
+            wTx.commit().get();
             this.statsMap.clear();
             this.transactionChain.close();
             this.scheduler.shutdown();
index 6507fad1b9f6c9596412f8b5cffc00f8188bd472..633e369ac6cd4a22c6a558db0d1b0be4597f1f41 100644 (file)
@@ -66,7 +66,7 @@ public final class PCEPTunnelTopologyProvider extends DefaultTopologyReference i
                                                 new TopologyTunnelPcepBuilder().build()).build()).build())
                         .setNode(new ArrayList<>()).build(), true);
         try {
-            tx.submit().get();
+            tx.commit().get();
         } catch (final InterruptedException | ExecutionException e) {
             LOG.error("Failed to create Tunnel Topology root", e);
         }
index d81a30befe0ce216bfa657b3d377f2d819ab7395..1f79e91f79333cf2f1e4d70444ed46b60d2e5dcc 100644 (file)
@@ -61,14 +61,14 @@ public class CheckUtilTest extends AbstractConcurrentDataBrokerTest {
     }
 
     @Test(expected = VerifyException.class)
-    public void testWaitFutureSuccessFail() throws Exception {
+    public void testWaitFutureSuccessFail() {
         when(this.future.isDone()).thenReturn(false);
         doReturn(this.future).when(this.future).addListener(any());
         waitFutureSuccess(this.future);
     }
 
     @Test
-    public void testWaitFutureSuccess() throws Exception {
+    public void testWaitFutureSuccess() {
         when(this.future.isSuccess()).thenReturn(true);
         doAnswer(invocation -> {
             invocation.getArgumentAt(0, GenericFutureListener.class).operationComplete(CheckUtilTest.this.future);
@@ -129,7 +129,7 @@ public class CheckUtilTest extends AbstractConcurrentDataBrokerTest {
                 new TopologyBuilder()
                         .setTopologyId(TOPOLOGY_ID)
                         .build(), true);
-        wt.submit().get();
+        wt.commit().get();
     }
 
     @Test
@@ -166,13 +166,13 @@ public class CheckUtilTest extends AbstractConcurrentDataBrokerTest {
     }
 
     @Test(expected = AssertionError.class)
-    public void testCheckReceivedMessagesNotEqual() throws Exception {
+    public void testCheckReceivedMessagesNotEqual() {
         doReturn(0).when(this.listenerCheck).getListMessageSize();
         checkReceivedMessages(this.listenerCheck, 1, TIMEOUT);
     }
 
     @Test
-    public void testCheckReceivedMessagesEqual() throws Exception {
+    public void testCheckReceivedMessagesEqual() {
         doReturn(1).when(this.listenerCheck).getListMessageSize();
         checkReceivedMessages(this.listenerCheck, 1, TIMEOUT);
     }