[java-idp-integration-tests COMMIT] in /trunk/src/test/java/net/shibboleth/idp/test: BaseIntegrationTest.java saml2/A...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jan 19 20:52:22 EST 2015


Author: tzeller
Date: Mon Jan 19 20:52:22 2015
New Revision: 49

URL: http://svn.shibboleth.net/view/java-idp-integration-tests?rev=49&view=rev
Log:
Checkpoint work on SLO integration tests.

Modified:
    trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
    trunk/src/test/java/net/shibboleth/idp/test/saml2/AbstractSAML2IntegrationTest.java
    trunk/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSOPOSTIntegrationTest.java
    trunk/src/test/java/net/shibboleth/idp/test/saml2/SAML2SSORedirectIntegrationTest.java

Modified: trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java
URL: http://svn.shibboleth.net/view/java-idp-integration-tests/trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java?rev=49&r1=48&r2=49&view=diff
==============================================================================
--- trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java (original)
+++ trunk/src/test/java/net/shibboleth/idp/test/BaseIntegrationTest.java Mon Jan 19 20:52:22 2015
@@ -36,6 +36,8 @@
 import net.shibboleth.utilities.java.support.xml.ParserPool;
 
 import org.openqa.selenium.By;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.Point;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.firefox.FirefoxDriver;
@@ -154,6 +156,12 @@
 
     /** URL to start the force authn flow. */
     @Nullable protected String forceAuthnRequestURL;
+    
+    /** IdP single logout service endpoint. */
+    @Nullable protected String idpLogoutURL;
+    
+    /** SP single logout service endpoint. */
+    @Nullable protected String spLogoutURL;
 
     /** Class logger. */
     @Nonnull private final Logger log = LoggerFactory.getLogger(BaseIntegrationTest.class);
@@ -400,6 +408,17 @@
 
         Files.copy(pathToRelyingPartyWithConsent, pathToRelyingParty, StandardCopyOption.REPLACE_EXISTING);
     }
+    
+    public void enableLogout() throws Exception {
+        // server-side storage of user sessions
+        replaceIdPProperty("idp.session.StorageService", "shibboleth.StorageService");
+
+        // track information about SPs logged into
+        replaceIdPProperty(" idp.session.trackSPSessions", "true");
+
+        // support lookup by SP for SAML logout
+        replaceIdPProperty("idp.session.secondaryServiceIndex", "true");
+    }
 
     /**
      * Setup HTML web driver.
@@ -416,6 +435,9 @@
         final ProfilesIni allProfiles = new ProfilesIni();
         final FirefoxProfile profile = allProfiles.getProfile("FirefoxShibtest");
         driver = new FirefoxDriver(profile);
+        
+        driver.manage().window().setPosition(new Point(0, 0));
+        driver.manage().window().setSize(new Dimension(1024, 768));
     }
 
     /**
@@ -510,6 +532,29 @@
             }
         });
     }
+    
+    /**
+     * Get and wait for testbed page at {@link #BASE_URL}.
+     */
+    public void getAndWaitForTestbedPage() {
+        driver.get(BASE_URL);
+        (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
+            public Boolean apply(WebDriver d) {
+                return d.getCurrentUrl().equals(BASE_URL + "/");
+            }
+        });
+    }
+    
+    /**
+     * Wait for IdP logout page at {@link #idpLogoutURL}.
+     */
+    public void waitForLogoutPage() {
+        (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
+            public Boolean apply(WebDriver d) {
+                return d.getCurrentUrl().startsWith(idpLogoutURL);
+            }
+        });
+    }
 
     /**
      * Select web element with id {@link #REMEMBER_CONSENT_ID}.

Modified: trunk/src/test/java/net/shibboleth/idp/test/saml2/AbstractSAML2IntegrationTest.java
URL: http://svn.shibboleth.net/view/java-idp-integration-tests/trunk/src/test/java/net/shibboleth/idp/test/saml2/AbstractSAML2IntegrationTest.java?rev=49&r1=48&r2=49&view=diff
==============================================================================
--- trunk/src/test/java/net/shibboleth/idp/test/saml2/AbstractSAML2IntegrationTest.java (original)
+++ trunk/src/test/java/net/shibboleth/idp/test/saml2/AbstractSAML2IntegrationTest.java Mon Jan 19 20:52:22 2015
@@ -28,13 +28,18 @@
 
 import net.shibboleth.idp.test.BaseIntegrationTest;
 import net.shibboleth.idp.test.flows.saml2.SAML2TestResponseValidator;
+import net.shibboleth.idp.test.flows.saml2.SAML2TestStatusResponseTypeValidator;
 import net.shibboleth.utilities.java.support.xml.XMLParserException;
 
 import org.cryptacular.util.CertUtil;
 import org.cryptacular.util.KeyPairUtil;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.opensaml.core.xml.XMLObject;
 import org.opensaml.core.xml.io.Unmarshaller;
 import org.opensaml.core.xml.io.UnmarshallingException;
 import org.opensaml.saml.saml2.core.AuthnContext;
+import org.opensaml.saml.saml2.core.LogoutResponse;
 import org.opensaml.saml.saml2.core.Response;
 import org.opensaml.saml.saml2.core.StatusCode;
 import org.opensaml.security.credential.Credential;
@@ -64,6 +69,12 @@

[... 256 lines stripped ...]


More information about the commits mailing list