FELIX-1686 Record in the component metadata whether the activate/deactivate
method was declared or not to be able to decide whether the activate/deactivate
method must be present (if declared) or may be present (if not declared).
This allows failing the component activation if the declared method is missing.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@822285 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/resources/integration_test_activation_components.xml b/scr/src/test/resources/integration_test_activation_components.xml
new file mode 100644
index 0000000..00ccba9
--- /dev/null
+++ b/scr/src/test/resources/integration_test_activation_components.xml
@@ -0,0 +1,73 @@
+<?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">
+
+ <!--
+ 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
+ -->
+
+ <!-- no declaration of activate/deactivate methods -->
+ <scr:component name="ActivatorComponent.no.decl"
+ enabled="false">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ </scr:component>
+
+ <!-- wrong declaration of activate method -->
+ <scr:component name="ActivatorComponent.activate.missing"
+ enabled="false"
+ activate="nonExistingActivate">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ </scr:component>
+
+ <!-- wrong declaration of deactivate method -->
+ <scr:component name="ActivatorComponent.deactivate.missing"
+ enabled="false"
+ deactivate="nonExistingDeactivate">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ </scr:component>
+
+ <!-- correct declaration of activate and deactivate method -->
+ <scr:component name="ActivatorComponent.decl"
+ enabled="false"
+ activate="myActivate"
+ deactivate="myDeactivate">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ </scr:component>
+
+ <!-- correct declaration of activate and deactivate method, activate failure -->
+ <scr:component name="ActivatorComponent.activate.fail"
+ enabled="false"
+ activate="myActivate"
+ deactivate="myDeactivate">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ <property name="failActivate" value="true" />
+ </scr:component>
+
+ <!-- correct declaration of activate and deactivate method, deactivate failure -->
+ <scr:component name="ActivatorComponent.deactivate.fail"
+ enabled="false"
+ activate="myActivate"
+ deactivate="myDeactivate">
+ <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+ <property name="failDeactivate" value="true" />
+ </scr:component>
+</components>