Merge pull request #2962 from stianst/master
Add retry to testPostEncryptedLoginLogout
This commit is contained in:
commit
ce17999d26
2 changed files with 13 additions and 3 deletions
|
@ -22,7 +22,7 @@ package org.keycloak.testsuite;
|
||||||
*/
|
*/
|
||||||
public class Retry {
|
public class Retry {
|
||||||
|
|
||||||
public static void execute(Runnable runnable, int retry, long interval) throws InterruptedException {
|
public static void execute(Runnable runnable, int retry, long interval) {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
|
@ -30,7 +30,11 @@ public class Retry {
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
retry--;
|
retry--;
|
||||||
if (retry > 0) {
|
if (retry > 0) {
|
||||||
Thread.sleep(interval);
|
try {
|
||||||
|
Thread.sleep(interval);
|
||||||
|
} catch (InterruptedException ie) {
|
||||||
|
throw new RuntimeException(ie);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ import org.keycloak.saml.common.constants.JBossSAMLURIConstants;
|
||||||
import org.keycloak.saml.processing.core.saml.v2.constants.X500SAMLProfileConstants;
|
import org.keycloak.saml.processing.core.saml.v2.constants.X500SAMLProfileConstants;
|
||||||
import org.keycloak.services.managers.RealmManager;
|
import org.keycloak.services.managers.RealmManager;
|
||||||
import org.keycloak.testsuite.KeycloakServer;
|
import org.keycloak.testsuite.KeycloakServer;
|
||||||
|
import org.keycloak.testsuite.Retry;
|
||||||
import org.keycloak.testsuite.pages.LoginPage;
|
import org.keycloak.testsuite.pages.LoginPage;
|
||||||
import org.keycloak.testsuite.rule.AbstractKeycloakRule;
|
import org.keycloak.testsuite.rule.AbstractKeycloakRule;
|
||||||
import org.keycloak.testsuite.rule.ErrorServlet;
|
import org.keycloak.testsuite.rule.ErrorServlet;
|
||||||
|
@ -503,7 +504,12 @@ public class SamlAdapterTestStrategy extends ExternalResource {
|
||||||
driver.navigate().to(APP_SERVER_BASE_URL + "/sales-post-enc/");
|
driver.navigate().to(APP_SERVER_BASE_URL + "/sales-post-enc/");
|
||||||
assertAtLoginPagePostBinding();
|
assertAtLoginPagePostBinding();
|
||||||
loginPage.login("bburke", "password");
|
loginPage.login("bburke", "password");
|
||||||
assertEquals(driver.getCurrentUrl(), APP_SERVER_BASE_URL + "/sales-post-enc/");
|
Retry.execute(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
assertEquals(driver.getCurrentUrl(), APP_SERVER_BASE_URL + "/sales-post-enc/");
|
||||||
|
}
|
||||||
|
}, 10, 100);
|
||||||
Assert.assertTrue(driver.getPageSource().contains("bburke"));
|
Assert.assertTrue(driver.getPageSource().contains("bburke"));
|
||||||
driver.navigate().to(APP_SERVER_BASE_URL + "/sales-post-enc?GLO=true");
|
driver.navigate().to(APP_SERVER_BASE_URL + "/sales-post-enc?GLO=true");
|
||||||
checkLoggedOut(APP_SERVER_BASE_URL + "/sales-post-enc/", true);
|
checkLoggedOut(APP_SERVER_BASE_URL + "/sales-post-enc/", true);
|
||||||
|
|
Loading…
Reference in a new issue