Repository: wicket Updated Branches: refs/heads/master b793f99f6 -> 304e0f427
WICKET-5648 CookieUtils - add #loadValues(), make #getCookie() public, properly initialize from the defaults Remove the newly introduced CookieUtils#loadValues() method. At http://markmail.org/message/6t5gaeb3c2h24r36 we decided to deprecate all multivalue related methods in 6.x and remove them in 7.x (cherry picked from commit 89ce5c41be76ea7a7c9c4679e419c15d83aaed07) Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/388b150e Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/388b150e Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/388b150e Branch: refs/heads/master Commit: 388b150ea0764ee5ac32c99c3582322f5561e07e Parents: b793f99 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Mon Aug 4 12:09:52 2014 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Mon Aug 4 12:21:09 2014 +0200 ---------------------------------------------------------------------- .../apache/wicket/util/cookies/CookieUtils.java | 19 ------------------- .../wicket/util/cookies/CookieUtilsTest.java | 18 ------------------ 2 files changed, 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/388b150e/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java index af2d26e..0f1f315 100644 --- a/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java +++ b/wicket-core/src/main/java/org/apache/wicket/util/cookies/CookieUtils.java @@ -123,25 +123,6 @@ public class CookieUtils } /** - * Retrieve an array of the cookie value split by {@link org.apache.wicket.markup.html.form.FormComponent#VALUE_SEPARATOR}. - * - * @param key - * The cookie name - * @return The cookie value split by {@link org.apache.wicket.markup.html.form.FormComponent#VALUE_SEPARATOR}. - */ - public final String[] loadValues(final String key) - { - final Cookie cookie = getCookie(key); - if (cookie != null) - { - String value = cookie.getValue(); - String[] values = splitValue(value); - return values; - } - return null; - } - - /** * Retrieve the cookie value associated with the formComponent and load the model object with * the cookie value. * http://git-wip-us.apache.org/repos/asf/wicket/blob/388b150e/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java b/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java index 2068cf4..9e6cf40 100644 --- a/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java +++ b/wicket-core/src/test/java/org/apache/wicket/util/cookies/CookieUtilsTest.java @@ -17,10 +17,8 @@ package org.apache.wicket.util.cookies; import static org.hamcrest.Matchers.arrayContaining; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.emptyArray; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.equalToIgnoringCase; import static org.hamcrest.Matchers.is; import java.util.Arrays; @@ -35,8 +33,6 @@ import org.apache.wicket.WicketTestCase; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.util.cookies.CookieValuePersisterTestPage.TestForm; -import org.apache.wicket.util.string.Strings; -import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; @@ -192,20 +188,6 @@ public class CookieUtilsTest extends WicketTestCase } @Test - public void saveLoadValues() - { - CookieUtils utils = new CookieUtils(); - String value1 = "value one"; - String value2 = "value two"; - String value3 = "value three"; - String key = "key"; - utils.save(key, value1, value2, value3); - before(); // execute a request cycle, so the response cookie is send with the next request - String[] result = utils.loadValues(key); - assertThat(result, is(Matchers.arrayContaining(value1, value2, value3))); - } - - @Test public void defaults() { CookieDefaults defaults = new CookieDefaults();
