Author: chatellier Date: 2010-02-23 13:30:34 +0000 (Tue, 23 Feb 2010) New Revision: 3000 Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisConfigTest.java Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java Log: Add some setter (and test) on some options Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2010-02-23 13:06:30 UTC (rev 2999) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2010-02-23 13:30:34 UTC (rev 3000) @@ -297,7 +297,7 @@ } return result; } - + /** * Retourne l'objet {@link Locale} a utilise pour la langue. * @@ -308,8 +308,18 @@ Locale result = (Locale)ConvertUtils.convert(value, Locale.class); return result; } - + /** + * Change application locale. + * (used during application config command line parse) + * + * @param locale new locale + */ + public void setLocale(String locale) { + setOption(Option.LOCALE.key, locale); + } + + /** * Retourne l'encoding a utiliser pour les fichiers textes. * * @return encoding to use @@ -318,7 +328,7 @@ String result = getOption(Option.ENCODING.key); return result; } - + /** * Retourne le serveur SMTP a utiliser pour l'envoie de mail. * @@ -328,7 +338,7 @@ String result = getOption(Option.SMTP_SERVER.key); return result; } - + /** * Retourne le nom usuel de l'utilisateur. * Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisConfigTest.java =================================================================== --- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisConfigTest.java (rev 0) +++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisConfigTest.java 2010-02-23 13:30:34 UTC (rev 3000) @@ -0,0 +1,45 @@ +/* *##% + * Copyright (C) 2010 Ifremer, Code Lutin, Chatellier Eric + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish; + +import org.junit.Test; +import org.nuiton.util.ApplicationConfig; + +/** + * Test for IsisConfig. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class IsisConfigTest { + + /** + * Test presence of some setXXX option called only + * in instrospection by {@link ApplicationConfig}. + */ + @Test + public void testSetterExistence() { + IsisConfig config = new IsisConfig(); + // --locale fr_FR + config.setLocale("fr_GB"); + } +} Property changes on: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/IsisConfigTest.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL"