This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-web. See https://gitlab.nuiton.org/nuiton/nuiton-web.git commit 7d47b763e04e8a2b7061947d90bf451887ab9ace Author: Eric Chatellier <chatellier@codelutin.com> Date: Wed Aug 30 17:21:02 2017 +0200 fixes #122: Fix tests --- .../web/struts2/I18nTextProviderFactory.java | 22 ++++++++++++++++++++++ .../nuiton/web/struts2/I18nTextProviderTest.java | 17 ++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/nuiton-struts2/src/main/java/org/nuiton/web/struts2/I18nTextProviderFactory.java b/nuiton-struts2/src/main/java/org/nuiton/web/struts2/I18nTextProviderFactory.java index 3ab3a3e..84587c5 100644 --- a/nuiton-struts2/src/main/java/org/nuiton/web/struts2/I18nTextProviderFactory.java +++ b/nuiton-struts2/src/main/java/org/nuiton/web/struts2/I18nTextProviderFactory.java @@ -1,5 +1,27 @@ package org.nuiton.web.struts2; +/*- + * #%L + * Nuiton Web :: Nuiton Struts 2 + * %% + * Copyright (C) 2010 - 2017 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + import com.opensymphony.xwork2.StrutsTextProviderFactory; import com.opensymphony.xwork2.TextProvider; diff --git a/nuiton-struts2/src/test/java/org/nuiton/web/struts2/I18nTextProviderTest.java b/nuiton-struts2/src/test/java/org/nuiton/web/struts2/I18nTextProviderTest.java index e0447cd..d7cc509 100644 --- a/nuiton-struts2/src/test/java/org/nuiton/web/struts2/I18nTextProviderTest.java +++ b/nuiton-struts2/src/test/java/org/nuiton/web/struts2/I18nTextProviderTest.java @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.Locale; import com.opensymphony.xwork2.DefaultLocaleProvider; +import com.opensymphony.xwork2.LocaleProvider; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -47,13 +48,23 @@ public class I18nTextProviderTest { initializer.setMissingKeyReturnNull(true); I18n.init(initializer, Locale.FRENCH); - provider = new I18nTextProvider(); - provider.setLocaleProvider(new DefaultLocaleProvider() { + LocaleProvider localeProvider = new LocaleProvider() { @Override public Locale getLocale() { return Locale.FRENCH; } - }); + + @Override + public boolean isValidLocaleString(String localeStr) { + return false; + } + + @Override + public boolean isValidLocale(Locale locale) { + return false; + } + }; + provider = new I18nTextProvider((Class)null, localeProvider, null); } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.