Author: markt
Date: Mon Aug 27 20:23:42 2012
New Revision: 1377826
URL: http://svn.apache.org/viewvc?rev=1377826&view=rev
Log:
Java 7 <>
Modified:
tomcat/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
Modified:
tomcat/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java?rev=1377826&r1=1377825&r2=1377826&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
(original)
+++
tomcat/trunk/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
Mon Aug 27 20:23:42 2012
@@ -175,14 +175,13 @@ public class TestDigestAuthenticator ext
} else {
digestUri = uri;
}
- List<String> auth = new ArrayList<String>();
+ List<String> auth = new ArrayList<>();
auth.add(buildDigestResponse(user, pwd, digestUri, realm, "null",
"null", nc1, cnonce, qop));
- Map<String,List<String>> reqHeaders = new
HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders = new HashMap<>();
reqHeaders.put(CLIENT_AUTH_HEADER, auth);
- Map<String,List<String>> respHeaders =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> respHeaders = new HashMap<>();
// The first request will fail - but we need to extract the nonce
ByteChunk bc = new ByteChunk();
Modified:
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java?rev=1377826&r1=1377825&r2=1377826&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
(original)
+++
tomcat/trunk/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
Mon Aug 27 20:23:42 2012
@@ -155,10 +155,8 @@ public class TestNonLoginAndBasicAuthent
private void doTestNonLogin(String uri, boolean expectedReject,
int expectedRC) throws Exception {
- Map<String,List<String>> reqHeaders =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders = new HashMap<>();
+ Map<String,List<String>> respHeaders = new HashMap<>();
ByteChunk bc = new ByteChunk();
int rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders,
@@ -180,10 +178,8 @@ public class TestNonLoginAndBasicAuthent
boolean expectedReject2, int expectedRC2) throws Exception {
// the first access attempt should be challenged
- Map<String,List<String>> reqHeaders1 =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders1 =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders1 = new HashMap<>();
+ Map<String,List<String>> respHeaders1 = new HashMap<>();
ByteChunk bc = new ByteChunk();
int rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders1,
@@ -206,13 +202,12 @@ public class TestNonLoginAndBasicAuthent
String authScheme = verifyAuthSchemeCase ? "bAsIc " : "Basic ";
String authLine = authScheme + base64auth;
- List<String> auth = new ArrayList<String>();
+ List<String> auth = new ArrayList<>();
auth.add(authLine);
- Map<String,List<String>> reqHeaders2 = new
HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders2 = new HashMap<>();
reqHeaders2.put(CLIENT_AUTH_HEADER, auth);
- Map<String,List<String>> respHeaders2 =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> respHeaders2 = new HashMap<>();
bc.recycle();
rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders2,
Modified:
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java?rev=1377826&r1=1377825&r2=1377826&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
(original)
+++
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
Mon Aug 27 20:23:42 2012
@@ -189,13 +189,11 @@ public class TestSSOnonLoginAndBasicAuth
boolean expectedReject, int expectedRC)
throws Exception {
- Map<String,List<String>> reqHeaders =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders = new HashMap<>();
if (addCookies) {
addCookies(reqHeaders);
}
- Map<String,List<String>> respHeaders =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> respHeaders = new HashMap<>();
ByteChunk bc = new ByteChunk();
int rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders,
@@ -217,10 +215,8 @@ public class TestSSOnonLoginAndBasicAuth
boolean expectedReject2, int expectedRC2) throws Exception {
// the first access attempt should be challenged
- Map<String,List<String>> reqHeaders1 =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders1 =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders1 = new HashMap<>();
+ Map<String,List<String>> respHeaders1 = new HashMap<>();
ByteChunk bc = new ByteChunk();
int rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders1,
@@ -242,13 +238,12 @@ public class TestSSOnonLoginAndBasicAuth
String base64auth = Base64.encode(credentialsBytes);
String authLine = "Basic " + base64auth;
- List<String> auth = new ArrayList<String>();
+ List<String> auth = new ArrayList<>();
auth.add(authLine);
- Map<String,List<String>> reqHeaders2 = new
HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders2 = new HashMap<>();
reqHeaders2.put(CLIENT_AUTH_HEADER, auth);
- Map<String,List<String>> respHeaders2 =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> respHeaders2 = new HashMap<>();
bc.recycle();
rc = getUrl(HTTP_PREFIX + getPort() + uri, bc, reqHeaders2,
Modified:
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java?rev=1377826&r1=1377825&r2=1377826&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
(original)
+++
tomcat/trunk/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
Mon Aug 27 20:23:42 2012
@@ -206,10 +206,8 @@ public class TestSSOnonLoginAndDigestAut
boolean expectedReject, int expectedRC)
throws Exception {
- Map<String,List<String>> reqHeaders =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders = new HashMap<>();
+ Map<String,List<String>> respHeaders = new HashMap<>();
ByteChunk bc = new ByteChunk();
if (addCookies) {
@@ -238,11 +236,9 @@ public class TestSSOnonLoginAndDigestAut
String digestUri= uri;
- List<String> auth = new ArrayList<String>();
- Map<String,List<String>> reqHeaders1 =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders1 =
- new HashMap<String,List<String>>();
+ List<String> auth = new ArrayList<>();
+ Map<String,List<String>> reqHeaders1 = new HashMap<>();
+ Map<String,List<String>> respHeaders1 = new HashMap<>();
// the first access attempt should be challenged
auth.add(buildDigestResponse(user, pwd, digestUri, REALM, "null",
@@ -265,10 +261,8 @@ public class TestSSOnonLoginAndDigestAut
}
// Second request should succeed (if we use the server nonce)
- Map<String,List<String>> reqHeaders2 =
- new HashMap<String,List<String>>();
- Map<String,List<String>> respHeaders2 =
- new HashMap<String,List<String>>();
+ Map<String,List<String>> reqHeaders2 = new HashMap<>();
+ Map<String,List<String>> respHeaders2 = new HashMap<>();
auth.clear();
if (useServerNonce) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]