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:08 UTC
svn commit: r1862493 - in /felix/trunk/scr/src/test:
java/org/apache/felix/scr/impl/metadata/ resources/
Author: tjwatson
Date: Wed Jul 3 16:36:07 2019
New Revision: 1862493
URL: http://svn.apache.org/viewvc?rev=1862493&view=rev
Log:
FELIX-6155 - Add unit tests for caching of component meta data
Added:
felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetaDataCacheTest.java
felix/trunk/scr/src/test/resources/components_10.xml
felix/trunk/scr/src/test/resources/components_11.xml
felix/trunk/scr/src/test/resources/components_12.xml
felix/trunk/scr/src/test/resources/components_13.xml
felix/trunk/scr/src/test/resources/components_14.xml
felix/trunk/scr/src/test/resources/factory_14.properties
Added: felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetaDataCacheTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetaDataCacheTest.java?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetaDataCacheTest.java (added)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/impl/metadata/ComponentMetaDataCacheTest.java Wed Jul 3 16:36:07 2019
@@ -0,0 +1,285 @@
+/*
+ * 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.impl.metadata;
+
+import static org.junit.Assert.assertArrayEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.felix.scr.impl.metadata.MetadataStoreHelper.MetaDataReader;
+import org.apache.felix.scr.impl.metadata.MetadataStoreHelper.MetaDataWriter;
+import org.xmlpull.v1.XmlPullParserException;
+
+public class ComponentMetaDataCacheTest extends ComponentBase
+{
+
+ public void testCachedComponentMetadata10() throws Exception
+ {
+ doTestCachedComponentMetadata("/components_10.xml", DSVersion.DS10);
+ }
+
+ public void testCachedComponentMetadata11() throws Exception
+ {
+ doTestCachedComponentMetadata("/components_11.xml", DSVersion.DS11);
+ }
+
+ public void testCachedComponentMetadata12() throws Exception
+ {
+ doTestCachedComponentMetadata("/components_12.xml", DSVersion.DS12);
+ }
+
+ public void testCachedComponentMetadata13() throws Exception
+ {
+ doTestCachedComponentMetadata("/components_13.xml", DSVersion.DS13);
+ }
+
+ public void testCachedComponentMetadata14() throws Exception
+ {
+ doTestCachedComponentMetadata("/components_14.xml", DSVersion.DS14);
+ }
+
+ private void doTestCachedComponentMetadata(String xmlFile, DSVersion version)
+ throws IOException, XmlPullParserException, Exception
+ {
+ final List<?> metadataList = readMetadata(xmlFile);
+ assertEquals("Component Descriptors size not as expected", 1,
+ metadataList.size());
+ final ComponentMetadata actualCM = (ComponentMetadata) metadataList.get(0);
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ DataOutputStream dataOut = new DataOutputStream(out);
+ MetaDataWriter metaDataWriter = new MetaDataWriter();
+ actualCM.validate();
+ actualCM.store(dataOut, metaDataWriter);
+
+ MetaDataReader metaDataReader = new MetaDataReader();
+ DataInputStream dataIn = new DataInputStream(
+ new ByteArrayInputStream(out.toByteArray()));
+ ComponentMetadata cachedCM = ComponentMetadata.load(dataIn, metaDataReader);
+ assertEquals("Expected version not found", version, cachedCM.getDSVersion());
+
+ assertEqualsCM(actualCM, cachedCM);
+ }
+
+ private static void assertEqualsCM(ComponentMetadata actualCM,
+ ComponentMetadata cachedCM)
+ {
+ assertEquals("DS version is not equal", actualCM.getDSVersion(),
+ cachedCM.getDSVersion());
+ assertEquals("Component name is not equal", actualCM.getName(),
+ cachedCM.getName());
+ assertEquals("Activate method name not equal", actualCM.getActivate(),
+ cachedCM.getActivate());
+ assertEquals("Activate method declaration not equal",
+ actualCM.isActivateDeclared(), cachedCM.isActivateDeclared());
+ assertEquals("Activate fields not equal", actualCM.getActivationFields(),
+ cachedCM.getActivationFields());
+ assertEquals("Deactivate method name not equal", actualCM.getDeactivate(),
+ cachedCM.getDeactivate());
+ assertEquals("Deactivate method declaration not equal",
+ actualCM.isDeactivateDeclared(), cachedCM.isDeactivateDeclared());
+ assertEquals("Modified method name not equal", actualCM.getModified(),
+ cachedCM.getModified());
+ assertEquals("Configuration Policy not equal", actualCM.getConfigurationPolicy(),
+ cachedCM.getConfigurationPolicy());
+ assertEquals("Configuration Pid not equal", actualCM.getConfigurationPid(),
+ cachedCM.getConfigurationPid());
+ assertEquals("Factory Identifier not equal", actualCM.getFactoryIdentifier(),
+ cachedCM.getFactoryIdentifier());
+ assertEquals("Factory check not equal", actualCM.isFactory(),
+ cachedCM.isFactory());
+ assertEquals("Activation policy flag not equal", actualCM.isImmediate(),
+ cachedCM.isImmediate());
+ assertEquals("Implementation Class Name not equal",
+ actualCM.getImplementationClassName(), cachedCM.getImplementationClassName());
+ assertEquals("Number of Init parameters not equal",
+ actualCM.getNumberOfConstructorParameters(),
+ cachedCM.getNumberOfConstructorParameters());
+ checkServiceMetadata(actualCM, cachedCM);
+
+ checkReferenceMetadata(actualCM, cachedCM);
+
+ checkProperties(actualCM.getProperties(), cachedCM.getProperties());
+
+ checkProperties(actualCM.getFactoryProperties(), cachedCM.getFactoryProperties());
+ }
+
+ private static void checkServiceMetadata(ComponentMetadata actualCM,
+ ComponentMetadata cachedCM)
+ {
+ ServiceMetadata sm1 = actualCM.getServiceMetadata();
+ ServiceMetadata sm2 = cachedCM.getServiceMetadata();
+ if (sm1 != null && sm2 != null)
+ {
+ sm2.validate(cachedCM);
+ assertEquals("Service scope not equal", sm1.getScope(), sm2.getScope());
+ String[] implementedInterfaces1 = sm1.getProvides();
+ String[] implementedInterfaces2 = sm2.getProvides();
+ assertEquals("Service Provides length not equal",
+ implementedInterfaces1.length, implementedInterfaces2.length);
+ for (int i = 0; i < implementedInterfaces1.length; i++)
+ {
+ assertEquals("Implemented interfaces not same", implementedInterfaces1[i],
+ implementedInterfaces2[i]);
+ }
+ }
+ }
+
+ private static void checkReferenceMetadata(ComponentMetadata actualCM,
+ ComponentMetadata cachedCM)
+ {
+ List<ReferenceMetadata> references1 = actualCM.getDependencies();
+ List<ReferenceMetadata> references2 = cachedCM.getDependencies();
+ assertEquals("Number of references not same", references1.size(),
+ references2.size());
+ for (int i = 0; i < references1.size(); i++)
+ {
+ ReferenceMetadata r1 = references1.get(i);
+ ReferenceMetadata r2 = references2.get(i);
+ r2.validate(cachedCM);
+ assertEquals("Reference name not equal", r1.getName(), r2.getName());
+ assertEquals("Reference interface not equal", r1.getInterface(),
+ r2.getInterface());
+ assertEquals("Reference cardinality not equal", r1.getCardinality(),
+ r2.getCardinality());
+ assertEquals("Reference policy not equal", r1.getPolicy(), r2.getPolicy());
+ assertEquals("Reference policy option not equal", r1.getPolicyOption(),
+ r2.getPolicyOption());
+ assertEquals("Reference target not equal", r1.getTarget(), r2.getTarget());
+ assertEquals("Reference target property name not equal",
+ r1.getTargetPropertyName(), r2.getTargetPropertyName());
+ assertEquals("Reference bind not equal", r1.getBind(), r2.getBind());
+ assertEquals("Reference unbind not equal", r1.getUnbind(), r2.getUnbind());
+ assertEquals("Reference updated not equal", r1.getUpdated(), r2.getUpdated());
+ assertEquals("Reference field not equal", r1.getField(), r2.getField());
+ assertEquals("Reference field option not equal", r1.getFieldOption(),
+ r2.getFieldOption());
+ assertEquals("Reference field collection type not equal",
+ r1.getFieldCollectionType(), r2.getFieldCollectionType());
+ assertEquals("Reference scope not equal", r1.getScope(), r2.getScope());
+ assertEquals("Reference parameter index not equal", r1.getParameterIndex(),
+ r2.getParameterIndex());
+ assertEquals("Reference parameter collection type not equal",
+ r1.getParameterCollectionType(), r2.getParameterCollectionType());
+ }
+ }
+
+ private static void checkProperties(Map<String, Object> properties1,
+ Map<String, Object> properties2)
+ {
+ assertEquals("Properties size not equal", properties1.size(), properties2.size());
+
+ for (String key : properties1.keySet())
+ {
+ assertTrue("Properties not equal", properties2.containsKey(key));
+ checkPropertyValues(properties1.get(key), properties2.get(key));
+ }
+ }
+
+ 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);
+ assertArrayEquals("Property Values not equal", v1, v2);
+ }
+
+ 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);
+ }
+
+ }
+}
Added: felix/trunk/scr/src/test/resources/components_10.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_10.xml?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_10.xml (added)
+++ felix/trunk/scr/src/test/resources/components_10.xml Wed Jul 3 16:36:07 2019
@@ -0,0 +1,90 @@
+<?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>
+
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0" enabled="true"
+ name="components.name.10">
+
+ <implementation class="components.impl.10" />
+
+ <property name="prop" value="1234" type="Integer" />
+
+ <property name="char_array_property" type="Char">
+ 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>
+
+ <properties entry="components_all_elements_10.properties" />
+
+ <service servicefactory="true">
+ <provide interface="components.service.10" />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference name="ref.name.1" interface="ref.service.1"
+ cardinality="0..1" policy="static" target="ref.target.1"
+ bind="ref_bind_1" unbind="ref_unbind_1" />
+
+ <reference name="ref.name.2" interface="ref.service.2"
+ cardinality="1..1" policy="static" target="ref.target.2"
+ bind="ref_bind_2" unbind="ref_unbind_2" />
+
+ <reference name="ref.name.3" interface="ref.service.3"
+ cardinality="0..n" policy="dynamic" target="ref.target.3"
+ bind="ref_bind_3" unbind="ref_unbind_3" />
+
+ <reference name="ref.name.4" interface="ref.service.4"
+ cardinality="1..n" policy="dynamic" target="ref.target.4"
+ bind="ref_bind_4" unbind="ref_unbind_4" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/components_11.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_11.xml?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_11.xml (added)
+++ felix/trunk/scr/src/test/resources/components_11.xml Wed Jul 3 16:36:07 2019
@@ -0,0 +1,90 @@
+<?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>
+
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" enabled="true"
+ name="components.name.11" activate="myactivate"
+ deactivate="mydeactivate" modified="mymodified"
+ configuration-policy="ignore">
+
+ <implementation class="components.impl.11" />
+
+ <property name="prop" value="1234" type="Integer" />
+
+ <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>
+
+ <service servicefactory="true">
+ <provide interface="components.service.11" />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference name="ref.name.1" interface="ref.service.1"
+ cardinality="0..1" policy="static" target="ref.target.1"
+ bind="ref_bind_1" unbind="ref_unbind_1" />
+
+ <reference name="ref.name.2" interface="ref.service.2"
+ cardinality="1..1" policy="static" target="ref.target.2"
+ bind="ref_bind_2" unbind="ref_unbind_2" />
+
+ <reference name="ref.name.3" interface="ref.service.3"
+ cardinality="0..n" policy="dynamic" target="ref.target.3"
+ bind="ref_bind_3" unbind="ref_unbind_3" />
+
+ <reference name="ref.name.4" interface="ref.service.4"
+ cardinality="1..n" policy="dynamic" target="ref.target.4"
+ bind="ref_bind_4" unbind="ref_unbind_4" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/components_12.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_12.xml?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_12.xml (added)
+++ felix/trunk/scr/src/test/resources/components_12.xml Wed Jul 3 16:36:07 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>
+
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0" enabled="true"
+ name="components.name.12" activate="myactivate"
+ deactivate="mydeactivate" modified="mymodified"
+ configuration-policy="optional" configuration-pid="pid.12">
+
+ <implementation class="components.impl.12" />
+
+ <property name="prop" value="1234" type="Integer" />
+
+ <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>
+
+ <service servicefactory="true">
+ <provide interface="components.service.12" />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference name="ref.name.1" interface="ref.service.1"
+ cardinality="0..1" policy="static" policy-option="greedy"
+ target="ref.target.1" bind="ref_bind_1" unbind="ref_unbind_1"
+ updated="updated_1" />
+
+ <reference name="ref.name.2" interface="ref.service.2"
+ cardinality="1..1" policy="static" policy-option="reluctant"
+ target="ref.target.2" bind="ref_bind_2" unbind="ref_unbind_2"
+ updated="updated_2" />
+
+ <reference name="ref.name.3" interface="ref.service.3"
+ cardinality="0..n" policy="dynamic" policy-option="greedy"
+ target="ref.target.3" bind="ref_bind_3" unbind="ref_unbind_3"
+ updated="updated_3" />
+
+ <reference name="ref.name.4" interface="ref.service.4"
+ cardinality="1..n" policy="dynamic" policy-option="reluctant"
+ target="ref.target.4" bind="ref_bind_4" unbind="ref_unbind_4"
+ updated="updated_4" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/components_13.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_13.xml?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_13.xml (added)
+++ felix/trunk/scr/src/test/resources/components_13.xml Wed Jul 3 16:36:07 2019
@@ -0,0 +1,99 @@
+<?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>
+
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0" enabled="true"
+ name="components.name.13" activate="myactivate"
+ deactivate="mydeactivate" modified="mymodified"
+ configuration-policy="require" configuration-pid="pid.13"
+ immediate="true">
+
+ <implementation class="components.impl.13" />
+
+ <property name="prop" value="1234" type="Integer" />
+
+ <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>
+
+ <service>
+ <provide interface="components.service.13" />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference name="ref.name.1" interface="ref.service.1"
+ cardinality="0..1" policy="static" policy-option="greedy"
+ target="ref.target.1" bind="ref_bind_1" unbind="ref_unbind_1"
+ updated="updated_1" field="field1" field-option="replace"
+ scope="bundle" />
+
+ <reference name="ref.name.2" interface="ref.service.2"
+ cardinality="1..1" policy="static" policy-option="reluctant"
+ target="ref.target.2" bind="ref_bind_2" unbind="ref_unbind_2"
+ updated="updated_2" field="field2" field-option="replace"
+ scope="prototype" />
+
+ <reference name="ref.name.3" interface="ref.service.3"
+ cardinality="0..n" policy="dynamic" policy-option="greedy"
+ target="ref.target.3" bind="ref_bind_3" unbind="ref_unbind_3"
+ updated="updated_3" field="field3" field-option="replace"
+ field-collection-type="reference" scope="prototype_required" />
+
+ <reference name="ref.name.4" interface="ref.service.4"
+ cardinality="1..n" policy="dynamic" policy-option="reluctant"
+ target="ref.target.4" bind="ref_bind_4" unbind="ref_unbind_4"
+ updated="updated_4" field="field4" field-option="update"
+ field-collection-type="properties" scope="bundle" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/components_14.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/components_14.xml?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/components_14.xml (added)
+++ felix/trunk/scr/src/test/resources/components_14.xml Wed Jul 3 16:36:07 2019
@@ -0,0 +1,148 @@
+<?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>
+
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0" enabled="true"
+ name="components.name.14" activate="myactivate"
+ activation-fields="field1,field2" deactivate="mydeactivate"
+ modified="mymodified" configuration-policy="require"
+ configuration-pid="pid.14" factory="components.14.factory" init="1">
+
+ <implementation class="components.impl.14" />
+
+ <property name="prop" value="1234" type="Integer" />
+
+ <property name="char_array_property" type="Character">
+ 65
+ 66
+ </property>
+ <factory-property name="char_array_property"
+ type="Character">
+ 65
+ 66
+ </factory-property>
+
+ <property name="string_array_property" type="String">
+ prop1
+ prop2
+ </property>
+ <factory-property name="String_array_property"
+ type="String">
+ prop1
+ prop2
+ </factory-property>
+
+ <property name="int_array_property" type="Integer">
+ 1
+ 2
+ </property>
+ <factory-property name="int_array_property"
+ type="Integer">
+ 1
+ 2
+ </factory-property>
+
+ <property name="long_array_property" type="Long">
+ 1
+ 2
+ </property>
+ <factory-property name="long_array_property"
+ type="Long">
+ 1
+ 2
+ </factory-property>
+
+ <property name="double_array_property" type="Double">
+ 1.0
+ 2.0
+ </property>
+ <factory-property name="double_array_property"
+ type="Double">
+ 1.0
+ 2.0
+ </factory-property>
+
+ <property name="float_array_property" type="Float">
+ 1.0
+ 2.0
+ </property>
+ <factory-property name="float_array_property"
+ type="Float">
+ 1.0
+ 2.0
+ </factory-property>
+
+ <property name="short_array_property" type="Short">
+ 1
+ 2
+ </property>
+ <factory-property name="short_array_property"
+ type="Short">
+ 1
+ 2
+ </factory-property>
+
+ <property name="byte_array_property" type="Byte">
+ 126
+ 127
+ </property>
+ <factory-property name="byte_array_property"
+ type="Byte">
+ 126
+ 127
+ </factory-property>
+
+ <property name="boolean_array_property" type="Boolean">
+ true
+ false
+ </property>
+ <factory-property name="boolean_array_property"
+ type="Boolean">
+ true
+ false
+ </factory-property>
+
+ <factory-properties entry="factory_14.properties" />
+
+ <service>
+ <provide interface="components.service.14" />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference name="ref.name.1" interface="ref.service.1"
+ cardinality="0..1" policy="static" policy-option="greedy"
+ target="ref.target.1" bind="ref_bind_1" unbind="ref_unbind_1"
+ updated="updated_1" field="field1" field-option="replace"
+ scope="bundle" parameter="1" />
+
+ <reference name="ref.name.2" interface="ref.service.2"
+ cardinality="1..1" policy="static" policy-option="reluctant"
+ target="ref.target.2" bind="ref_bind_2" unbind="ref_unbind_2"
+ updated="updated_2" field="field2" field-option="replace"
+ scope="prototype" parameter="2" />
+
+ <reference name="ref.name.3" interface="ref.service.3"
+ cardinality="0..n" policy="dynamic" policy-option="greedy"
+ target="ref.target.3" bind="ref_bind_3" unbind="ref_unbind_3"
+ updated="updated_3" field="field3" field-option="replace"
+ field-collection-type="reference" scope="prototype_required"
+ parameter="3" />
+
+ <reference name="ref.name.4" interface="ref.service.4"
+ cardinality="1..n" policy="dynamic" policy-option="reluctant"
+ target="ref.target.4" bind="ref_bind_4" unbind="ref_unbind_4"
+ updated="updated_4" field="field4" field-option="update"
+ field-collection-type="properties" parameter="4" />
+ </scr:component>
+</components>
Added: felix/trunk/scr/src/test/resources/factory_14.properties
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/factory_14.properties?rev=1862493&view=auto
==============================================================================
--- felix/trunk/scr/src/test/resources/factory_14.properties (added)
+++ felix/trunk/scr/src/test/resources/factory_14.properties Wed Jul 3 16:36:07 2019
@@ -0,0 +1,19 @@
+# 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.
+#
+# Sample properties file for the metadate load test
+factory.property = Factory property