cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [15/18] cxf-fediz git commit: Whitespace cleanup
Date Mon, 13 Feb 2017 11:36:31 GMT
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/AudienceRestrictionTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/AudienceRestrictionTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/AudienceRestrictionTest.java
index bf55170..0e80926 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/AudienceRestrictionTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/AudienceRestrictionTest.java
@@ -60,7 +60,7 @@ import org.junit.BeforeClass;
  * Some tests for audience restriction
  */
 public class AudienceRestrictionTest {
-    public static final String SAMPLE_MULTIPLE_RSTR_COLL_MSG = 
+    public static final String SAMPLE_MULTIPLE_RSTR_COLL_MSG =
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
         + "<RequestSecurityTokenResponseCollection "
         +   "xmlns=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\"> "
@@ -73,20 +73,20 @@ public class AudienceRestrictionTest {
         +     "</RequestedSecurityToken>"
         +   "</RequestSecurityTokenResponse>"
         + "</RequestSecurityTokenResponseCollection>";
-    
+
     static final String TEST_USER = "alice";
     static final String TEST_RSTR_ISSUER = "FedizSTSIssuer";
     static final String TEST_AUDIENCE = "https://localhost/fedizhelloworld";
     static final String TEST_REQUEST_URL = "https://localhost/fedizhelloworld/";
     static final String TEST_REQUEST_URI = "/fedizhelloworld";
-    
+
     private static final String CONFIG_FILE = "fediz_test_config_aud.xml";
-    
+
     private static Crypto crypto;
     private static CallbackHandler cbPasswordHandler;
     private static FedizConfigurator configurator;
-    
-    
+
+
     @BeforeClass
     public static void init() {
         try {
@@ -99,12 +99,12 @@ public class AudienceRestrictionTest {
         Assert.assertNotNull(configurator);
 
     }
-    
+
     @AfterClass
     public static void cleanup() {
         SecurityTestUtil.cleanup();
     }
-    
+
 
     private static FedizConfigurator getFederationConfigurator() {
         if (configurator != null) {
@@ -135,15 +135,15 @@ public class AudienceRestrictionTest {
         audienceRestriction.getAudienceURIs().add(TEST_AUDIENCE);
         cp.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("AUD1");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -158,15 +158,15 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNotNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     @org.junit.Test
     public void validateAudienceThatIsRequiredAgainstMultipleAudiences() throws Exception
{
         SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -179,15 +179,15 @@ public class AudienceRestrictionTest {
         audienceRestriction.getAudienceURIs().add(TEST_AUDIENCE);
         cp.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("AUD2");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -202,15 +202,15 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNotNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     @org.junit.Test
     public void validateBadAudienceThatIsRequired() throws Exception {
         SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -223,15 +223,15 @@ public class AudienceRestrictionTest {
         audienceRestriction.getAudienceURIs().add("https://localhost/badfedizhelloworld");
         cp.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("AUD1");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -246,15 +246,15 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     @org.junit.Test
     public void validateNoAudienceThatIsRequired() throws Exception {
         SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -264,15 +264,15 @@ public class AudienceRestrictionTest {
         callbackHandler.setSubjectName(TEST_USER);
         ConditionsBean cp = new ConditionsBean();
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("AUD1");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -287,15 +287,15 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     @org.junit.Test
     public void validateNoAudienceThatIsNotRequired() throws Exception {
         SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -305,15 +305,15 @@ public class AudienceRestrictionTest {
         callbackHandler.setSubjectName(TEST_USER);
         ConditionsBean cp = new ConditionsBean();
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("NOAUD");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -328,15 +328,15 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNotNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     @org.junit.Test
     public void validateAudienceThatIsNotRequired() throws Exception {
         SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
@@ -349,15 +349,15 @@ public class AudienceRestrictionTest {
         audienceRestriction.getAudienceURIs().add(TEST_AUDIENCE);
         cp.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
         callbackHandler.setConditions(cp);
-        
+
         SAMLCallback samlCallback = new SAMLCallback();
         SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
         SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
         String rstr = createSamlToken(assertion, "mystskey", true);
-        
+
         configurator = null;
         FedizContext config = getFederationConfigurator().getFedizContext("NOAUD");
-        
+
         // Mock up the servet request/response
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
@@ -372,20 +372,20 @@ public class AudienceRestrictionTest {
         EasyMock.expect(req.getAttribute("javax.servlet.request.X509Certificate")).andReturn(null);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         EasyMock.replay(resp);
-        
+
         // Now validate the request
         TestSigninHandler signinHandler = new TestSigninHandler(config);
         Assert.assertNull(signinHandler.handleRequest(req, resp));
     }
-    
+
     private String createSamlToken(SamlAssertionWrapper assertion, String alias, boolean
sign)
         throws IOException, UnsupportedCallbackException, WSSecurityException, Exception
{
         return createSamlToken(assertion, alias, sign, STSUtil.SAMPLE_RSTR_COLL_MSG);
     }
-    
+
     private String createSamlToken(SamlAssertionWrapper assertion, String alias, boolean
sign, String rstr)
         throws IOException, UnsupportedCallbackException, WSSecurityException, Exception
{
         WSPasswordCallback[] cb = {
@@ -409,5 +409,5 @@ public class AudienceRestrictionTest {
         e.appendChild(token);
         return DOM2Writer.nodeToString(doc);
     }
-    
+
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/CustomValidator.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/CustomValidator.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/CustomValidator.java
index 30faea8..835f94e 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/CustomValidator.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/CustomValidator.java
@@ -40,7 +40,7 @@ public class CustomValidator implements TokenValidator {
 
     @Override
     public TokenValidatorResponse validateAndProcessToken(
-        TokenValidatorRequest request, 
+        TokenValidatorRequest request,
         FedizContext config
     ) {
         return new TokenValidatorResponse(null,

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationLogoutTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationLogoutTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationLogoutTest.java
index 09842dd..886d991 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationLogoutTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationLogoutTest.java
@@ -47,29 +47,29 @@ public class FederationLogoutTest {
     private static final String LOGOUT_URI = "/secure/logout";
     private static final String REPLY_URL = "https://localhost/fedizhelloworld/secure/wreply.html";
     private static final String BAD_REPLY_URL = "https://localhost/fedizhelloworld/secure/badreply.html";
-    
+
     private static final String CONFIG_FILE = "fediz_test_config_logout.xml";
-    
+
     private static FedizConfigurator configurator;
     private static DocumentBuilderFactory docBuilderFactory;
-    
+
     static {
         docBuilderFactory = DocumentBuilderFactory.newInstance();
         docBuilderFactory.setNamespaceAware(true);
     }
-    
-    
+
+
     @BeforeClass
     public static void init() {
         getFederationConfigurator();
         Assert.assertNotNull(configurator);
     }
-    
+
     @AfterClass
     public static void cleanup() {
         SecurityTestUtil.cleanup();
     }
-    
+
 
     private static FedizConfigurator getFederationConfigurator() {
         if (configurator != null) {
@@ -87,11 +87,11 @@ public class FederationLogoutTest {
             return null;
         }
     }
-    
+
     @org.junit.Test
     public void testSignoutCustomURL() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(null);
@@ -99,23 +99,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Flogout%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCustomURLWithWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(REPLY_URL).anyTimes();
@@ -123,23 +123,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=" + URLEncoder.encode(REPLY_URL,
"UTF-8");
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCustomURLWithBadWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(BAD_REPLY_URL).anyTimes();
@@ -147,23 +147,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Flogout%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCustomURLWithNoConfiguredConstraint() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT2");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(REPLY_URL).anyTimes();
@@ -171,23 +171,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Flogout%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutWithAbsoluteURL() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT4");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(null);
@@ -195,23 +195,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Flogout%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutAction() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT).anyTimes();
@@ -220,23 +220,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn("/secure");
         EasyMock.expect(req.getContextPath()).andReturn("/secure");
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutActionWithWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT).anyTimes();
@@ -245,23 +245,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn("/secure");
         EasyMock.expect(req.getContextPath()).andReturn("/secure");
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=" + URLEncoder.encode(REPLY_URL,
"UTF-8");
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutActionWithBadWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT).anyTimes();
@@ -270,23 +270,23 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn("/secure");
         EasyMock.expect(req.getContextPath()).andReturn("/secure");
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutActionWithNoConfiguredConstraint() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT2");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
         .andReturn(FederationConstants.ACTION_SIGNOUT).anyTimes();
@@ -295,34 +295,34 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn("/secure");
         EasyMock.expect(req.getContextPath()).andReturn("/secure");
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Findex.html";
         resp.sendRedirect(expectedRedirectToIdP);
         EasyMock.expectLastCall();
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCleanupWithWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
-        HttpSession session =  EasyMock.createMock(HttpSession.class);
+        HttpSession session = EasyMock.createMock(HttpSession.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT_CLEANUP).anyTimes();
         EasyMock.expect(req.getSession()).andReturn(session);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(REPLY_URL).anyTimes();
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         String expectedRedirect = URLEncoder.encode(REPLY_URL, "UTF-8");
         resp.sendRedirect(expectedRedirect);
@@ -330,22 +330,22 @@ public class FederationLogoutTest {
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCleanupWithBadWReply() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
-        HttpSession session =  EasyMock.createMock(HttpSession.class);
+        HttpSession session = EasyMock.createMock(HttpSession.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT_CLEANUP).anyTimes();
         EasyMock.expect(req.getSession()).andReturn(session);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(BAD_REPLY_URL).anyTimes();
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         resp.setContentType("image/jpeg");
         ServletOutputStream outputStream = EasyMock.createMock(ServletOutputStream.class);
@@ -354,22 +354,22 @@ public class FederationLogoutTest {
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCleanupWithNoConfiguredConstraint() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT2");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
-        HttpSession session =  EasyMock.createMock(HttpSession.class);
+        HttpSession session = EasyMock.createMock(HttpSession.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION))
             .andReturn(FederationConstants.ACTION_SIGNOUT_CLEANUP).anyTimes();
         EasyMock.expect(req.getSession()).andReturn(session);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(REPLY_URL).anyTimes();
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
         resp.setContentType("image/jpeg");
         ServletOutputStream outputStream = EasyMock.createMock(ServletOutputStream.class);
@@ -378,11 +378,11 @@ public class FederationLogoutTest {
         EasyMock.replay(resp);
         logoutHandler.handleRequest(req, resp);
     }
-    
+
     @org.junit.Test
     public void testSignoutCustomQueryParameter() throws Exception {
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT3");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_ACTION)).andReturn(null).anyTimes();
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(null);
@@ -390,12 +390,12 @@ public class FederationLogoutTest {
         EasyMock.expect(req.getRequestURI()).andReturn(LOGOUT_URI);
         EasyMock.expect(req.getContextPath()).andReturn(LOGOUT_URI);
         EasyMock.replay(req);
-        
+
         LogoutHandler logoutHandler = new LogoutHandler(config);
         Assert.assertTrue(logoutHandler.canHandleRequest(req));
-        
+
         HttpServletResponse resp = EasyMock.createMock(HttpServletResponse.class);
-        String expectedRedirectToIdP = 
+        String expectedRedirectToIdP =
             "http://url_to_the_issuer?wa=wsignout1.0&wreply=https%3A%2F%2Flocalhost%2Fsecure%2Flogout%2Findex.html"
             + "&custom=param";
         resp.sendRedirect(expectedRedirectToIdP);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationMetaDataTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationMetaDataTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationMetaDataTest.java
index 8ed7c05..bfcdc9a 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationMetaDataTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationMetaDataTest.java
@@ -48,15 +48,15 @@ import static org.junit.Assert.fail;
 
 public class FederationMetaDataTest {
     private static final String CONFIG_FILE = "fediz_meta_test_config.xml";
-    private static final String TEST_REQUEST_URL = 
+    private static final String TEST_REQUEST_URL =
         "https://localhost/fedizhelloworld/FederationMetadata/2007-06/FederationMetadata.xml";
     private static final String CONTEXT_PATH = "/fedizhelloworld";
-    
+
     @AfterClass
     public static void cleanup() {
         SecurityTestUtil.cleanup();
     }
-    
+
 
     private FedizContext loadConfig(String context) {
         try {
@@ -71,7 +71,7 @@ public class FederationMetaDataTest {
             return null;
         }
     }
-    
+
 
     @org.junit.Test
     public void validateMetaDataWithAlias() throws ProcessingException, XMLSignatureException,
XMLSecurityException {
@@ -81,18 +81,18 @@ public class FederationMetaDataTest {
         FedizProcessor wfProc = new FederationProcessorImpl();
         Document doc = wfProc.getMetaData(null, config);
         Assert.assertNotNull(doc);
-        
+
         Node signatureNode = doc.getElementsByTagName("Signature").item(0);
         Assert.assertNotNull(signatureNode);
-        
+
         doc.getDocumentElement().setIdAttributeNS(null, "ID", true);
 
         try {
             DOMUtils.writeXml(doc, System.out);
         } catch (TransformerException e) {
-            fail("Exception not expected: " + e.getMessage()); 
+            fail("Exception not expected: " + e.getMessage());
         }
-        
+
         // Validate the signature
         XMLSignature signature = new XMLSignature((Element)signatureNode, "");
         KeyInfo ki = signature.getKeyInfo();
@@ -112,7 +112,7 @@ public class FederationMetaDataTest {
             EasyMock.expect(req.getRequestURL()).andReturn(new StringBuffer(TEST_REQUEST_URL));
             EasyMock.expect(req.getContextPath()).andReturn(CONTEXT_PATH);
             EasyMock.replay(req);
-            
+
             FedizProcessor wfProc = new FederationProcessorImpl();
             Document doc = wfProc.getMetaData(req, config);
             Assert.assertNull(doc);
@@ -121,7 +121,7 @@ public class FederationMetaDataTest {
             //Expected as signing store contains more than one certificate
         }
     }
-    
+
     @org.junit.Test
     public void validateMetaDataNoSigningKey() throws ProcessingException {
 
@@ -131,15 +131,15 @@ public class FederationMetaDataTest {
         EasyMock.expect(req.getRequestURL()).andReturn(new StringBuffer(TEST_REQUEST_URL)).times(2);
         EasyMock.expect(req.getContextPath()).andReturn(CONTEXT_PATH).times(2);
         EasyMock.replay(req);
-        
+
         FedizProcessor wfProc = new FederationProcessorImpl();
         Document doc = wfProc.getMetaData(req, config);
         Assert.assertNotNull(doc);
-        
+
         try {
             DOMUtils.writeXml(doc, System.out);
         } catch (TransformerException e) {
-            fail("Exception not expected: " + e.getMessage()); 
+            fail("Exception not expected: " + e.getMessage());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationRequestTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationRequestTest.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationRequestTest.java
index c5489d0..3f22e24 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationRequestTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationRequestTest.java
@@ -47,29 +47,29 @@ public class FederationRequestTest {
     static final String TEST_REQUEST_URL = "https://localhost/fedizhelloworld/";
     static final String TEST_REQUEST_URI = "/fedizhelloworld";
     static final String TEST_IDP_ISSUER = "http://url_to_the_issuer";
-    
+
     private static final String CONFIG_FILE = "fediz_test_config.xml";
-    
+
     private static FedizConfigurator configurator;
     private static DocumentBuilderFactory docBuilderFactory;
-    
+
     static {
         docBuilderFactory = DocumentBuilderFactory.newInstance();
         docBuilderFactory.setNamespaceAware(true);
     }
-    
-    
+
+
     @BeforeClass
     public static void init() {
         getFederationConfigurator();
         Assert.assertNotNull(configurator);
     }
-    
+
     @AfterClass
     public static void cleanup() {
         SecurityTestUtil.cleanup();
     }
-    
+
 
     private static FedizConfigurator getFederationConfigurator() {
         if (configurator != null) {
@@ -87,22 +87,22 @@ public class FederationRequestTest {
             return null;
         }
     }
-    
+
     @org.junit.Test
     public void createFederationSignInRequest() throws Exception {
         // Mock up a Request
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_HOME_REALM)).andReturn(null);
         EasyMock.expect(req.getRequestURL()).andReturn(new StringBuffer(TEST_REQUEST_URL)).times(1,
2);
         EasyMock.expect(req.getContextPath()).andReturn(TEST_REQUEST_URI);
         EasyMock.expect(req.getQueryString()).andReturn(null);
         EasyMock.replay(req);
-        
+
         FedizProcessor wfProc = new FederationProcessorImpl();
         RedirectionResponse response = wfProc.createSignInRequest(req, config);
-        
+
         String redirectionURL = response.getRedirectionURL();
         Assert.assertTrue(redirectionURL.startsWith(TEST_IDP_ISSUER));
         Assert.assertTrue(redirectionURL.contains("wa=wsignin1.0"));
@@ -112,7 +112,7 @@ public class FederationRequestTest {
         Assert.assertTrue(redirectionURL.contains("wtrealm=target+realm"));
         Assert.assertTrue(redirectionURL.contains("wreply="));
     }
-    
+
     @org.junit.Test
     public void createFederationSignInRequestWithUrlDefinedHomeRealm() throws Exception {
         // Mock up a Request
@@ -140,24 +140,24 @@ public class FederationRequestTest {
         Assert.assertTrue(redirectionURL.contains("whr="
                                                 + URLEncoder.encode("urn:org:apache:cxf:fediz:idp:realm-A",
"UTF-8")));
     }
-    
+
     @org.junit.Test
     public void createFederationSignOutRequest() throws Exception {
         // Mock up a Request
         FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
-        
+
         HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
         EasyMock.expect(req.getParameter(FederationConstants.PARAM_REPLY)).andReturn(null);
         EasyMock.expect(req.getRequestURL()).andReturn(new StringBuffer(TEST_REQUEST_URL)).times(1,
2);
         EasyMock.expect(req.getContextPath()).andReturn(TEST_REQUEST_URI);
         EasyMock.replay(req);
-        
+
         FedizProcessor wfProc = new FederationProcessorImpl();
         RedirectionResponse response = wfProc.createSignOutRequest(req, null, config);
-        
+
         String redirectionURL = response.getRedirectionURL();
         Assert.assertTrue(redirectionURL.startsWith(TEST_IDP_ISSUER));
         Assert.assertTrue(redirectionURL.contains("wa=wsignout1.0"));
     }
-    
+
 }
\ No newline at end of file


Mime
View raw message