Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 94161 invoked from network); 20 Oct 2008 19:58:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2008 19:58:06 -0000 Received: (qmail 54313 invoked by uid 500); 20 Oct 2008 19:58:07 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 54254 invoked by uid 500); 20 Oct 2008 19:58:07 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 54243 invoked by uid 99); 20 Oct 2008 19:58:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 12:58:07 -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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 19:57:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4DAED234C220 for ; Mon, 20 Oct 2008 12:57:44 -0700 (PDT) Message-ID: <996088969.1224532664317.JavaMail.jira@brutus> Date: Mon, 20 Oct 2008 12:57:44 -0700 (PDT) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Subject: [jira] Resolved: (CONFIGURATION-341) FileChangedReloadingStrategy not working for SubnodeConfiguration with a CombinedConfiguration parent In-Reply-To: <1942915695.1224269984348.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CONFIGURATION-341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oliver Heger resolved CONFIGURATION-341. ---------------------------------------- Resolution: Fixed Fix Version/s: 1.6 A fix was applied to trunk and to the configuration2 branch. > FileChangedReloadingStrategy not working for SubnodeConfiguration with a CombinedConfiguration parent > ----------------------------------------------------------------------------------------------------- > > Key: CONFIGURATION-341 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-341 > Project: Commons Configuration > Issue Type: Bug > Components: File reloading > Affects Versions: 1.5 > Reporter: Brian Pugh > Assignee: Oliver Heger > Fix For: 1.6 > > > A SubnodeConfiguration that has a CombinedConfiguration as its parent, doesn't "hot" reload properties even if the combined configuration consists of XMLConfigurations that have the FileChangedReloadingStrategy set, the combined configuration has the setForceReloadCheck flag set and the SubnodeConfiguration was obtained by calling configurationAt method and passing in true for the "supportUpdates" flag. > Here's some code that shows the problem where the final assertion will fail. > @Test > public void testSubnodeReadload() throws ConfigurationException { > XMLConfiguration xmlConfiguration = new XMLConfiguration("service.xml"); > FileChangedReloadingStrategy fileReloadStrategy = new FileChangedReloadingStrategy(); > fileReloadStrategy.setRefreshDelay(1000); > xmlConfiguration.setReloadingStrategy(fileReloadStrategy); > XMLConfiguration config2 = new XMLConfiguration("environment.xml"); > FileChangedReloadingStrategy fileReloadStrategy2 = new FileChangedReloadingStrategy(); > fileReloadStrategy2.setRefreshDelay(1000); > xmlConfiguration.setReloadingStrategy(fileReloadStrategy2); > CombinedConfiguration combinedConfig = new CombinedConfiguration(); > combinedConfig.setForceReloadCheck(true); > combinedConfig.addConfiguration(xmlConfiguration); > combinedConfig.addConfiguration(config2); > int queue0threads2 = xmlConfiguration.getInt("messaging-new.queue(0).threads"); > assert 2 == queue0threads2; > //change the value in service.xml to 4 > int queue0threads4 = xmlConfiguration.getInt("messaging-new.queue(0).threads"); > assert 4 == queue0threads4; > SubnodeConfiguration subConfigHier = xmlConfiguration.configurationAt("messaging-new.queue(0)", true); > int queue0threadsCombinedSub4 = subConfigHier.getInt("threads"); > assert queue0threadsCombinedSub4 == 4; > //change the value service.xml to 8 > int queue0threadsCombinedSub8 = subConfigHier.getInt("threads"); > assert queue0threadsCombinedSub8 == 8; > SubnodeConfiguration subNodeConfigParentIsCombinedConfig = combinedConfig.configurationAt("messaging-new.queue(0)", true); > int queue0threadsSub8 = subNodeConfigParentIsCombinedConfig.getInt("threads"); > assert queue0threadsSub8 == 8; > //change the value service.xml file to 16 > int queue0threadsSub16 = subNodeConfigParentIsCombinedConfig.getInt("threads"); > assert queue0threadsSub16 == 16; //THIS TEST FAILS > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.