Bug 5377: Support configuring cipher suites to use for SSLEngine
[openflowjava.git] / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / core / PublishingChannelInitializerTest.java
index 3d8717c7d0f599ad6122e197efdc00a0009fbd8e..b855cc917ec3f11e48bcc5637577e9f6fb007b11 100644 (file)
@@ -20,13 +20,10 @@ import io.netty.channel.ChannelPipeline;
 import io.netty.channel.group.DefaultChannelGroup;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.handler.ssl.SslHandler;
-
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
-
 import javax.net.ssl.SSLEngine;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -42,6 +39,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.K
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.provider.impl.rev140328.Tls;
 
+import com.google.common.collect.Lists;
+
 /**
  *
  * @author james.hall
@@ -76,13 +75,14 @@ public class PublishingChannelInitializerTest {
         pubChInitializer.setDeserializationFactory(mockDeserializationFactory);
         pubChInitializer.setSwitchIdleTimeout(1) ;
         pubChInitializer.getConnectionIterator() ;
+        pubChInitializer.setUseBarrier(true);
 
         when( mockChGrp.size()).thenReturn(1) ;
         pubChInitializer.setSwitchConnectionHandler( mockSwConnHandler ) ;
 
         inetSockAddr = new InetSocketAddress(InetAddress.getLocalHost(), 8675 ) ;
 
-        when(mockConnAdaptorFactory.createConnectionFacade(mockSocketCh, null))
+        when(mockConnAdaptorFactory.createConnectionFacade(mockSocketCh, null, true))
         .thenReturn(mockConnFacade);
         when(mockSocketCh.remoteAddress()).thenReturn(inetSockAddr) ;
         when(mockSocketCh.localAddress()).thenReturn(inetSockAddr) ;
@@ -91,7 +91,8 @@ public class PublishingChannelInitializerTest {
         when(mockSocketCh.pipeline()).thenReturn(mockChPipeline) ;
 
         tlsConfiguration = new TlsConfigurationImpl(KeystoreType.JKS, "/selfSignedSwitch", PathType.CLASSPATH,
-                KeystoreType.JKS, "/selfSignedController", PathType.CLASSPATH);
+                KeystoreType.JKS, "/selfSignedController", PathType.CLASSPATH,
+                Lists.newArrayList("TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA256"));
     }