@@ -0,0 +1,2498 @@
+/*%0A * $Header$%0A * %0A * Copyright (c) OSGi Alliance (2010). All Rights Reserved.%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.osgi.test.cases.composite.junit;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.osgi.framework.Bundle;%0Aimport org.osgi.framework.BundleException;%0Aimport org.osgi.service.composite.CompositeBundle;%0Aimport org.osgi.test.cases.composite.AbstractCompositeTestCase;%0A%0A%0A%0Apublic class CompositePropertyTests extends AbstractCompositeTestCase %7B%0A%0A%09static final String TEST1 = %22test1%22;%0A%09static final String TEST2 = %22test2%22;%0A%09static final String VALUE1 = %22value1%22;%0A%09static final String VALUE2 = %22value2%22;%0A%0A%09public void setUp() %7B%0A%09%09super.setUp();%0A%09%7D%0A%0A%09public void testProperties01() %7B%0A%09%09// Test scoping of BundleContext properties for the composite system bundle%0A%09%09Map configuration = new HashMap();%0A%09%09configuration.put(TEST1, VALUE1);%0A%09%09configuration.put(TEST2, VALUE2);%0A%09%09CompositeBundle composite = createCompositeBundle(compAdmin, getName(), null, configuration);%0A%09%09String value1 = composite.getSystemBundleContext().getProperty(TEST1);%0A%09%09assertEquals(%22Wrong value1%22, VALUE1, value1);%0A%09%09String value2 = composite.getSystemBundleContext().getProperty(TEST2);%0A%09%09assertEquals(%22Wrong value2%22, VALUE2, value2);%0A%09%7D%0A%0A%09public void testProperties02() %7B%0A%09%09// Test scoping of BundleContext properties for a constituent bundle%0A%09%09Map configuration = new HashMap();%0A%09%09configuration.put(TEST1, VALUE1);%0A%09%09configuration.put(TEST2, VALUE2);%0A%09%09CompositeBundle composite = createCompositeBundle(compAdmin, getName(), null, configuration);%0A%09%09Bundle tb1 = installConstituent(composite, %22tb1%22, %22tb1.jar%22);%0A%09%09startCompositeBundle(composite);%0A%09%09try %7B%0A%09%09%09tb1.start();%0A%09%09%7D catch (BundleException e) %7B%0A%09%09%09fail(%22Failed to start tb1.%22, e);%0A%09%09%7D%0A%09%09String value1 = tb1.getBundleContext().getProperty(TEST1);%0A%09%09assertEquals(%22Wrong value1%22, VALUE1, value1);%0A%09%09String value2 = tb1.getBundleContext().getProperty(TEST2);%0A%09%09assertEquals(%22Wrong value2%22, VALUE2, value2);%0A%09%7D%0A%7D%0A

Add tests for context property scoping.