<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-artifacts</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>features-parent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>features-openflowjava</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
- <config.version>0.6.0-SNAPSHOT</config.version>
- <controller.mdsal.version>1.5.0-SNAPSHOT</controller.mdsal.version>
- <mdsal.version>2.2.0-SNAPSHOT</mdsal.version>
- <mdsal.model.version>0.10.0-SNAPSHOT</mdsal.model.version>
+ <config.version>0.7.0-SNAPSHOT</config.version>
+ <controller.mdsal.version>1.6.0-SNAPSHOT</controller.mdsal.version>
+ <mdsal.version>2.3.0-SNAPSHOT</mdsal.version>
+ <mdsal.model.version>0.11.0-SNAPSHOT</mdsal.model.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>features4-openflowjava</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>feature</packaging>
<dependencies>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>odl-openflowjava-all</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: Openflow Java :: All</name>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>odl-openflowjava-protocol</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>feature</packaging>
<name>OpenDaylight :: Openflow Java :: Protocol</name>
<properties>
- <config.version>0.6.0-SNAPSHOT</config.version>
- <controller.mdsal.version>1.5.0-SNAPSHOT</controller.mdsal.version>
- <mdsal.version>2.2.0-SNAPSHOT</mdsal.version>
- <mdsal.model.version>0.10.0-SNAPSHOT</mdsal.model.version>
- <odlparent.netty>1.8.0-SNAPSHOT</odlparent.netty>
+ <config.version>0.7.0-SNAPSHOT</config.version>
+ <controller.mdsal.version>1.6.0-SNAPSHOT</controller.mdsal.version>
+ <mdsal.version>2.3.0-SNAPSHOT</mdsal.version>
+ <mdsal.model.version>0.11.0-SNAPSHOT</mdsal.model.version>
+ <odlparent.netty>1.9.0-SNAPSHOT</odlparent.netty>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>features-aggregator</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.10.0-SNAPSHOT</version>
+ <version>0.11.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflow-protocol-api</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Openflow Protocol Library - API</name>
<scm>
</scm>
<properties>
- <mdsal.version>2.2.0-SNAPSHOT</mdsal.version>
- <mdsal.model.version>0.10.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>2.3.0-SNAPSHOT</mdsal.version>
+ <mdsal.model.version>0.11.0-SNAPSHOT</mdsal.model.version>
</properties>
<dependencyManagement>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>openflow-protocol-impl</artifactId>
</generator>
<generator>
<codeGeneratorClass>
- org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+ org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl
</codeGeneratorClass>
<outputBaseDir>${salGeneratorPath}</outputBaseDir>
</generator>
<generator>
- <codeGeneratorClass>org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
+ <codeGeneratorClass>org.opendaylight.mdsal.binding.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
<outputBaseDir>${project.build.directory}/site/models</outputBaseDir>
</generator>
</codeGenerators>
*/
package org.opendaylight.openflowjava.protocol.impl.core.connection;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.net.InetAddress;
import java.util.concurrent.ExecutionException;
import org.mockito.MockitoAnnotations;
import org.opendaylight.openflowjava.protocol.impl.core.UdpChannelInitializer;
import org.opendaylight.openflowjava.protocol.impl.core.UdpHandler;
-
-import com.google.common.util.concurrent.ListenableFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author madamjak
*
*/
public class UdpHandlerTest {
- @Mock UdpChannelInitializer udpChannelInitializerMock;
- UdpHandler udpHandler;
+
+ private static final Logger LOG = LoggerFactory.getLogger(UdpHandlerTest.class);
+
+ @Mock
+ private UdpChannelInitializer udpChannelInitializerMock;
+ private UdpHandler udpHandler;
/**
* Mock init
*/
* @throws IOException
*/
@Test
- public void testWithEmptyAddress() throws InterruptedException, ExecutionException, IOException {
+ public void testWithEmptyAddress() throws Exception {
udpHandler = new UdpHandler(null, 0);
udpHandler.setChannelInitializer(udpChannelInitializerMock);
Assert.assertTrue("Wrong - start server", startupServer(false));
try {
- Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS).booleanValue());
+ Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500, TimeUnit.MILLISECONDS));
} catch (TimeoutException e) {
Assert.fail("Wrong - getIsOnlineFuture timed out");
}
* @throws IOException
*/
@Test
- public void testWithEmptyAddressOnEpoll() throws InterruptedException, ExecutionException, IOException {
+ public void testWithEmptyAddressOnEpoll() throws Exception {
udpHandler = new UdpHandler(null, 0);
udpHandler.setChannelInitializer(udpChannelInitializerMock);
Assert.assertTrue("Wrong - start server", startupServer(true));
try {
- Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS).booleanValue());
+ Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS));
} catch (TimeoutException e) {
Assert.fail("Wrong - getIsOnlineFuture timed out");
}
* @throws IOException
*/
@Test
- public void testWithAddressAndPort() throws InterruptedException, ExecutionException, IOException{
+ public void testWithAddressAndPort() throws Exception{
int port = 9874;
udpHandler = new UdpHandler(InetAddress.getLocalHost(), port);
udpHandler.setChannelInitializer(udpChannelInitializerMock);
Assert.assertTrue("Wrong - start server", startupServer(false));
try {
- Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS).booleanValue());
+ Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS));
} catch (TimeoutException e) {
Assert.fail("Wrong - getIsOnlineFuture timed out");
}
* @throws IOException
*/
@Test
- public void testWithAddressAndPortOnEpoll() throws InterruptedException, ExecutionException, IOException{
+ public void testWithAddressAndPortOnEpoll() throws Exception {
int port = 9874;
udpHandler = new UdpHandler(InetAddress.getLocalHost(), port);
udpHandler.setChannelInitializer(udpChannelInitializerMock);
Assert.assertTrue("Wrong - start server", startupServer(true));
try {
- Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS).booleanValue());
+ Assert.assertTrue(udpHandler.getIsOnlineFuture().get(1500,TimeUnit.MILLISECONDS));
} catch (TimeoutException e) {
Assert.fail("Wrong - getIsOnlineFuture timed out");
}
shutdownServer();
}
- private Boolean startupServer(boolean isEpollEnabled) throws InterruptedException, IOException, ExecutionException {
+ private Boolean startupServer(final boolean isEpollEnabled) throws InterruptedException, IOException, ExecutionException {
ListenableFuture<Boolean> online = udpHandler.getIsOnlineFuture();
/**
* Test EPoll based native transport if isEpollEnabled is true.
* Else use Nio based transport.
*/
udpHandler.initiateEventLoopGroups(null, isEpollEnabled);
- (new Thread(udpHandler)).start();
- int retry = 0;
- while (online.isDone() != true && retry++ < 20) {
- Thread.sleep(100);
- }
- return online.isDone() ;
+ (new Thread(udpHandler)).start();
+
+ boolean startedSuccessfully = false;
+ try {
+ startedSuccessfully = online.get(10, TimeUnit.SECONDS);
+ } catch (TimeoutException e) {
+ LOG.warn("Timeout while waiting for UDP handler to start", e);
+ }
+
+ return online.isDone();
}
- private void shutdownServer() throws InterruptedException, ExecutionException {
+ private void shutdownServer() throws InterruptedException, ExecutionException, TimeoutException {
ListenableFuture<Boolean> shutdownRet = udpHandler.shutdown() ;
- while ( shutdownRet.isDone() != true )
- Thread.sleep(100) ;
- Assert.assertTrue("Wrong - shutdown failed", shutdownRet.get());
+ final Boolean shutdownSucceeded = shutdownRet.get(10, TimeUnit.SECONDS);
+ Assert.assertTrue("Wrong - shutdown failed", shutdownSucceeded);
}
}
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>openflow-protocol-it</artifactId>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>openflow-protocol-spi</artifactId>
</generator>
<generator>
<codeGeneratorClass>
- org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+ org.opendaylight.mdsal.binding.maven.api.gen.plugin.CodeGeneratorImpl
</codeGeneratorClass>
<outputBaseDir>${salGeneratorPath}</outputBaseDir>
</generator>
<generator>
- <codeGeneratorClass>org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
+ <codeGeneratorClass>org.opendaylight.mdsal.binding.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
<outputBaseDir>${project.build.directory}/site/models</outputBaseDir>
</generator>
</codeGenerators>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>openflowjava-blueprint-config</artifactId>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>openflowjava-config</artifactId>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<packaging>bundle</packaging>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>openflowjava</name> <!-- Used by Sonar to set project name -->
<description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jmxGeneratorPath>${project.build.directory}/yang-gen-config</jmxGeneratorPath>
- <karaf.distro.empty.version>1.8.0-SNAPSHOT</karaf.distro.empty.version>
+ <karaf.distro.empty.version>1.9.0-SNAPSHOT</karaf.distro.empty.version>
<salGeneratorPath>${project.build.directory}/yang-gen-sal</salGeneratorPath>
- <config.version>0.6.0-SNAPSHOT</config.version>
- <controller.mdsal.version>1.5.0-SNAPSHOT</controller.mdsal.version>
- <mdsal.model.version>0.10.0-SNAPSHOT</mdsal.model.version>
- <yangtools.version>1.1.0-SNAPSHOT</yangtools.version>
+ <config.version>0.7.0-SNAPSHOT</config.version>
+ <controller.mdsal.version>1.6.0-SNAPSHOT</controller.mdsal.version>
+ <mdsal.model.version>0.11.0-SNAPSHOT</mdsal.model.version>
+ <yangtools.version>1.2.0-SNAPSHOT</yangtools.version>
<argparse4j.version>0.7.0</argparse4j.version>
</properties>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>
<parent>
<groupId>org.opendaylight.openflowjava</groupId>
<artifactId>openflowjava-parent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>0.10.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>simple-client</artifactId>