Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C1C5161FA for ; Mon, 20 Jun 2011 15:42:40 +0000 (UTC) Received: (qmail 85414 invoked by uid 500); 20 Jun 2011 15:42:40 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 85386 invoked by uid 500); 20 Jun 2011 15:42:40 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 85379 invoked by uid 99); 20 Jun 2011 15:42:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 15:42:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 15:42:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 96D4A238896F; Mon, 20 Jun 2011 15:42:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1137668 - /felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java Date: Mon, 20 Jun 2011 15:42:19 -0000 To: commits@felix.apache.org From: marrs@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110620154219.96D4A238896F@eris.apache.org> Author: marrs Date: Mon Jun 20 15:42:19 2011 New Revision: 1137668 URL: http://svn.apache.org/viewvc?rev=1137668&view=rev Log: FELIX-2987 Added a test case to this class that shows the problem that was reported. Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java?rev=1137668&r1=1137667&r2=1137668&view=diff ============================================================================== --- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java (original) +++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java Mon Jun 20 15:42:19 2011 @@ -72,6 +72,28 @@ public class ConfigurationDependencyTest // ensure we executed all steps inside the component instance e.step(5); } + + @Test + public void testFELIX2987(BundleContext context) { + // mimics testComponentWithRequiredConfigurationAndServicePropertyPropagation + DependencyManager m = new DependencyManager(context); + // helper class that ensures certain steps get executed in sequence + Ensure e = new Ensure(); + // create a service provider and consumer + Component s1 = m.createComponent().setImplementation(new ConfigurationConsumer2(e)).setInterface(Runnable.class.getName(), null).add(m.createConfigurationDependency().setPid("test").setPropagate(true)); + Component s2 = m.createComponent().setImplementation(new ConfigurationCreator(e)).add(m.createServiceDependency().setService(ConfigurationAdmin.class).setRequired(true)); + Component s3 = m.createComponent().setImplementation(new ConfiguredServiceConsumer(e)).add(m.createServiceDependency().setService(Runnable.class, ("(testkey=testvalue)")).setRequired(true)); + m.add(s1); + m.add(s2); + m.add(s3); + e.waitForStep(4, 15000); + m.remove(s1); + m.remove(s2); + m.remove(s3); + // ensure we executed all steps inside the component instance + e.step(5); + } + static class ConfigurationCreator { private volatile ConfigurationAdmin m_ca; @@ -94,6 +116,12 @@ public class ConfigurationDependencyTest } } } + + static class ConfigurationConsumer2 extends ConfigurationConsumer { + public ConfigurationConsumer2(Ensure e) { + super(e); + } + } static class ConfigurationConsumer implements ManagedService, Runnable { private final Ensure m_ensure;