FELIX-924 configuration policy configurable
FELIX-925 activate and deactivate method names are configurable
FELIX-929 name attributes of component and reference elements are optional
FELIX-930 Add support for DS 1.1 XML schema and namespace
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@784693 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/resources/components_activate_10.xml b/scr/src/test/resources/components_activate_10.xml
new file mode 100644
index 0000000..2c754b5
--- /dev/null
+++ b/scr/src/test/resources/components_activate_10.xml
@@ -0,0 +1,26 @@
+<?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 name="components.activate.10"
+ activate="myactivate" deactivate="mydeactivate"
+ configuration-policy="ignore" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="components.activate.10" />
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/components_activate_11.xml b/scr/src/test/resources/components_activate_11.xml
new file mode 100644
index 0000000..b046ea6
--- /dev/null
+++ b/scr/src/test/resources/components_activate_11.xml
@@ -0,0 +1,26 @@
+<?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 name="components.activate.11"
+ activate="myactivate" deactivate="mydeactivate"
+ configuration-policy="ignore" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+ <implementation class="components.activate.11" />
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/components_all_elements_10.properties b/scr/src/test/resources/components_all_elements_10.properties
new file mode 100644
index 0000000..da7d322
--- /dev/null
+++ b/scr/src/test/resources/components_all_elements_10.properties
@@ -0,0 +1,20 @@
+# 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
+
+file.property = Property from File
\ No newline at end of file
diff --git a/scr/src/test/resources/components_all_elements_10.xml b/scr/src/test/resources/components_all_elements_10.xml
new file mode 100644
index 0000000..0587053
--- /dev/null
+++ b/scr/src/test/resources/components_all_elements_10.xml
@@ -0,0 +1,95 @@
+<?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.
+-->
+
+<!--
+
+ This file has a component descriptor with values for all elements
+ and attributes defined in the Declarative Services XML Schema for
+ the Declarative Services Specification 1.0.
+
+ The goal of this file is to test the XML parsing whether all elements
+ are read and stored in the metadata objects and fields. Semantic
+ correctness according to the specificiation is not tested.
+ -->
+
+<components>
+ <!--
+ component element with
+ * DS 1.0 namespace (sets the ds namespace code)
+ * DS 1.0 attributes
+ * DS 1.1 attributes (must be read)
+ -->
+ <scr:component
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"
+
+ enabled="true"
+ name="components.all.name"
+ factory="components.all.factory"
+ immediate="true"
+
+ activate="myactivate"
+ deactivate="mydeactivate"
+ configuration-policy="ignore"
+ >
+
+ <implementation class="components.all.impl" />
+
+ <property
+ name="prop"
+ value="1234"
+ type="Integer"
+ />
+
+ <properties
+ entry="components_all_elements_10.properties"
+ />
+
+ <service
+ servicefactory="true"
+ >
+ <provide
+ interface="components.all.service"
+ />
+ </service>
+
+ <!-- Basic reference testing reading -->
+ <reference
+ name="ref.name"
+ interface="ref.service"
+ cardinality="0..n"
+ policy="dynamic"
+ target="ref.target"
+ bind="ref_bind"
+ unbind="ref_unbind"
+ />
+
+ <!--
+ references testing the setting of secondary properties
+ isStatic, isMultiple and isOptional
+ -->
+ <reference name="ref.01" cardinality="0..1" />
+ <reference name="ref.11" cardinality="1..1" />
+ <reference name="ref.0n" cardinality="0..n" />
+ <reference name="ref.1n" cardinality="1..n" />
+ <reference name="ref.static" policy="static" />
+ <reference name="ref.dynamic" policy="dynamic" />
+
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/components_anonymous_10.xml b/scr/src/test/resources/components_anonymous_10.xml
new file mode 100644
index 0000000..0627e5a
--- /dev/null
+++ b/scr/src/test/resources/components_anonymous_10.xml
@@ -0,0 +1,24 @@
+<?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.0.0">
+ <scr:component enabled="true" immediate="true">
+ <implementation class="components.anonymous.10" />
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/components_anonymous_11.xml b/scr/src/test/resources/components_anonymous_11.xml
new file mode 100644
index 0000000..5254df9
--- /dev/null
+++ b/scr/src/test/resources/components_anonymous_11.xml
@@ -0,0 +1,24 @@
+<?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.1.0">
+ <scr:component enabled="true" immediate="true">
+ <implementation class="components.anonymous.11" />
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/reference_anonymous_10.xml b/scr/src/test/resources/reference_anonymous_10.xml
new file mode 100644
index 0000000..c1d68ea
--- /dev/null
+++ b/scr/src/test/resources/reference_anonymous_10.xml
@@ -0,0 +1,26 @@
+<?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.0.0">
+ <scr:component enabled="true" immediate="true"
+ name="reference.anonymous.10">
+ <implementation class="reference.anonymous.10" />
+ <reference interface="ref.anon" />
+ </scr:component>
+</components>
diff --git a/scr/src/test/resources/reference_anonymous_11.xml b/scr/src/test/resources/reference_anonymous_11.xml
new file mode 100644
index 0000000..11a5bf4
--- /dev/null
+++ b/scr/src/test/resources/reference_anonymous_11.xml
@@ -0,0 +1,26 @@
+<?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.1.0">
+ <scr:component enabled="true" immediate="true"
+ name="reference.anonymous.10">
+ <implementation class="reference.anonymous.10" />
+ <reference interface="ref.anon" />
+ </scr:component>
+</components>