[java-idp-integration-tests COMMIT] /trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java
noreply at shibboleth.net
noreply at shibboleth.net
Mon Jun 8 16:14:03 EDT 2015
Author: tzeller
Date: Mon Jun 8 16:14:03 2015
New Revision: 64
URL: http://svn.shibboleth.net/view/java-idp-integration-tests?rev=64&view=rev
Log:
IDP-594 Add version to read and write flow.
Modified:
trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java
Modified: trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java
URL: http://svn.shibboleth.net/view/java-idp-integration-tests/trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java?rev=64&r1=63&r2=64&view=diff
==============================================================================
--- trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java (original)
+++ trunk/src/test/java/net/shibboleth/idp/test/localstorage/LocalStorageTest.java Mon Jun 8 16:14:03 2015
@@ -1,5 +1,5 @@
/*
- * Licensed to the University Corporation for Advanced Internet Development,
+, "1" * Licensed to the University Corporation for Advanced Internet Development,
* Inc. (UCAID) under one or more contributor license agreements. See the
* NOTICE file distributed with this work for additional information regarding
* copyright ownership. The UCAID licenses this file to You under the Apache
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.net.MalformedURLException;
+import java.util.Arrays;
import java.util.List;
import javax.annotation.Nonnull;
@@ -26,12 +27,11 @@
import net.shibboleth.idp.test.BaseIntegrationTest;
import net.shibboleth.utilities.java.support.collection.Pair;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.net.URLBuilder;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.slf4j.Logger;
@@ -185,18 +185,27 @@
/**
* Build the URL to read from local storage using the test flow.
*
- * The read test flow expects a {@link #LOCAL_STORAGE_KEY_ID} query parameter.
+ * The read flow requires the following query parameters :
+ * <ul>
+ * <li>{@link #LOCAL_STORAGE_KEY_ID}</li>
+ * <li>{@link #LOCAL_STORAGE_VERSION_ID}</li>
+ * </ul>
*
* @param localStorageKey the key of the item to read from local storage.
+ * @param localStorageVersion the version of the item to read from local storage.
* @return the URL to read from local storage using the test flow
* @throws MalformedURLException
*/
- protected String buildReadURL(@Nullable final String localStorageKey) throws MalformedURLException {
+ protected String buildReadURL(@Nullable final String localStorageKey, @Nullable final String localStorageVersion)
+ throws MalformedURLException {
final URLBuilder urlBuilder = new URLBuilder(readURL);
final List<Pair<String, String>> queryParams = urlBuilder.getQueryParams();
if (localStorageKey != null) {
queryParams.add(new Pair<String, String>(LOCAL_STORAGE_KEY_ID, localStorageKey));
}
+ if (localStorageVersion != null) {
+ queryParams.add(new Pair<String, String>(LOCAL_STORAGE_VERSION_ID, localStorageVersion));
+ }
final String URL = urlBuilder.buildURL();
log.debug("URL to read from local storage is '{}'", URL);
return URL;
@@ -204,14 +213,21 @@
/**
* Build the URL to write to local storage using the test flow.
+ *
+ * The write flow requires the following query parameters :
+ * <ul>
+ * <li>{@link #LOCAL_STORAGE_KEY_ID}</li>
+ * <li>{@link #LOCAL_STORAGE_VALUE_ID}</li>
+ * <li>{@link #LOCAL_STORAGE_VERSION_ID}</li>
+ * </ul>
*
* @param localStorageKey the key of the item to be written to local storage.
* @param localStorageValue the value of the item to be written to local storage.
* @return the URL to write to local storage using the test flow
* @throws MalformedURLException
*/
- protected String buildWriteURL(@Nullable final String localStorageKey, @Nullable final String localStorageValue)
- throws MalformedURLException {
+ protected String buildWriteURL(@Nullable final String localStorageKey, @Nullable final String localStorageValue,
+ @Nullable final String localStorageVersion) throws MalformedURLException {
final URLBuilder urlBuilder = new URLBuilder(writeURL);
final List<Pair<String, String>> queryParams = urlBuilder.getQueryParams();
if (localStorageKey != null) {
@@ -220,38 +236,31 @@
if (localStorageValue != null) {
queryParams.add(new Pair<String, String>(LOCAL_STORAGE_VALUE_ID, localStorageValue));
}
+ if (localStorageVersion != null) {
+ queryParams.add(new Pair<String, String>(LOCAL_STORAGE_VERSION_ID, localStorageVersion));
[... 226 lines stripped ...]
More information about the commits
mailing list