Fix the issue Felix-637 about stack size error when a composite uses a long.
Update annotations to reflect changes about factory name computation (add the public_factory attribute).
Some cosmetic fixes too as well as tests on recent features.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@677545 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/tests.composite.service.instance/src/main/resources/metadata.xml b/ipojo/tests/tests.composite.service.instance/src/main/resources/metadata.xml
index dc1c764..4e383dc 100644
--- a/ipojo/tests/tests.composite.service.instance/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.composite.service.instance/src/main/resources/metadata.xml
@@ -42,7 +42,7 @@
</composite>
<!-- Instance of a specified component -->
- <composite name="composite.inst.1" factory="true" architecture="true">
+ <composite name="composite.inst.1" architecture="true">
<instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv" -->
<instance component="COMPO-FooProviderType-Dyn2">
<property name="boolean" value="true"/>
diff --git a/ipojo/tests/tests.composite/src/main/resources/metadata.xml b/ipojo/tests/tests.composite/src/main/resources/metadata.xml
index 49b8637..eecf974 100644
--- a/ipojo/tests/tests.composite/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.composite/src/main/resources/metadata.xml
@@ -2,7 +2,7 @@
<!-- Used component type -->
<component
className="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
- factory="COMPO-FooProviderType-1" architecture="true">
+ name="COMPO-FooProviderType-1" architecture="true">
<provides />
</component>
<component
@@ -31,7 +31,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn2"
- name="COMPO-FooProviderType-Dyn2" factory="true" architecture="true">
+ name="COMPO-FooProviderType-Dyn2" architecture="true">
<provides>
<property name="int" field="intProp" value="4" />
<property name="boolean" field="boolProp" />
@@ -43,24 +43,24 @@
</component>
<component
className="org.apache.felix.ipojo.test.composite.component.CheckServiceProvider"
- factory="COMPO-SimpleCheckServiceProvider" architecture="true">
+ name="COMPO-SimpleCheckServiceProvider" architecture="true">
<requires field="fs" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
- factory="COMPO-FooBarProviderType-1" architecture="true">
+ name="COMPO-FooBarProviderType-1" architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
- factory="COMPO-FooBarProviderType-2" architecture="true">
+ name="COMPO-FooBarProviderType-2" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.composite.service.FooService, org.apache.felix.ipojo.test.composite.service.BarService }" />
</component>
<component
className="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
- factory="COMPO-FooBarProviderType-3" architecture="true">
+ name="COMPO-FooBarProviderType-3" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.composite.service.FooService}">
<property name="baz" type="java.lang.String" value="foo" />
@@ -73,33 +73,33 @@
<component
className="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
- factory="BazProviderType" scope="composite">
+ name="BazProviderType" scope="composite">
<provides />
</component>
<component
classname="org.apache.felix.ipojo.test.composite.component.TataProvider"
- factory="tata">
+ name="tata">
<provides />
</component>
<component
classname="org.apache.felix.ipojo.test.composite.component.TotoProvider"
- factory="toto" architecture="true">
+ name="toto" architecture="true">
<provides />
</component>
<component
classname="org.apache.felix.ipojo.test.composite.component.TotoProviderGlue"
- factory="totoglue">
+ name="totoglue">
<requires field="m_toto" scope="composite" />
</component>
<!-- Composite -->
- <composite name="composite.empty" factory="true" architecture="true">
+ <composite name="composite.empty" architecture="true">
</composite>
- <component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" factory="Baz2CheckProvider" architecture="true">
+ <component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" name="Baz2CheckProvider" architecture="true">
<requires field="fs" scope="composite"/>
<provides/>
</component>
diff --git a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
index a6098ef..0283992 100644
--- a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
+++ b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
@@ -8,7 +8,7 @@
public void testArch() {
Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Factory");
- String fact = meta.getAttribute("factory");
+ String fact = meta.getAttribute("public");
String name = meta.getAttribute("name");
assertNotNull("Factory exists ", fact);
assertEquals("Factory value", "true", fact);
@@ -18,7 +18,7 @@
public void testNoArch() {
Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoFactory");
- String fact = meta.getAttribute("factory");
+ String fact = meta.getAttribute("public");
String name = meta.getAttribute("name");
assertNotNull("Factory exists ", fact);
assertEquals("Factory value", "false", fact);
diff --git a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java
index a0b6cda..bafde54 100644
--- a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java
+++ b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java
@@ -2,6 +2,6 @@
import org.apache.felix.ipojo.annotations.Component;
-@Component(name="factory", factory=true)
+@Component(name="factory", public_factory=true)
public class Factory {
}
diff --git a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java
index 9226a19..d8e15b2 100644
--- a/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java
+++ b/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java
@@ -2,6 +2,6 @@
import org.apache.felix.ipojo.annotations.Component;
-@Component(name="nofactory", factory=false)
+@Component(name="nofactory", public_factory=false)
public class NoFactory {
}
diff --git a/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
index 2a3cfa4..3421eee 100644
--- a/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
@@ -19,11 +19,14 @@
package org.apache.felix.ipojo.test.scenarios.bad;
import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.HandlerManagerFactory;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
public class BadFactories extends OSGiTestCase {
@@ -38,7 +41,7 @@
elem.addAttribute(new Attribute("name", "noclassname"));
return elem;
}
-
+
private Element getElementHandlerFactoryWithNoName() {
Element elem = new Element("handler", "");
elem.addAttribute(new Attribute("className", "noclassname"));
@@ -72,6 +75,54 @@
}
}
+ public void testCreationOnBadConstructor() {
+ Factory factory = Utils.getFactoryByName(context, "BAD-BadConstructor");
+ ComponentInstance ci;
+ try {
+ ci = factory.createComponentInstance(null);
+ assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+ ci.dispose();
+ } catch (Throwable e) {
+ fail("Exception unexpected : " + e.getMessage());
+ }
+ }
+
+ public void testCreationOnBadFactory() {
+ Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory");
+ ComponentInstance ci;
+ try {
+ ci = factory.createComponentInstance(null);
+ assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+ ci.dispose();
+ } catch (Throwable e) {
+ fail("Exception unexpected : " + e.getMessage());
+ }
+ }
+
+ public void testCreationOnBadFactory2() {
+ Factory factory = Utils.getFactoryByName(context, "BAD-BadFactory2");
+ ComponentInstance ci;
+ try {
+ ci = factory.createComponentInstance(null);
+ assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
+ ci.dispose();
+ } catch (Throwable e) {
+ fail("Exception unexpected : " + e.getMessage());
+ }
+ }
+
+ public void testNoManipulationMetadata() {
+ Element elem = new Element("component", "");
+ elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
+ try {
+ ComponentFactory fact = new ComponentFactory(context, elem);
+ fact.stop();
+ fail("A factory with no manipulation metadata must be rejected");
+ } catch (ConfigurationException e) {
+ // OK.
+ }
+ }
+
}
diff --git a/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java
new file mode 100644
index 0000000..74c6159
--- /dev/null
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java
@@ -0,0 +1,21 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+public class BadConstructors {
+
+ public BadConstructors() {
+ throw new Error("BAD");
+ }
+
+ public BadConstructors(int i) {
+ // DO NOTHING
+ }
+
+ public static BadConstructors createBad() {
+ throw new RuntimeException("BAD");
+ }
+
+ public static BadConstructors createBad2(int o) {
+ return new BadConstructors(o);
+ }
+
+}
diff --git a/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml b/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml
index 8222765..939215b 100644
--- a/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.bad.configurations/src/main/resources/metadata.xml
@@ -1,7 +1,7 @@
<ipojo>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- factory="BAD-CallbackCheckService" architecture="true">
+ name="BAD-CallbackCheckService" architecture="true">
<requires field="fs" />
<provides />
<callback transition="validate" method="start" />
@@ -20,7 +20,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="BAD-BothCheckServiceProvider" architecture="true">
+ name="BAD-BothCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -28,4 +28,24 @@
<provides />
</component>
+ <!-- Bad constructors -->
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
+ name="BAD-BadConstructor"
+ immediate="true"
+ />
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
+ factory-method="createBad"
+ name="BAD-BadFactory"
+ immediate="true"
+ />
+
+ <component
+ className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
+ factory-method="createBad2"
+ name="BAD-BadFactory2"
+ immediate="true"
+ />
</ipojo>
diff --git a/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml b/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml
index f7f012c..8447c8c 100644
--- a/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.configuration/src/main/resources/metadata.xml
@@ -1,7 +1,7 @@
<ipojo>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
- factory="CONFIG-FooProviderType-Conf" architecture="true">
+ name="CONFIG-FooProviderType-Conf" architecture="true">
<provides />
<properties propagation="false">
<property name="int" field="intProp" value="2" />
@@ -14,7 +14,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="CONFIG-FooProviderType-3" architecture="true">
+ name="CONFIG-FooProviderType-3" architecture="true">
<provides>
<property name="foo" field="m_foo" />
<property name="bar" field="m_bar" />
@@ -26,7 +26,7 @@
</properties>
</component>
<!-- Configuration Management Test -->
- <component factory="CONFIG-FieldConfigurableCheckService"
+ <component name="CONFIG-FieldConfigurableCheckService"
className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
architecture="true">
<provides />
@@ -52,7 +52,7 @@
</properties>
</component>
- <component factory="CONFIG-BothConfigurableCheckService"
+ <component name="CONFIG-BothConfigurableCheckService"
className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
architecture="true">
<provides />
@@ -78,7 +78,7 @@
</properties>
</component>
- <component factory="CONFIG-MethodConfigurableCheckService"
+ <component name="CONFIG-MethodConfigurableCheckService"
className="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
architecture="true">
<provides />
@@ -104,7 +104,7 @@
</properties>
</component>
- <component factory="CONFIG-ParentMethodConfigurableCheckService"
+ <component name="CONFIG-ParentMethodConfigurableCheckService"
className="org.apache.felix.ipojo.test.scenarios.component.ParentConfigurableCheckServiceProvider"
architecture="true">
<provides />
@@ -133,7 +133,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="CONFIG-FooProviderType-4" architecture="true">
+ name="CONFIG-FooProviderType-4" architecture="true">
<provides>
<property name="foo" field="m_foo" />
<property name="bar" field="m_bar" />
@@ -221,7 +221,5 @@
<property name="empty-list" type="list"/>
<property name="empty-map" type="map"/>
</instance>
-
-
</ipojo>
diff --git a/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
index 576125f..9491a34 100644
--- a/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.external.handlers/src/main/resources/metadata.xml
@@ -9,7 +9,7 @@
</handler>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="HANDLER-HandlerTester" architecture="true">
+ name="HANDLER-HandlerTester" architecture="true">
<cs:check />
</component>
<instance name="HandlerTest-2" component="HANDLER-HandlerTester">
diff --git a/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml b/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml
index 2d10ac8..c6abfe7 100644
--- a/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.factories/src/main/resources/metadata.xml
@@ -2,14 +2,14 @@
<!-- Simple provider -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Factories-FooProviderType-1" architecture="true">
+ name="Factories-FooProviderType-1" architecture="true">
<provides />
</component>
<!-- Provider providing 2 services -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="Factories-FooBarProviderType-1" architecture="true">
+ name="Factories-FooBarProviderType-1" architecture="true">
<provides />
</component>
@@ -42,7 +42,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
- name="Factories-FooProviderType-Dyn2" factory="true" architecture="true">
+ name="Factories-FooProviderType-Dyn2" architecture="true">
<provides>
<property name="int" field="intProp" value="4" />
<property name="boolean" field="boolProp" />
@@ -55,7 +55,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Factories-FooProviderType-3" architecture="true">
+ name="Factories-FooProviderType-3" architecture="true">
<provides>
<property name="foo" field="m_foo" />
<property name="bar" field="m_bar" />
diff --git a/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml b/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml
index c60c239..cddab70 100644
--- a/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.lifecycle.callback/src/main/resources/metadata.xml
@@ -1,14 +1,14 @@
<ipojo>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="LFCB-FooProviderType-1" architecture="true">
+ name="LFCB-FooProviderType-1" architecture="true">
<provides />
</component>
<!-- Lifecycle Callback -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- factory="LFCB-CallbackCheckService" architecture="true">
+ name="LFCB-CallbackCheckService" architecture="true">
<requires field="fs" />
<provides />
<callback transition="validate" method="start" />
@@ -16,7 +16,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- factory="LFCB-ParentCallbackCheckService" architecture="true">
+ name="LFCB-ParentCallbackCheckService" architecture="true">
<requires field="fs" />
<provides />
<callback transition="validate" method="parentStart" />
@@ -24,7 +24,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="LFCB-ImmediateCallbackCheckService"
+ immediate="true" name="LFCB-ImmediateCallbackCheckService"
architecture="true">
<requires field="fs" />
<provides />
@@ -33,7 +33,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="LFCB-ImmediateCallbackCheckServiceSingleton"
+ immediate="true" name="LFCB-ImmediateCallbackCheckServiceSingleton"
factory-method="singleton" architecture="true">
<requires field="fs" />
<provides />
@@ -42,7 +42,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
- immediate="true" factory="LFCB-ImmediateCallbackCheckServiceSeveral"
+ immediate="true" name="LFCB-ImmediateCallbackCheckServiceSeveral"
factory-method="several" architecture="true">
<requires field="fs" />
<provides />
diff --git a/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml b/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml
index 6d73ce8..f0a3063 100644
--- a/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.manipulation/src/main/resources/metadata.xml
@@ -2,14 +2,14 @@
<!-- Simple provider used for manipulation analysis -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-FooProviderType-1" architecture="true">
+ name="Manipulation-FooProviderType-1" architecture="true">
<provides />
</component>
<!-- Non lazzy service provider, to check instantiation -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-ImmediateFooProviderType" immediate="true"
+ name="Manipulation-ImmediateFooProviderType" immediate="true"
architecture="true">
<provides />
</component>
@@ -17,7 +17,7 @@
<!-- Provider providing 2 services -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="Manipulation-FooBarProviderType-1" architecture="true">
+ name="Manipulation-FooBarProviderType-1" architecture="true">
<provides />
</component>
@@ -38,20 +38,20 @@
<!-- Manipulation -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
- factory="Manipulation-PrimitiveManipulationTester" architecture="true">
+ name="Manipulation-PrimitiveManipulationTester" architecture="true">
<provides />
</component>
<!-- Manipulation with numbers -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.A123.Manipulation23Tester"
- factory="Manipulation-PrimitiveManipulationTesterA" architecture="true">
+ name="Manipulation-PrimitiveManipulationTesterA" architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="Manipulation-SimpleMultipleCheckServiceProvider" architecture="true">
+ name="Manipulation-SimpleMultipleCheckServiceProvider" architecture="true">
<requires field="fs" />
<provides />
</component>
@@ -59,35 +59,35 @@
<!-- Type checking different creation policy -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-FooProviderType-1-Sing" factory-method="singleton"
+ name="Manipulation-FooProviderType-1-Sing" factory-method="singleton"
architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-FooProviderType-1-Sev" factory-method="several"
+ name="Manipulation-FooProviderType-1-Sev" factory-method="several"
architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-FooProviderType-1-SingM" factory-method="singleton"
+ name="Manipulation-FooProviderType-1-SingM" factory-method="singleton"
architecture="true">
- <provides factory="method" />
+ <provides/>
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-FooProviderType-1-SevM" factory-method="several"
+ name="Manipulation-FooProviderType-1-SevM" factory-method="several"
architecture="true">
- <provides factory="method" />
+ <provides/>
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="Manipulation-ImmediateFooProviderTypeSingleton" immediate="true"
+ name="Manipulation-ImmediateFooProviderTypeSingleton" immediate="true"
factory-method="singleton" architecture="true">
<provides />
</component>
diff --git a/ipojo/tests/tests.core.service.dependency.bindingpolicy/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.dependency.bindingpolicy/src/main/resources/metadata.xml
index 5599af5..1a116b1 100644
--- a/ipojo/tests/tests.core.service.dependency.bindingpolicy/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.service.dependency.bindingpolicy/src/main/resources/metadata.xml
@@ -3,13 +3,13 @@
<!-- Static Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticSimpleCheckServiceProvider" architecture="true">
+ name="StaticSimpleCheckServiceProvider" architecture="true">
<requires field="fs" policy="static" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticVoidCheckServiceProvider" architecture="true">
+ name="StaticVoidCheckServiceProvider" architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="voidBind" />
<callback type="unbind" method="voidUnbind" />
@@ -18,7 +18,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticObjectCheckServiceProvider" architecture="true">
+ name="StaticObjectCheckServiceProvider" architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -27,7 +27,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticRefCheckServiceProvider" architecture="true">
+ name="StaticRefCheckServiceProvider" architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -36,7 +36,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticBothCheckServiceProvider" architecture="true">
+ name="StaticBothCheckServiceProvider" architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -45,7 +45,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMObjectCheckServiceProvider" architecture="true">
+ name="StaticMObjectCheckServiceProvider" architecture="true">
<requires policy="static">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -54,7 +54,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMRefCheckServiceProvider" architecture="true">
+ name="StaticMRefCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
policy="static">
@@ -65,7 +65,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMBothCheckServiceProvider" architecture="true">
+ name="StaticMBothCheckServiceProvider" architecture="true">
<requires policy="static">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -76,14 +76,14 @@
<!-- Static Simple & Optional Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticSimpleOptionalCheckServiceProvider"
+ name="StaticSimpleOptionalCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true" policy="static" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticVoidOptionalCheckServiceProvider"
+ name="StaticVoidOptionalCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true" policy="static">
<callback type="bind" method="voidBind" />
@@ -93,7 +93,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticObjectOptionalCheckServiceProvider"
+ name="StaticObjectOptionalCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true" policy="static">
<callback type="bind" method="objectBind" />
@@ -103,7 +103,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticRefOptionalCheckServiceProvider" architecture="true">
+ name="StaticRefOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -112,7 +112,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
- factory="StaticBothOptionalCheckServiceProvider"
+ name="StaticBothOptionalCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true" policy="static">
<callback type="bind" method="bothBind" />
@@ -122,7 +122,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMObjectOptionalCheckServiceProvider"
+ name="StaticMObjectOptionalCheckServiceProvider"
architecture="true">
<requires optional="true" policy="static">
<callback type="bind" method="objectBind" />
@@ -132,7 +132,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMRefOptionalCheckServiceProvider"
+ name="StaticMRefOptionalCheckServiceProvider"
architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
@@ -144,7 +144,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
- factory="StaticMBothOptionalCheckServiceProvider"
+ name="StaticMBothOptionalCheckServiceProvider"
architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
@@ -157,14 +157,14 @@
<!-- Static Multiple Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
- factory="StaticSimpleMultipleCheckServiceProvider"
+ name="StaticSimpleMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" policy="static" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
- factory="StaticVoidMultipleCheckServiceProvider"
+ name="StaticVoidMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="voidBind" />
@@ -174,7 +174,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
- factory="StaticObjectMultipleCheckServiceProvider"
+ name="StaticObjectMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="objectBind" />
@@ -184,7 +184,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
- factory="StaticRefMultipleCheckServiceProvider" architecture="true">
+ name="StaticRefMultipleCheckServiceProvider" architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -193,7 +193,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
- factory="StaticBothMultipleCheckServiceProvider"
+ name="StaticBothMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" policy="static">
<callback type="bind" method="bothBind" />
@@ -203,7 +203,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
- factory="StaticMObjectMultipleCheckServiceProvider"
+ name="StaticMObjectMultipleCheckServiceProvider"
architecture="true">
<requires aggregate="true" policy="static">
<callback type="bind" method="objectBind" />
@@ -213,7 +213,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
- factory="StaticMRefMultipleCheckServiceProvider"
+ name="StaticMRefMultipleCheckServiceProvider"
architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
@@ -225,7 +225,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
- factory="StaticMBothMultipleCheckServiceProvider"
+ name="StaticMBothMultipleCheckServiceProvider"
architecture="true">
<requires aggregate="true" policy="static">
<callback type="bind" method="bothBind" />
@@ -237,20 +237,20 @@
<!-- Dynamic-Priority -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority.RankedFooProviderType1"
- factory="RankedFooProviderType" architecture="true">
+ name="RankedFooProviderType" architecture="true">
<provides>
<property field="m_grade" name="service.ranking"/>
</provides>
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.DynCheckServiceProvider"
- factory="DPSimpleCheckServiceProvider" architecture="true">
+ name="DPSimpleCheckServiceProvider" architecture="true">
<requires field="fs" policy="dynamic-priority" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.DynCheckServiceProvider"
- factory="DPObjectCheckServiceProvider" architecture="true">
+ name="DPObjectCheckServiceProvider" architecture="true">
<requires field="fs" policy="dynamic-priority">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
diff --git a/ipojo/tests/tests.core.service.dependency.filter/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.dependency.filter/src/main/resources/metadata.xml
index f1a8254..5f96bdc 100644
--- a/ipojo/tests/tests.core.service.dependency.filter/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.service.dependency.filter/src/main/resources/metadata.xml
@@ -2,7 +2,7 @@
<!-- Simple Filter Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
- factory="SimpleFilterCheckServiceProvider" architecture="true">
+ name="SimpleFilterCheckServiceProvider" architecture="true">
<provides>
<property field="m_toto" name="toto" value="A" />
</provides>
@@ -10,7 +10,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
- factory="SimpleFilterCheckServiceSubscriber" architecture="true">
+ name="SimpleFilterCheckServiceSubscriber" architecture="true">
<requires field="m_foo" filter="(toto=B)" id="id1">
<callback type="bind" method="Bind" />
<callback type="unbind" method="Unbind" />
@@ -20,7 +20,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
- factory="SimpleFilterCheckServiceSubscriber2" architecture="true">
+ name="SimpleFilterCheckServiceSubscriber2" architecture="true">
<requires field="m_foo" id="id2">
<callback type="bind" method="Bind" />
<callback type="unbind" method="Unbind" />
@@ -31,7 +31,7 @@
<!-- Optional Simple Filter Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
- factory="OptionalSimpleFilterCheckServiceSubscriber"
+ name="OptionalSimpleFilterCheckServiceSubscriber"
architecture="true">
<requires field="m_foo" filter="(toto=B)" id="id1"
optional="true">
@@ -43,7 +43,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
- factory="OptionalSimpleFilterCheckServiceSubscriber2"
+ name="OptionalSimpleFilterCheckServiceSubscriber2"
architecture="true">
<requires field="m_foo" id="id2" optional="true">
<callback type="bind" method="Bind" />
@@ -55,7 +55,7 @@
<!-- Aggregate filter Dependencies-->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
- factory="MultipleFilterCheckServiceSubscriber" architecture="true">
+ name="MultipleFilterCheckServiceSubscriber" architecture="true">
<requires field="m_foo" filter="(toto=B)" id="id1">
<callback type="bind" method="Bind" />
<callback type="unbind" method="Unbind" />
@@ -65,7 +65,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
- factory="MultipleFilterCheckServiceSubscriber2" architecture="true">
+ name="MultipleFilterCheckServiceSubscriber2" architecture="true">
<requires field="m_foo" id="id2">
<callback type="bind" method="Bind" />
<callback type="unbind" method="Unbind" />
@@ -76,7 +76,7 @@
<!-- Optional Aggregate Filter Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
- factory="OptionalMultipleFilterCheckServiceSubscriber"
+ name="OptionalMultipleFilterCheckServiceSubscriber"
architecture="true">
<requires field="m_foo" filter="(toto=B)" id="id1"
optional="true">
@@ -88,7 +88,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
- factory="OptionalMultipleFilterCheckServiceSubscriber2"
+ name="OptionalMultipleFilterCheckServiceSubscriber2"
architecture="true">
<requires field="m_foo" id="id2" optional="true">
<callback type="bind" method="Bind" />
diff --git a/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
index 3660654..994afeb 100644
--- a/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.service.dependency/src/main/resources/metadata.xml
@@ -1,20 +1,20 @@
<ipojo>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="FooProviderType-1" architecture="true">
+ name="FooProviderType-1" architecture="true">
<provides />
</component>
<!-- Simple Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="SimpleCheckServiceProvider" architecture="true">
+ name="SimpleCheckServiceProvider" architecture="true">
<requires field="fs" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="VoidCheckServiceProvider" architecture="true">
+ name="VoidCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="voidBind" />
<callback type="unbind" method="voidUnbind" />
@@ -23,7 +23,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="ObjectCheckServiceProvider" architecture="true">
+ name="ObjectCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -32,7 +32,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="RefCheckServiceProvider" architecture="true">
+ name="RefCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -41,7 +41,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="BothCheckServiceProvider" architecture="true">
+ name="BothCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -50,7 +50,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DoubleCheckServiceProvider" architecture="true">
+ name="DoubleCheckServiceProvider" architecture="true">
<requires>
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -61,7 +61,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MObjectCheckServiceProvider" architecture="true">
+ name="MObjectCheckServiceProvider" architecture="true">
<requires>
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -70,7 +70,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MRefCheckServiceProvider" architecture="true">
+ name="MRefCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService">
<callback type="bind" method="refBind" />
@@ -80,7 +80,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MBothCheckServiceProvider" architecture="true">
+ name="MBothCheckServiceProvider" architecture="true">
<requires>
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -91,19 +91,19 @@
<!-- Simple & Optional Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="SimpleOptionalCheckServiceProvider" architecture="true">
+ name="SimpleOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
+ name="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" nullable="false" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="VoidOptionalCheckServiceProvider" architecture="true">
+ name="VoidOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="voidBind" />
<callback type="unbind" method="voidUnbind" />
@@ -112,7 +112,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
+ name="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" nullable="false">
<callback type="bind" method="voidBind" />
<callback type="unbind" method="voidUnbind" />
@@ -121,7 +121,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="ObjectOptionalCheckServiceProvider" architecture="true">
+ name="ObjectOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -130,7 +130,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
+ name="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" nullable="false">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -139,7 +139,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="RefOptionalCheckServiceProvider" architecture="true">
+ name="RefOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -148,7 +148,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="RefOptionalNoNullableCheckServiceProvider" architecture="true">
+ name="RefOptionalNoNullableCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" nullable="false">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -157,7 +157,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="BothOptionalCheckServiceProvider" architecture="true">
+ name="BothOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -166,7 +166,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="BothOptionalNoNullableCheckServiceProvider" architecture="true">
+ name="BothOptionalNoNullableCheckServiceProvider" architecture="true">
<requires field="fs" optional="true" nullable="false">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -176,7 +176,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MObjectOptionalCheckServiceProvider" architecture="true">
+ name="MObjectOptionalCheckServiceProvider" architecture="true">
<requires optional="true">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -185,7 +185,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MRefOptionalCheckServiceProvider" architecture="true">
+ name="MRefOptionalCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true">
@@ -196,7 +196,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="MBothOptionalCheckServiceProvider" architecture="true">
+ name="MBothOptionalCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true">
@@ -209,14 +209,14 @@
<!-- Simple & Optional Dependencies with default-implementation -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DISimpleOptionalCheckServiceProvider" architecture="true">
+ name="DISimpleOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DIVoidOptionalCheckServiceProvider" architecture="true">
+ name="DIVoidOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="voidBind" />
@@ -226,7 +226,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DIObjectOptionalCheckServiceProvider" architecture="true">
+ name="DIObjectOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="objectBind" />
@@ -236,7 +236,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DIRefOptionalCheckServiceProvider" architecture="true">
+ name="DIRefOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="refBind" />
@@ -246,7 +246,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
- factory="DIBothOptionalCheckServiceProvider" architecture="true">
+ name="DIBothOptionalCheckServiceProvider" architecture="true">
<requires field="fs" optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="bothBind" />
@@ -257,7 +257,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="DIMObjectOptionalCheckServiceProvider" architecture="true">
+ name="DIMObjectOptionalCheckServiceProvider" architecture="true">
<requires optional="true"
default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
<callback type="bind" method="objectBind" />
@@ -267,7 +267,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="DIMRefOptionalCheckServiceProvider" architecture="true">
+ name="DIMRefOptionalCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true"
@@ -279,7 +279,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
- factory="DIMBothOptionalCheckServiceProvider" architecture="true">
+ name="DIMBothOptionalCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
optional="true"
@@ -293,13 +293,13 @@
<!-- Multiple Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="SimpleMultipleCheckServiceProvider" architecture="true">
+ name="SimpleMultipleCheckServiceProvider" architecture="true">
<requires field="fs" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="VoidMultipleCheckServiceProvider" architecture="true">
+ name="VoidMultipleCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="voidBind" />
<callback type="unbind" method="voidUnbind" />
@@ -308,7 +308,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="ObjectMultipleCheckServiceProvider" architecture="true">
+ name="ObjectMultipleCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -317,7 +317,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="RefMultipleCheckServiceProvider" architecture="true">
+ name="RefMultipleCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="refBind" />
<callback type="unbind" method="refUnbind" />
@@ -326,7 +326,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="BothMultipleCheckServiceProvider" architecture="true">
+ name="BothMultipleCheckServiceProvider" architecture="true">
<requires field="fs">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -335,7 +335,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- factory="MObjectMultipleCheckServiceProvider" architecture="true">
+ name="MObjectMultipleCheckServiceProvider" architecture="true">
<requires aggregate="true">
<callback type="bind" method="objectBind" />
<callback type="unbind" method="objectUnbind" />
@@ -344,7 +344,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- factory="MRefMultipleCheckServiceProvider" architecture="true">
+ name="MRefMultipleCheckServiceProvider" architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
aggregate="true">
@@ -355,7 +355,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- factory="MBothMultipleCheckServiceProvider" architecture="true">
+ name="MBothMultipleCheckServiceProvider" architecture="true">
<requires aggregate="true">
<callback type="bind" method="bothBind" />
<callback type="unbind" method="bothUnbind" />
@@ -366,14 +366,14 @@
<!-- Multiple & Optional Dependencies -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="SimpleOptionalMultipleCheckServiceProvider"
+ name="SimpleOptionalMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true" />
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="VoidOptionalMultipleCheckServiceProvider"
+ name="VoidOptionalMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="voidBind" />
@@ -383,7 +383,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="ObjectOptionalMultipleCheckServiceProvider"
+ name="ObjectOptionalMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="objectBind" />
@@ -393,7 +393,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
- factory="RefOptionalMultipleCheckServiceProvider"
+ name="RefOptionalMultipleCheckServiceProvider"
architecture="true">
<requires field="fs" optional="true">
<callback type="bind" method="refBind" />
@@ -403,7 +403,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- factory="MObjectOptionalMultipleCheckServiceProvider"
+ name="MObjectOptionalMultipleCheckServiceProvider"
architecture="true">
<requires aggregate="true" optional="true">
<callback type="bind" method="objectBind" />
@@ -413,7 +413,7 @@
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
- factory="MRefOptionalMultipleCheckServiceProvider"
+ name="MRefOptionalMultipleCheckServiceProvider"
architecture="true">
<requires
interface="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
diff --git a/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml b/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml
index 3588872..fc2787f 100644
--- a/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml
+++ b/ipojo/tests/tests.core.service.providing/src/main/resources/metadata.xml
@@ -2,20 +2,20 @@
<!-- Simple provider -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="PS-FooProviderType-1" architecture="true">
+ name="PS-FooProviderType-1" architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="PS-FooProviderType-itf" architecture="true">
+ name="PS-FooProviderType-itf" architecture="true">
<provides
interface="org.apache.felix.ipojo.test.scenarios.ps.service.FooService" />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
- factory="PS-FooProviderType-3" architecture="true">
+ name="PS-FooProviderType-3" architecture="true">
<provides>
<property name="foo" field="m_foo" />
<property name="bar" field="m_bar" />
@@ -30,18 +30,18 @@
<!-- Providers providing 2 services -->
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="PS-FooBarProviderType-1" architecture="true">
+ name="PS-FooBarProviderType-1" architecture="true">
<provides />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="PS-FooBarProviderType-2" architecture="true">
+ name="PS-FooBarProviderType-2" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService, org.apache.felix.ipojo.test.scenarios.ps.service.BarService }" />
</component>
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
- factory="PS-FooBarProviderType-3" architecture="true">
+ name="PS-FooBarProviderType-3" architecture="true">
<provides
interface="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService}">
<property name="baz" type="java.lang.String" value="foo" />
@@ -82,7 +82,7 @@
<component
className="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
- name="PS-FooProviderType-Dyn2" factory="true" architecture="true">
+ name="PS-FooProviderType-Dyn2" architecture="true">
<provides>
<property name="int" field="intProp" value="4" />
<property name="boolean" field="boolProp" />
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
index a5b4540..fb96538 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
@@ -32,9 +32,11 @@
public boolean check() {
boolean result = true;
-
- for (int i = 0; fs != null && i < fs.length; i++) {
- result = result && fs[i].foo();
+ //Use a local variable to avoid to wait at each access.
+ FooService[] array = fs;
+ for (int i = 0; array != null && i < array.length; i++) {
+ result = result && array[i].foo();
+ System.out.println("Result : " + result);
}
return result;
}
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
index 1971efb..619becb 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
@@ -168,7 +168,7 @@
} catch(RuntimeException e) {
fail("A nullable was expected ...");
}
- assertTrue("Check nullable", res);
+ assertFalse("Check nullable", res);
dp.stop();
provider.stop();
@@ -184,7 +184,7 @@
String prov2 = "provider2";
ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
String un = "under-1";
- ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
assertNotNull("Check foo availability", ref_fs);
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
index 84c33ad..25e9635 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
@@ -184,7 +184,7 @@
String prov2 = "provider2";
ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
String un = "under-1";
- ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
assertNotNull("Check foo availability", ref_fs);
diff --git a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
index 31a2d56..a0b3eeb 100644
--- a/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
+++ b/ipojo/tests/tests.temporal.dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
@@ -168,7 +168,7 @@
} catch(RuntimeException e) {
fail("A nullable was expected ...");
}
- assertTrue("Check nullable", res);
+ assertFalse("Check nullable", res);
dp.stop();
provider.stop();
@@ -184,7 +184,7 @@
String prov2 = "provider2";
ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
String un = "under-1";
- ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProvider", un);
+ ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
assertNotNull("Check foo availability", ref_fs);
@@ -214,7 +214,7 @@
provider1.stop();
provider2.stop();
-
+
ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
assertNotNull("Check cs availability - 3", ref_cs);
cs = (CheckService) context.getService(ref_cs);