<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
final Throwable cause) {
- LOG.error("Broken chain {} in DatastoreBaAbstractWrite, transaction {}, cause {}", chain,
- transaction.getIdentifier(), cause);
+ LOG.error("Broken chain {} in DatastoreBaAbstractWrite, transaction {}", chain, transaction.getIdentifier(),
+ cause);
close();
}
private static String createKey(final String address) {
return address + PREFIX;
}
-}
\ No newline at end of file
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.benchmark.app;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.opendaylight.protocol.util.CheckUtil.checkEquals;
+import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentConfiguration;
import static org.opendaylight.protocol.util.CheckUtil.readDataConfiguration;
import javax.management.MalformedObjectNameException;
final Result deleteResult = deleteRpcResult.getResult().getResult();
checkEquals(() -> assertEquals(1, deleteResult.getCount().intValue()));
checkEquals(() -> assertEquals(1, deleteResult.getRate().intValue()));
- readDataConfiguration(getDataBroker(), routesIID, routes -> {
- assertNotNull(routes.getIpv4Route());
- assertTrue(routes.getIpv4Route().isEmpty());
- return routes;
- });
+
+ checkNotPresentConfiguration(getDataBroker(), appPeerBenchmark.getIpv4RoutesIID());
appPeerBenchmark.close();
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
discovered by the plugin.
-->
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
</dependencies>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>yang-ext</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-spec-util</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.1</version>
+ <exclusions>
+ <exclusion>
+ <!-- Provided by JDK -->
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- test scope dependencies -->
<dependency>
<artifactId>mdsal-binding-dom-codec</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<dependencies>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-interfaces</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc8343</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>mdsal-binding-spec-util</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>mdsal-common-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>yang-data-impl</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<artifactId>bgp-concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>bgp-parser-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>mdsal-binding-generator-impl</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
*/
package org.opendaylight.protocol.bgp.rib.impl;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
import static org.opendaylight.protocol.util.CheckUtil.waitFutureSuccess;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.bgp.rib.rib.loc.rib.tables.routes.Ipv4RoutesCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.prefixes.DestinationIpv4Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.prefixes.destination.ipv4.Ipv4PrefixesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.Ipv4Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.ipv4.routes.Ipv4Route;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv4CaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.NotifyBuilder;
protected StrictBGPPeerRegistry serverRegistry;
protected CodecsRegistryImpl codecsRegistry;
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
this.ribExtension.getClassLoadingStrategy());
}
+ @Override
@After
public void tearDown() throws ExecutionException, InterruptedException {
this.serverDispatcher.close();
}
private void checkLocRib(final int expectedRoutesOnDS) throws Exception {
+ // FIXME: remove this sleep
Thread.sleep(100);
readDataOperational(getDataBroker(), BGP_IID, bgpRib -> {
final Ipv4RoutesCase routes = (Ipv4RoutesCase) bgpRib.getRib().get(0).getLocRib().getTables().get(0)
.getRoutes();
- final List<Ipv4Route> routeList = routes.getIpv4Routes().getIpv4Route();
- Assert.assertEquals(expectedRoutesOnDS, routeList.size());
+ final int size;
+ if (routes != null) {
+ final Ipv4Routes routesCase = routes.getIpv4Routes();
+ if (routesCase != null) {
+ final List<Ipv4Route> routeList = routesCase.getIpv4Route();
+ size = routeList == null ? 0 : routeList.size();
+ } else {
+ size = 0;
+ }
+ } else {
+ size = 0;
+ }
+
+ Assert.assertEquals(expectedRoutesOnDS, size);
return bgpRib;
});
}
*/
package org.opendaylight.protocol.bgp.rib.impl;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
doNothing().when(getTransaction()).put(eq(LogicalDatastoreType.OPERATIONAL),
eq(YangInstanceIdentifier.of(BgpRib.QNAME)), any(NormalizedNode.class));
doReturn(map).when(this.dom).getSupportedExtensions();
- doReturn(this.domChain).when(this.dom).createTransactionChain(any(BGPPeer.class));
+ doReturn(this.domChain).when(this.dom).createTransactionChain(any(AbstractPeer.class));
doReturn(this.transWrite).when(this.chain).newWriteOnlyTransaction();
doReturn(false).when(this.o).isPresent();
doReturn(this.o).when(this.future).get();
package org.opendaylight.protocol.bgp.rib.impl.config;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
private DOMDataTreeChangeService dataTreeChangeService;
private final BGPPeerTracker peerTracker = new BGPPeerTrackerImpl();
+ @Override
@Before
public void setUp() throws Exception {
super.setUp();
doReturn(new BgpId("127.0.0.1")).when(this.rib).getBgpIdentifier();
doReturn(true).when(this.future).cancel(true);
doReturn(this.future).when(this.dispatcher).createReconnectingClient(any(InetSocketAddress.class),
- any(InetSocketAddress.class), anyInt(), any(KeyMapping.class));
+ any(), anyInt(), any(KeyMapping.class));
doReturn(this.dispatcher).when(this.rib).getDispatcher();
doReturn(java.util.Optional.of(new BgpTableTypeImpl(Ipv4AddressFamily.class,
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
this.bgpPeer.instantiateServiceInstance();
verify(this.bgpPeerRegistry).addPeer(any(), any(), any());
verify(this.dispatcher).createReconnectingClient(any(InetSocketAddress.class),
- any(InetSocketAddress.class), anyInt(), any(KeyMapping.class));
+ any(), anyInt(), any(KeyMapping.class));
try {
this.bgpPeer.start(this.rib, neighbor, null, this.peerGroupLoader, this.tableTypeRegistry);
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<artifactId>bgp-openconfig-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>yang-binding</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
}
addFutureListener(localAddress, dispatcher.createServer(localAddress));
}
- LOG.debug("{} {}", sessionListener, proposal);
+ LOG.debug("Listener {} received proposal {}", sessionListener, proposal);
}
private static <T> void addFutureListener(final InetSocketAddress localAddress, final Future<T> future) {
<artifactId>ietf-topology-l3-unicast-igp</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
import com.google.common.base.Preconditions;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
if (present.useCount == 0) {
final IgpNodeAttributes attrs = read(trans, present.attrId);
if (attrs != null) {
- present.useCount = attrs.getPrefix().size();
- if (present.useCount == 0) {
- trans.delete(LogicalDatastoreType.OPERATIONAL, nodeInstanceId(ni));
- this.nodes.remove(ni);
- }
+ final List<Prefix> prefix = attrs.getPrefix();
+ present.useCount = prefix == null ? 0 : prefix.size();
+ } else {
+ present.useCount = 0;
+ }
+ if (present.useCount == 0) {
+ trans.delete(LogicalDatastoreType.OPERATIONAL, nodeInstanceId(ni));
+ this.nodes.remove(ni);
}
}
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentOperational;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
wTx.delete(LogicalDatastoreType.OPERATIONAL, this.ipv4RouteIID);
wTx.commit();
readDataOperational(getDataBroker(), this.ipv4TopoBuilder.getInstanceIdentifier(), topology -> {
- assertEquals(0, topology.getNode().size());
+ assertNull(topology.getNode());
return topology;
});
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.opendaylight.bgpcep.bgp.topology.provider.Ipv4ReachabilityTopologyBuilderTest.PATH_ID;
import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentOperational;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
wTx.delete(LogicalDatastoreType.OPERATIONAL, this.ipv6RouteIID);
wTx.commit();
readDataOperational(getDataBroker(), this.ipv6TopoBuilder.getInstanceIdentifier(), topology -> {
- assertEquals(0, topology.getNode().size());
+ assertNull(topology.getNode());
return topology;
});
wTx.delete(LogicalDatastoreType.OPERATIONAL, this.linkstateRouteIID);
wTx.commit();
readDataOperational(getDataBroker(), this.linkstateTopoBuilder.getInstanceIdentifier(), topology -> {
- assertEquals(0, topology.getNode().size());
- assertEquals(0, topology.getLink().size());
+ assertNull(topology.getNode());
+ assertNull(topology.getLink());
return topology;
});
}
</dependency>
<!-- Test dependencies -->
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.14.0-SNAPSHOT</version>
+ <version>3.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>checkstyle-logging</artifactId>
- <version>2.0.10</version>
+ <version>2.1.2</version>
</dependency>
</dependencies>
</plugin>
<dependencies>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bmp.impl.app;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.opendaylight.protocol.bmp.parser.message.TestUtil.createRouteMonMsgWithEndOfRibMarker;
import static org.opendaylight.protocol.bmp.parser.message.TestUtil.createRouteMonitMsg;
+import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentOperational;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
import com.google.common.net.InetAddresses;
this.bmpApp.close();
this.mappingService.close();
- readDataOperational(getDataBroker(), BMP_II, monitor -> {
- assertTrue(monitor.getMonitor().isEmpty());
- return monitor;
- });
+ checkNotPresentOperational(getDataBroker(), BMP_II);
}
@Test(timeout = 20000)
channel4.close().sync();
readDataOperational(getDataBroker(), MONITOR_IID, monitor -> {
- assertEquals(0, monitor.getRouter().size());
+ assertNull(monitor.getRouter());
return monitor;
});
}
final RouterId routerId = getRouterId(remoteRouterIpAddr);
readDataOperational(getDataBroker(), MONITOR_IID, monitor -> {
- assertFalse(monitor.getRouter().isEmpty());
+ assertNotNull(monitor.getRouter());
// now find the current router instance
Router router = null;
for (final Router r : monitor.getRouter()) {
.createInitMsg("description", "name", "some info")));
readDataOperational(getDataBroker(), MONITOR_IID, monitor -> {
- assertFalse(monitor.getRouter().isEmpty());
+ assertNotNull(monitor.getRouter());
Router retRouter = null;
for (final Router r : monitor.getRouter()) {
if (routerId.equals(r.getRouterId())) {
waitWriteAndFlushSuccess(channel.writeAndFlush(TestUtil.createPeerDownNotification(PEER1)));
readDataOperational(getDataBroker(), routerIId, router -> {
- final List<Peer> peersAfterDown = router.getPeer();
- assertTrue(peersAfterDown.isEmpty());
+ assertNull(router.getPeer());
return router;
});
<artifactId>util</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
discovered by the plugin.
-->
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<!-- Testing dependencies -->
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+
<!-- test scope dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-yang-types-20130715</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-yang-types</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-interfaces</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc8343</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
-->
<features name="odl-bgpcep-bgp-dependencies-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<feature name="odl-bgpcep-bgp-dependencies" version="${project.version}">
- <feature version="[2.0.10,3)">odl-yangtools-data-api</feature>
+ <feature version="[2.1,3)">odl-yangtools-data-api</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>2.0.10</version>
+ <version>2.1.2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>2.6.0-SNAPSHOT</version>
+ <version>3.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<type>pom</type>
<scope>import</scope>
</dependency>
+
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0-2</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>checkstyle-logging</artifactId>
- <version>2.0.10</version>
+ <version>2.1.2</version>
</dependency>
</dependencies>
<configuration>
discovered by the plugin.
-->
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<!-- Testing dependencies -->
<artifactId>ietf-topology</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
discovered by the plugin.
-->
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<!-- Testing dependencies -->
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>programming-topology-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>util</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
@Override
public void onFailure(final Throwable throwable) {
- LOG.trace("Put topology Node failed {}, value {}, {}", TopologyNodeState.this.nodeId, node, throwable);
+ LOG.trace("Put topology Node failed {}, value {}", TopologyNodeState.this.nodeId, node, throwable);
}
}, MoreExecutors.directExecutor());
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLsp;
import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createPath;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
this.listener.onMessage(this.session, pcRpt);
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
- assertEquals(1, pcc.getReportedLsp().size());
+ final List<?> lsp = pcc.getReportedLsp();
+ assertNotNull(lsp);
+ assertEquals(1, lsp.size());
return pcc;
});
//check node - synchronized
assertEquals(PccSyncState.Synchronized, pcc.getStateSync());
//check reported LSP
- assertEquals(0, pcc.getReportedLsp().size());
+ assertNull(pcc.getReportedLsp());
return pcc;
});
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createLsp;
import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.createPath;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
//check node - synchronized
assertEquals(PccSyncState.Synchronized, pcc.getStateSync());
//check reported LSP is empty, LSP state from previous session was purged
- assertTrue(pcc.getReportedLsp().isEmpty());
+ assertNull(pcc.getReportedLsp());
return pcc;
});
}
// check if lsp was removed
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
- assertEquals(0, pcc.getReportedLsp().size());
+ assertNull(pcc.getReportedLsp());
return pcc;
});
// check stats
*/
package org.opendaylight.bgpcep.pcep.topology.provider;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitTriggerSyncInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitUpdateLspInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.AddLspArgs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.AddLspInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.AddLspOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.RemoveLspArgs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.RemoveLspInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.RemoveLspOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.TriggerSyncArgs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.TriggerSyncInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.TriggerSyncOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.UpdateLspArgs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.UpdateLspInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.UpdateLspOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.ensure.lsp.operational.args.ArgumentsBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
doAnswer(invocation -> {
TopologyProgrammingTest.this.addLspArgs = (AddLspArgs) invocation.getArguments()[0];
return TopologyProgrammingTest.this.futureAddLspOutput;
- }).when(listener).addLsp(any(AddLspInput.class));
+ }).when(listener).addLsp(any());
doAnswer(invocation -> {
TopologyProgrammingTest.this.updateLspArgs = (UpdateLspArgs) invocation.getArguments()[0];
return TopologyProgrammingTest.this.futureUpdateLspOutput;
- }).when(listener).updateLsp(any(UpdateLspInput.class));
+ }).when(listener).updateLsp(any());
doAnswer(invocation -> {
TopologyProgrammingTest.this.removeLspArgs = (RemoveLspArgs) invocation.getArguments()[0];
return TopologyProgrammingTest.this.futureRemoveLspOutput;
- }).when(listener).removeLsp(any(RemoveLspInput.class));
+ }).when(listener).removeLsp(any());
doAnswer(invocation -> {
TopologyProgrammingTest.this.triggerSyncArgs = (TriggerSyncArgs) invocation.getArguments()[0];
return TopologyProgrammingTest.this.futureTriggerSyncOutput;
- }).when(listener).triggerSync(any(TriggerSyncInput.class));
+ }).when(listener).triggerSync(any());
doAnswer(invocation -> {
TopologyProgrammingTest.this.ensureLspInput = (EnsureLspOperationalInput) invocation.getArguments()[0];
return TopologyProgrammingTest.this.futureEnsureLspOutput;
}
public static FailureCase schedule(final InstructionScheduler scheduler, final AbstractInstructionExecutor fwd) {
+ final SubmitInstructionInput input = fwd.getInput();
final ListenableFuture<Instruction> listenableFuture;
try {
- listenableFuture = scheduler.scheduleInstruction(fwd.getInput());
+ listenableFuture = scheduler.scheduleInstruction(input);
} catch (final SchedulerException e) {
- LOG.info("Instuction {} failed to schedule", e.getMessage(), e);
+ LOG.info("Instuction {} failed to schedule", input, e);
return new FailureCaseBuilder().setFailure(e.getFailure()).build();
}
Futures.addCallback(listenableFuture, fwd, MoreExecutors.directExecutor());
}
public synchronized void init() {
- LOG.info("Initializing TopologyStatsProvider service.", this);
+ LOG.info("Initializing TopologyStatsProvider service.");
this.transactionChain = this.dataBroker.createTransactionChain(this);
final TimerTask task = new TimerTask() {
@Override
}
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(CommitInfo result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Successfully committed Topology stats update");
}
@Override
- public void onFailure(Throwable ex) {
+ public void onFailure(final Throwable ex) {
LOG.error("Failed to commit Topology stats update", ex);
}
}, MoreExecutors.directExecutor());
@Override
public synchronized void close() throws Exception {
if (closed.compareAndSet(false, true)) {
- LOG.info("Closing TopologyStatsProvider service.", this);
+ LOG.info("Closing TopologyStatsProvider service.");
this.scheduleTask.cancel(true);
final WriteTransaction wTx = this.transactionChain.newWriteOnlyTransaction();
for (final KeyedInstanceIdentifier<Node, NodeKey> statId : this.statsMap.keySet()) {
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-topology-l3-unicast-igp</artifactId>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>pcep-topology-provider</artifactId>
- </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.MoreExecutors;
private static void enumerateLsps(final InstanceIdentifier<Node> id, final Node node,
final Set<InstanceIdentifier<ReportedLsp>> lsps) {
if (node == null) {
- LOG.trace("Skipping null node", id);
+ LOG.trace("Skipping null node {}", id);
return;
}
final Node1 pccnode = node.augmentation(Node1.class);
boolean orphDstNode = true;
boolean orphDstTp = true;
boolean orphSrcTp = true;
- for (final Link lw : topology.getLink()) {
+ for (final Link lw : nonNullList(topology.getLink())) {
LOG.trace("Checking link {}", lw);
final NodeId sn = lw.getSource().getSourceNode();
DataBroker getDataProvider() {
return dataProvider;
}
+
+ private static <T> List<T> nonNullList(final List<T> nullable) {
+ return nullable != null ? nullable : ImmutableList.of();
+ }
}
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;
import javax.annotation.concurrent.GuardedBy;
-import org.opendaylight.bgpcep.pcep.topology.provider.config.PCEPTopologyDeployerImpl;
import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
import org.opendaylight.bgpcep.topology.TopologyReference;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
public final class PCEPTunnelTopologyProvider extends DefaultTopologyReference implements AutoCloseable {
- private static final Logger LOG = LoggerFactory.getLogger(PCEPTopologyDeployerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(PCEPTunnelTopologyProvider.class);
private final NodeChangedListener ncl;
private final InstanceIdentifier<Node> src;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.GuardedBy;
import org.apache.commons.lang3.StringUtils;
-import org.opendaylight.bgpcep.pcep.topology.provider.config.PCEPTopologyDeployerImpl;
import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
public final class TunnelProviderDeployer implements ClusteredDataTreeChangeListener<Topology>, AutoCloseable {
- private static final Logger LOG = LoggerFactory.getLogger(PCEPTopologyDeployerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TunnelProviderDeployer.class);
private static final long TIMEOUT_NS = TimeUnit.SECONDS.toNanos(5);
private final TunnelProviderDependencies dependencies;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
import com.google.common.collect.Lists;
removeNode(NODE1_ID);
removeNode(NODE2_ID);
readDataOperational(getDataBroker(), TUNNEL_TOPO_IID, removedNodeTopo -> {
- assertEquals(0, removedNodeTopo.getNode().size());
- assertEquals(0, removedNodeTopo.getLink().size());
+ assertNull(removedNodeTopo.getNode());
+ assertNull(removedNodeTopo.getLink());
return removedNodeTopo;
});
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>checkstyle-logging</artifactId>
- <version>2.0.10</version>
+ <version>2.1.2</version>
</dependency>
</dependencies>
</plugin>
throws ReadFailedException {
AssertionError lastError = null;
final Stopwatch sw = Stopwatch.createStarted();
- while (sw.elapsed(TimeUnit.SECONDS) <= timeout) {
+ do {
try (ReadOnlyTransaction tx = dataBroker.newReadOnlyTransaction()) {
final Optional<T> data = tx.read(ldt, iid).checkedGet();
if (data.isPresent()) {
}
}
}
- }
+ } while (sw.elapsed(TimeUnit.SECONDS) <= timeout);
throw lastError;
}
public interface CheckEquals {
void check() throws ExecutionException, InterruptedException;
}
-}
\ No newline at end of file
+}
import static junit.framework.TestCase.assertNull;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
public void testWaitFutureSuccess() {
when(this.future.isSuccess()).thenReturn(true);
doAnswer(invocation -> {
- invocation.getArgumentAt(0, GenericFutureListener.class).operationComplete(CheckUtilTest.this.future);
+ invocation.<GenericFutureListener>getArgument(0).operationComplete(CheckUtilTest.this.future);
return CheckUtilTest.this.future;
}).when(this.future).addListener(any());
waitFutureSuccess(this.future);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.3</version>
+ <version>4.0.2</version>
<relativePath/>
</parent>
<artifactId>concepts</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
<dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
</dependency>
<!-- Testing dependencies -->
<dependency>