You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by tj...@apache.org on 2019/07/03 16:36:13 UTC
svn commit: r1862494 - in /felix/trunk/scr/src/test:
java/org/apache/felix/scr/integration/
java/org/apache/felix/scr/integration/components/metadata/
java/org/apache/felix/scr/integration/components/metadata/cache/ resources/
Author: tjwatson
Date: Wed Jul 3 16:36:13 2019
New Revision: 1862494
URL: http://svn.apache.org/viewvc?rev=1862494&view=rev
Log:
FELIX-6155 - Add integration tests for caching of component metadata
Added:
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentMetaDataCacheIntegrationTest.java
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/Activator.java
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleService.java
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleServiceImpl.java
felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache.xml
felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache2.xml
Modified:
felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
Added: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentMetaDataCacheIntegrationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentMetaDataCacheIntegrationTest.java?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentMetaDataCacheIntegrationTest.java (added)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentMetaDataCacheIntegrationTest.java Wed Jul 3 16:36:13 2019
@@ -0,0 +1,288 @@
+/*
+ * 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.felix.scr.integration;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.component.runtime.ServiceComponentRuntime;
+import org.osgi.service.component.runtime.dto.ComponentConfigurationDTO;
+import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO;
+import org.osgi.service.component.runtime.dto.SatisfiedReferenceDTO;
+
+/**
+ * The <code>ComponentMetaDataCacheIntegrationTest</code> tests if restart of
+ * scr bundle causes component metadata to be reused from a cache which is
+ * stored during stopping the scr bundle.
+ *
+ */
+@RunWith(PaxExam.class)
+public class ComponentMetaDataCacheIntegrationTest extends ComponentTestBase
+{
+ static
+ {
+ // use different components
+ descriptorFile = "/integration_test_component_metadata_cache.xml";
+ COMPONENT_PACKAGE = COMPONENT_PACKAGE + ".metadata.cache";
+ CACHE_META_DATA = true;
+
+ // uncomment to enable debugging of this test class
+ // paxRunnerVmOption = DEBUG_VM_OPTION;
+ }
+
+ @Test
+ public void testCacheExists() throws Exception
+ {
+ Collection<ComponentDescriptionDTO> actualComponents = getComponentDescriptions(
+ bundle);
+
+ ServiceReference<ServiceComponentRuntime> ref = scrTracker.getServiceReference();
+ Bundle scrBundle = ref.getBundle();
+ File f = scrBundle.getDataFile("componentMetadataStore");
+ assertFalse("Cache " + f.getAbsolutePath() + " should not exist", f.exists());
+ scrBundle.stop();
+ scrBundle.start();
+ delay();
+ assertTrue("Cache " + f.getAbsolutePath() + " does not exist", f.exists());
+
+ Collection<ComponentDescriptionDTO> cachedComponents = getComponentDescriptions(
+ bundle);
+ assertComponentsEqual((List<ComponentDescriptionDTO>) actualComponents,
+ (List<ComponentDescriptionDTO>) cachedComponents);
+ }
+
+ @Test
+ public void testUpdateBundleDismissesCache() throws Exception
+ {
+
+ // Suppose actualBundle = BundleA, updatedBundle = BundleB
+
+ Collection<ComponentDescriptionDTO> bundleAComponents = getComponentDescriptions(
+ bundle);
+
+ ServiceReference<ServiceComponentRuntime> ref = scrTracker.getServiceReference();
+ Bundle scrBundle = ref.getBundle();
+ File f = scrBundle.getDataFile("componentMetadataStore");
+ assertFalse("Cache " + f.getAbsolutePath() + " should not exist", f.exists());
+ scrBundle.stop();
+ scrBundle.start();
+ delay();
+ assertTrue("Cache " + f.getAbsolutePath() + " does not exist", f.exists());
+
+ String descFile = "/integration_test_component_metadata_cache2.xml";
+
+ bundle.update(createBundleInputStream(descFile, COMPONENT_PACKAGE,
+ "simplecomponent", "0.0.12"));
+
+ Collection<ComponentDescriptionDTO> bundleBComponents = getComponentDescriptions(
+ bundle);
+
+ // testing the change in number of components when the bundle was updated - this verifies that the cache wasn't used
+ assertEquals("Expected number of components not found in updated bundle", 2,
+ ((List<ComponentDescriptionDTO>) bundleBComponents).size());
+
+ scrBundle.stop();
+ scrBundle.start();
+
+ Collection<ComponentDescriptionDTO> cachedBundleBComponents = getComponentDescriptions(
+ bundle);
+
+ assertComponentsEqual((List<ComponentDescriptionDTO>) bundleBComponents,
+ (List<ComponentDescriptionDTO>) cachedBundleBComponents);
+
+ scrBundle.stop();
+
+ // updating bundle back to original
+ bundle.update(createBundleInputStream(descriptorFile, COMPONENT_PACKAGE,
+ "simplecomponent", "0.0.11"));
+
+ scrBundle.start();
+
+ Collection<ComponentDescriptionDTO> bundleCComponents = getComponentDescriptions(
+ bundle);
+
+ assertComponentsEqual((List<ComponentDescriptionDTO>) bundleCComponents,
+ (List<ComponentDescriptionDTO>) bundleAComponents);
+ }
+
+ private void assertComponentsEqual(List<ComponentDescriptionDTO> actualComponents,
+ List<ComponentDescriptionDTO> cachedComponents)
+ throws InvocationTargetException, InterruptedException
+ {
+ assertEquals("Number of components not equal", actualComponents.size(),
+ cachedComponents.size());
+ for (int i = 0; i < actualComponents.size(); i++)
+ {
+ ComponentDescriptionDTO actualComponent = actualComponents.get(i);
+ ComponentDescriptionDTO cachedComponent = cachedComponents.get(i);
+
+ assertEquals("Component Name not equal", actualComponent.name,
+ cachedComponent.name);
+ assertEquals("Expecting components to be enabled",
+ actualComponent.defaultEnabled, cachedComponent.defaultEnabled);
+
+ ComponentConfigurationDTO actualCC = findComponentConfigurationByName(
+ actualComponent.name, 0);
+ ComponentConfigurationDTO cachedCC = findComponentConfigurationByName(
+ cachedComponent.name, 0);
+ assertEquals("Expecting component states to be equal", actualCC.state,
+ cachedCC.state);
+
+ checkSatisfiedReferences(actualCC.satisfiedReferences,
+ cachedCC.satisfiedReferences);
+
+ checkProperties(actualCC.properties, cachedCC.properties);
+
+ if (actualCC.service != null && cachedCC.service != null)
+ {
+ assertEquals("Service Reference not same", actualCC.service.toString(),
+ cachedCC.service.toString());
+ }
+ }
+ }
+
+ private static void checkSatisfiedReferences(
+ SatisfiedReferenceDTO[] satisfiedReferences1,
+ SatisfiedReferenceDTO[] satisfiedReferences2)
+ {
+ assertEquals("Size of satisfied references not equal",
+ satisfiedReferences1.length, satisfiedReferences2.length);
+ for (int i = 0; i < satisfiedReferences1.length; i++)
+ {
+ assertEquals("Satisfied referneces name not equal",
+ satisfiedReferences1[i].toString(), satisfiedReferences2[i].toString());
+ }
+ }
+
+ private static void checkProperties(Map<String, Object> actualProperties,
+ Map<String, Object> cachedProperties)
+ {
+ assertEquals("Properties size not equal", actualProperties.size(),
+ cachedProperties.size());
+ for (String property : actualProperties.keySet())
+ {
+ assertTrue("Properties not equal", cachedProperties.containsKey(property));
+ checkPropertyValues(actualProperties.get(property),
+ cachedProperties.get(property));
+ }
+ }
+
+ private static void checkPropertyValues(Object value1, Object value2)
+ {
+ assertEquals("Property Values type not same", value1.getClass(),
+ value2.getClass());
+ if (value1.getClass().isArray())
+ {
+ if (value1 instanceof char[])
+ {
+ char[] v1 = (char[]) value1;
+ char[] v2 = (char[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ else if (value1 instanceof int[])
+ {
+ int[] v1 = (int[]) value1;
+ int[] v2 = (int[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ else if (value1 instanceof short[])
+ {
+ short[] v1 = (short[]) value1;
+ short[] v2 = (short[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ else if (value1 instanceof long[])
+ {
+ long[] v1 = (long[]) value1;
+ long[] v2 = (long[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ else if (value1 instanceof double[])
+ {
+ double[] v1 = (double[]) value1;
+ double[] v2 = (double[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2, 0);
+ }
+
+ else if (value1 instanceof float[])
+ {
+ float[] v1 = (float[]) value1;
+ float[] v2 = (float[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2, 0);
+ }
+
+ else if (value1 instanceof boolean[])
+ {
+ boolean[] v1 = (boolean[]) value1;
+ boolean[] v2 = (boolean[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ for (int i = 0; i < v1.length; i++)
+ {
+ assertEquals("Property Values not equal", v1[i], v2[i]);
+ }
+ }
+
+ else if (value1 instanceof byte[])
+ {
+ byte[] v1 = (byte[]) value1;
+ byte[] v2 = (byte[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ else if (value1 instanceof String[])
+ {
+ String[] v1 = (String[]) value1;
+ String[] v2 = (String[]) value2;
+ assertEquals("Length of property values not equal", v1.length, v1.length);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ }
+ else
+ {
+ assertEquals("Properties values not equal", value1, value2);
+ }
+
+ }
+
+}
Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java?rev=1862494&r1=1862493&r2=1862494&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java (original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java Wed Jul 3 16:36:13 2019
@@ -126,6 +126,9 @@ public abstract class ComponentTestBase
protected static String COMPONENT_PACKAGE = "org.apache.felix.scr.integration.components";
protected static boolean NONSTANDARD_COMPONENT_FACTORY_BEHAVIOR = false;
+
+ protected static boolean CACHE_META_DATA = false;
+
protected volatile Log log;
protected static String[] ignoredWarnings; //null unless you need it.
@@ -158,7 +161,8 @@ public abstract class ComponentTestBase
+ "org.apache.felix.scr.integration.components.felix3680_2,"
+ "org.apache.felix.scr.integration.components.felix4984,"
+ "org.apache.felix.scr.integration.components.felix5248,"
- + "org.apache.felix.scr.integration.components.felix5276" );
+ + "org.apache.felix.scr.integration.components.felix5276,"
+ + "org.apache.felix.scr.integration.components.metadata.cache" );
builder.setHeader( "Import-Package", "org.apache.felix.scr.component" );
builder.setHeader( "Bundle-ManifestVersion", "2" );
return builder;
@@ -183,7 +187,8 @@ public abstract class ComponentTestBase
mavenBundle( "org.osgi", "org.osgi.util.function"),
junitBundles(), frameworkProperty( "org.osgi.framework.bsnversion" ).value( bsnVersionUniqueness ),
systemProperty( "ds.factory.enabled" ).value( Boolean.toString( NONSTANDARD_COMPONENT_FACTORY_BEHAVIOR ) ),
- systemProperty( "ds.loglevel" ).value( DS_LOGLEVEL )
+ systemProperty( "ds.loglevel" ).value( DS_LOGLEVEL ),
+ systemProperty( "ds.cache.metadata" ).value( Boolean.toString(CACHE_META_DATA) )
);
final Option vmOption = ( paxRunnerVmOption != null )? CoreOptions.vmOption( paxRunnerVmOption ): null;
@@ -232,14 +237,14 @@ public abstract class ComponentTestBase
}
}
- protected Collection<ComponentDescriptionDTO> getComponentDescriptions()
+ protected Collection<ComponentDescriptionDTO> getComponentDescriptions(Bundle... bundles)
{
ServiceComponentRuntime scr = scrTracker.getService();
if ( scr == null )
{
TestCase.fail( "no ServiceComponentRuntime" );
}
- return scr.getComponentDescriptionDTOs();
+ return scr.getComponentDescriptionDTOs(bundles);
}
protected ComponentDescriptionDTO findComponentDescriptorByName(String name)
@@ -695,15 +700,8 @@ public abstract class ComponentTestBase
protected Bundle installBundle(final String descriptorFile, String componentPackage, String symbolicName,
String version, String location) throws BundleException
{
- final InputStream bundleStream = bundle().add( "OSGI-INF/components.xml",
- getClass().getResource( descriptorFile ) )
-
- .set( Constants.BUNDLE_SYMBOLICNAME, symbolicName ).set( Constants.BUNDLE_VERSION, version ).set(
- Constants.IMPORT_PACKAGE, componentPackage ).set( "Service-Component", "OSGI-INF/components.xml" ).set(
- Constants.REQUIRE_CAPABILITY,
- ExtenderNamespace.EXTENDER_NAMESPACE
- + ";filter:=\"(&(osgi.extender=osgi.component)(version>=1.3)(!(version>=2.0)))\"" ).build(
- withBnd() );
+ final InputStream bundleStream = createBundleInputStream(descriptorFile, componentPackage, symbolicName,
+ version);
try
{
@@ -725,6 +723,21 @@ public abstract class ComponentTestBase
}
}
+ protected InputStream createBundleInputStream(final String descriptorFile,
+ String componentPackage, String symbolicName, String version)
+ {
+ final InputStream bundleStream = bundle().add("OSGI-INF/components.xml",
+ getClass().getResource( descriptorFile ) )
+
+ .set( Constants.BUNDLE_SYMBOLICNAME, symbolicName ).set( Constants.BUNDLE_VERSION, version ).set(
+ Constants.IMPORT_PACKAGE, componentPackage ).set( "Service-Component", "OSGI-INF/components.xml" ).set(
+ Constants.REQUIRE_CAPABILITY,
+ ExtenderNamespace.EXTENDER_NAMESPACE
+ + ";filter:=\"(&(osgi.extender=osgi.component)(version>=1.3)(!(version>=2.0)))\"" ).build(
+ withBnd() );
+ return bundleStream;
+ }
+
//Code copied from ScrCommand to make it easier to find out what your test components are actually doing.
// @Test
public void testDescription() throws Exception {
Added: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/Activator.java?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/Activator.java (added)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/Activator.java Wed Jul 3 16:36:13 2019
@@ -0,0 +1,69 @@
+/*
+ * 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.felix.scr.integration.components.metadata.cache;
+
+import java.util.Map;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class Activator
+{
+
+ private ServiceRegistration<?> registration;
+
+ private SimpleService simpleService;
+
+ @SuppressWarnings("unused")
+ private void myActivate(BundleContext context, Map<?, ?> configuration)
+ {
+ registration = context.registerService(SimpleService.class.getName(),
+ new SimpleServiceImpl(), null);
+ }
+
+ @SuppressWarnings("unused")
+ private void myDeactivate(Map<?, ?> configuration)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+
+ public SimpleService getSimpleService()
+ {
+ return simpleService;
+ }
+
+ @SuppressWarnings("unused")
+ private void bindService(SimpleService simpleService)
+ {
+ this.simpleService = simpleService;
+ }
+
+ @SuppressWarnings("unused")
+ private void unbindService(SimpleService simpleService)
+ {
+ if (this.simpleService == simpleService)
+ {
+ this.simpleService = null;
+ }
+ }
+}
Added: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleService.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleService.java?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleService.java (added)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleService.java Wed Jul 3 16:36:13 2019
@@ -0,0 +1,24 @@
+/*
+ * 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.felix.scr.integration.components.metadata.cache;
+
+public interface SimpleService
+{
+ String getValue();
+}
Added: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleServiceImpl.java?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleServiceImpl.java (added)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/components/metadata/cache/SimpleServiceImpl.java Wed Jul 3 16:36:13 2019
@@ -0,0 +1,30 @@
+/*
+ * 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.felix.scr.integration.components.metadata.cache;
+
+public class SimpleServiceImpl implements SimpleService
+{
+
+ @Override
+ public String getValue()
+ {
+ return "Simple Service";
+ }
+
+}
Added: felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache.xml?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache.xml (added)
+++ felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache.xml Wed Jul 3 16:36:13 2019
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0">
+
+ <!-- Components used for the ComponentActivationTest integration test. This
+ tests components with and without activate/deactivate method configured and
+ with and without activate/deactivate methods present -->
+
+ <scr:component name="component1" enabled="true"
+ activate="myActivate" deactivate="myDeactivate">
+ <implementation
+ class="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ </scr:component>
+
+
+ <scr:component name="component2" enabled="true"
+ activate="myActivate" deactivate="myDeactivate">
+ <implementation
+ class="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ <property name="registerService" value="true" />
+ <reference name="service"
+ interface="org.apache.felix.scr.integration.components.metadata.cache.SimpleService"
+ bind="bindService" unbind="unbindService" policy="static"
+ cardinality="0..1" />
+ </scr:component>
+
+
+ <scr:component name="component3" enabled="true"
+ activate="myActivate" deactivate="myDeactivate">
+ <implementation
+ class="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ <service factory="false">
+ <provide
+ interface="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ </service>
+ <property name="char_array_property" type="Character">
+ 65
+ 66
+ </property>
+
+ <property name="string_array_property" type="String">
+ prop1
+ prop2
+ </property>
+
+ <property name="int_array_property" type="Integer">
+ 1
+ 2
+ </property>
+
+ <property name="long_array_property" type="Long">
+ 1
+ 2
+ </property>
+
+ <property name="double_array_property" type="Double">
+ 1.0
+ 2.0
+ </property>
+
+ <property name="float_array_property" type="Float">
+ 1.0
+ 2.0
+ </property>
+
+ <property name="short_array_property" type="Short">
+ 1
+ 2
+ </property>
+ <property name="byte_array_property" type="Byte">
+ 126
+ 127
+ </property>
+
+ <property name="boolean_array_property" type="Boolean">
+ true
+ false
+ </property>
+
+ <reference name="service"
+ interface="org.apache.felix.scr.integration.components.metadata.cache.SimpleService"
+ bind="bindService" unbind="unbindService" policy="dynamic"
+ cardinality="0..n" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache2.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache2.xml?rev=1862494&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache2.xml (added)
+++ felix/trunk/scr/src/test/resources/integration_test_component_metadata_cache2.xml Wed Jul 3 16:36:13 2019
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0">
+
+ <!-- Components used for the ComponentActivationTest integration test. This
+ tests components with and without activate/deactivate method configured and
+ with and without activate/deactivate methods present -->
+
+ <scr:component name="component1" enabled="true"
+ activate="myActivate" deactivate="myDeactivate">
+ <implementation
+ class="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ </scr:component>
+
+
+ <scr:component name="component2" enabled="true"
+ activate="myActivate" deactivate="myDeactivate">
+ <implementation
+ class="org.apache.felix.scr.integration.components.metadata.cache.Activator" />
+ <property name="registerService" value="true" />
+ <reference name="service"
+ interface="org.apache.felix.scr.integration.components.metadata.cache.SimpleService"
+ bind="bindService" unbind="unbindService" policy="dynamic"
+ cardinality="0..n" />
+ </scr:component>
+
+</components>