hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1571453 - in /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http: conn/ssl/ impl/client/integration/ impl/conn/
Date Mon, 24 Feb 2014 21:40:42 GMT
Author: sebb
Date: Mon Feb 24 21:40:41 2014
New Revision: 1571453

URL: http://svn.apache.org/r1571453
Log:
General tidy

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLContextBuilder.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestSystemDefaultRoutePlanner.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLContextBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLContextBuilder.java?rev=1571453&r1=1571452&r2=1571453&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLContextBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/ssl/TestSSLContextBuilder.java
Mon Feb 24 21:40:41 2014
@@ -82,7 +82,7 @@ public class TestSSLContextBuilder {
         final KeyStore keystore = load("test-keypasswd.keystore", "nopassword".toCharArray());
         final String keyPassword = "password";
         new SSLContextBuilder()
-                .loadKeyMaterial(keystore, keyPassword != null ? keyPassword.toCharArray()
: null)
+                .loadKeyMaterial(keystore, keyPassword.toCharArray())
                 .loadTrustMaterial(keystore)
                 .build();
     }
@@ -92,7 +92,7 @@ public class TestSSLContextBuilder {
         final KeyStore keystore = load("test-keypasswd.keystore", "nopassword".toCharArray());
         final String keyPassword = "!password";
         new SSLContextBuilder()
-                .loadKeyMaterial(keystore, keyPassword != null ? keyPassword.toCharArray()
: null)
+                .loadKeyMaterial(keystore, keyPassword.toCharArray())
                 .loadTrustMaterial(keystore)
                 .build();
     }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java?rev=1571453&r1=1571452&r2=1571453&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java
Mon Feb 24 21:40:41 2014
@@ -107,6 +107,9 @@ public class TestCookieVirtualHost exten
                     response.setStatusLine(HttpVersion.HTTP_1_1,
                             HttpStatus.SC_OK);
                     break;
+                default:
+                    Assert.fail("Unexpected value: " + n);
+                    break;
                 }
             }
 
@@ -122,6 +125,7 @@ public class TestCookieVirtualHost exten
         URI uri = new URI("http://app.mydomain.fr");
         HttpRequest httpRequest = new HttpGet(uri);
         httpRequest.addHeader("X-Request", "1");
+        @SuppressWarnings("resource")
         final HttpResponse response1 = this.httpclient.execute(getServerHttp(),
                 httpRequest, context);
         final HttpEntity e1 = response1.getEntity();
@@ -137,6 +141,7 @@ public class TestCookieVirtualHost exten
         uri = new URI("http://app.mydomain.fr");
         httpRequest = new HttpGet(uri);
         httpRequest.addHeader("X-Request", "2");
+        @SuppressWarnings("resource")
         final HttpResponse response2 = this.httpclient.execute(getServerHttp(),
                 httpRequest, context);
         final HttpEntity e2 = response2.getEntity();
@@ -146,6 +151,7 @@ public class TestCookieVirtualHost exten
         uri = new URI("http://app.mydomain.fr");
         httpRequest = new HttpGet(uri);
         httpRequest.addHeader("X-Request", "3");
+        @SuppressWarnings("resource")
         final HttpResponse response3 = this.httpclient.execute(getServerHttp(),
                 httpRequest, context);
         final HttpEntity e3 = response3.getEntity();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java?rev=1571453&r1=1571452&r2=1571453&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java
Mon Feb 24 21:40:41 2014
@@ -30,7 +30,6 @@ package org.apache.http.impl.conn;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestSystemDefaultRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestSystemDefaultRoutePlanner.java?rev=1571453&r1=1571452&r2=1571453&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestSystemDefaultRoutePlanner.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/conn/TestSystemDefaultRoutePlanner.java
Mon Feb 24 21:40:41 2014
@@ -46,6 +46,7 @@ import org.apache.http.protocol.HttpCont
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 /**
@@ -76,7 +77,7 @@ public class TestSystemDefaultRoutePlann
         Assert.assertEquals(target, route.getTargetHost());
         Assert.assertEquals(1, route.getHopCount());
         Assert.assertFalse(route.isSecure());
-        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Mockito.<HttpHost>any());
+        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Matchers.<HttpHost>any());
     }
 
     @Test



Mime
View raw message