Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 87112 invoked from network); 25 Apr 2008 11:12:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Apr 2008 11:12:57 -0000 Received: (qmail 17504 invoked by uid 500); 25 Apr 2008 11:12:58 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 17423 invoked by uid 500); 25 Apr 2008 11:12:58 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 17412 invoked by uid 99); 25 Apr 2008 11:12:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2008 04:12:58 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2008 11:12:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B46E01A9832; Fri, 25 Apr 2008 04:12:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r651574 - in /commons/proper/cli/trunk: src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java xdocs/changes.xml Date: Fri, 25 Apr 2008 11:12:34 -0000 To: commits@commons.apache.org From: niallp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080425111235.B46E01A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: niallp Date: Fri Apr 25 04:12:33 2008 New Revision: 651574 URL: http://svn.apache.org/viewvc?rev=651574&view=rev Log: CLI-153 set svn:eol-style to native - thanks to Benjamin Bentmann for the patch Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java (contents, props changed) commons/proper/cli/trunk/xdocs/changes.xml (props changed) Modified: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java?rev=651574&r1=651573&r2=651574&view=diff ============================================================================== --- commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java (original) +++ commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java Fri Apr 25 04:12:33 2008 @@ -1,84 +1,84 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.commons.cli2.resource; - -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import junit.framework.TestCase; - -/** - * A utility class used to provide internationalisation support. - * - * @author John Keyes - */ -public class ResourceHelperTest extends TestCase { - /** system property */ - private static final String PROP_LOCALE = "org.apache.commons.cli2.resource.bundle"; - - private static ResourceHelper helper; - - /** resource bundle */ - private ResourceBundle bundle; - - public void setUp() { - System.setProperty(PROP_LOCALE, "org.apache.commons.cli2.resource.TestBundle"); - helper = ResourceHelper.getResourceHelper(); - } - - public void tearDown() { - System.setProperty(PROP_LOCALE, "org.apache.commons.cli2.resource.CLIMessageBundle_en_US.properties"); - } - - /** - * Create a new ResourceHelper for the specified class. - * - * @param clazz the Class that requires some resources - */ - public ResourceHelperTest() { - super("ResourceHelperTest"); - } - - public void testOverridden() { - assertEquals("wrong message", "The class name \"ResourceHelper\" is invalid.", helper.getMessage("ClassValidator.bad.classname", "ResourceHelper")); - } - - public void testNewMessage1Param() { - assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message")); - } - - public void testNewMessage2Params() { - assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some")); - } - - public void testNewMessage3Params() { - assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some", "might")); - } - - public void testNewMessage4Params() { - assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some", "might", "say")); - } - - public void testDefaultBundle() { - System.setProperty(PROP_LOCALE, "madeupname.properties"); - helper = ResourceHelper.getResourceHelper(); - assertEquals("wrong message", "The class name \"ResourceHelper\" is invalid.", helper.getMessage("ClassValidator.bad.classname", "ResourceHelper")); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.commons.cli2.resource; + +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import junit.framework.TestCase; + +/** + * A utility class used to provide internationalisation support. + * + * @author John Keyes + */ +public class ResourceHelperTest extends TestCase { + /** system property */ + private static final String PROP_LOCALE = "org.apache.commons.cli2.resource.bundle"; + + private static ResourceHelper helper; + + /** resource bundle */ + private ResourceBundle bundle; + + public void setUp() { + System.setProperty(PROP_LOCALE, "org.apache.commons.cli2.resource.TestBundle"); + helper = ResourceHelper.getResourceHelper(); + } + + public void tearDown() { + System.setProperty(PROP_LOCALE, "org.apache.commons.cli2.resource.CLIMessageBundle_en_US.properties"); + } + + /** + * Create a new ResourceHelper for the specified class. + * + * @param clazz the Class that requires some resources + */ + public ResourceHelperTest() { + super("ResourceHelperTest"); + } + + public void testOverridden() { + assertEquals("wrong message", "The class name \"ResourceHelper\" is invalid.", helper.getMessage("ClassValidator.bad.classname", "ResourceHelper")); + } + + public void testNewMessage1Param() { + assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message")); + } + + public void testNewMessage2Params() { + assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some")); + } + + public void testNewMessage3Params() { + assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some", "might")); + } + + public void testNewMessage4Params() { + assertEquals("wrong message", "Some might say we will find a brighter day.", helper.getMessage("test.message", "Some", "might", "say")); + } + + public void testDefaultBundle() { + System.setProperty(PROP_LOCALE, "madeupname.properties"); + helper = ResourceHelper.getResourceHelper(); + assertEquals("wrong message", "The class name \"ResourceHelper\" is invalid.", helper.getMessage("ClassValidator.bad.classname", "ResourceHelper")); + } +} Propchange: commons/proper/cli/trunk/src/test/org/apache/commons/cli2/resource/ResourceHelperTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: commons/proper/cli/trunk/xdocs/changes.xml ------------------------------------------------------------------------------ svn:eol-style = native