camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [2/2] camel git commit: Fixed CS
Date Wed, 26 Oct 2016 14:29:07 GMT
Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7c0eb6d5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c0eb6d5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c0eb6d5

Branch: refs/heads/master
Commit: 7c0eb6d5f94d33b4f2efe879e97d82f1c0898db6
Parents: d1f94b2
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Wed Oct 26 16:27:02 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Wed Oct 26 16:27:58 2016 +0200

----------------------------------------------------------------------
 .../netty4/NettySSLConsumerClientModeTest.java  | 79 ++++++++++----------
 1 file changed, 39 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7c0eb6d5/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettySSLConsumerClientModeTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettySSLConsumerClientModeTest.java
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettySSLConsumerClientModeTest.java
index f36e920..44ada54 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettySSLConsumerClientModeTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettySSLConsumerClientModeTest.java
@@ -16,6 +16,21 @@
  */
 package org.apache.camel.component.netty4;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.TrustManagerFactory;
 
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.channel.Channel;
@@ -34,22 +49,6 @@ import io.netty.handler.codec.string.StringDecoder;
 import io.netty.handler.codec.string.StringEncoder;
 import io.netty.handler.ssl.SslHandler;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.TrustManagerFactory;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
@@ -170,30 +169,30 @@ public class NettySSLConsumerClientModeTest extends BaseNettyTest {
 
         private SSLContext sslContext;
 
-        public ServerInitializer() {
-			super();
-			try {
-				// create the SSLContext that will be used to create SSLEngine instances
-				char[] pass = "changeit".toCharArray();
-				
-			    KeyManagerFactory kmf;
-					kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-			    TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
-			    
-			    KeyStore ks = KeyStore.getInstance("JKS");
-			    try (InputStream ksStream = new FileInputStream(new File("src/test/resources/keystore.jks")))
{
-			    	ks.load(ksStream, pass);
-				}
-			    kmf.init(ks, pass);
-			    tmf.init(ks);
-
-			    sslContext = SSLContext.getInstance("TLS");
-	
-			    sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-			} catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException
| UnrecoverableKeyException | KeyManagementException e) {
-				e.printStackTrace();
-			}
-		}
+        ServerInitializer() {
+            super();
+            try {
+                // create the SSLContext that will be used to create SSLEngine instances
+                char[] pass = "changeit".toCharArray();
+                
+                KeyManagerFactory kmf;
+                kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+                TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+                
+                KeyStore ks = KeyStore.getInstance("JKS");
+                try (InputStream ksStream = new FileInputStream(new File("src/test/resources/keystore.jks")))
{
+                    ks.load(ksStream, pass);
+                }
+                kmf.init(ks, pass);
+                tmf.init(ks);
+
+                sslContext = SSLContext.getInstance("TLS");
+
+                sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+            } catch (NoSuchAlgorithmException | KeyStoreException | CertificateException
| IOException | UnrecoverableKeyException | KeyManagementException e) {
+                e.printStackTrace();
+            }
+        }
        
         @Override
         public void initChannel(SocketChannel ch) throws Exception {


Mime
View raw message