Author: clement
Date: Mon Jul 28 10:25:48 2008
New Revision: 680412
URL: http://svn.apache.org/viewvc?rev=680412&view=rev
Log:
Add tests on super constructor arguments.
Added:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
Modified:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/resources/metadata.xml
Added:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
URL:
http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java?rev=680412&view=auto
==============================================================================
---
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
(added)
+++
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
Mon Jul 28 10:25:48 2008
@@ -0,0 +1,10 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+public class CallSuperConstructor extends ParentClass {
+
+ public CallSuperConstructor() {
+ super("test");
+ System.out.println("plop");
+ }
+
+}
Added:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
URL:
http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java?rev=680412&view=auto
==============================================================================
---
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
(added)
+++
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
Mon Jul 28 10:25:48 2008
@@ -0,0 +1,11 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+public class ParentClass {
+
+ private String name;
+
+ public ParentClass(final String n) {
+ name = n;
+ }
+
+}
Modified:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
URL:
http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java?rev=680412&r1=680411&r2=680412&view=diff
==============================================================================
---
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
(original)
+++
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
Mon Jul 28 10:25:48 2008
@@ -21,6 +21,7 @@
import java.util.Properties;
import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.architecture.Architecture;
import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
@@ -292,6 +293,16 @@
assertEquals("Check context", context, props.get("context"));
}
+ public void testSuperCall() {
+ try {
+ Factory fact = Utils.getFactoryByName(context,
"org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructor");
+ ComponentInstance ci = fact.createComponentInstance(null);
+ ci.dispose();
+ } catch (Throwable e) {
+ fail(e.getMessage());
+ }
+ }
+
}
\ No newline at end of file
Modified:
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/resources/metadata.xml
URL:
http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/manipulation/src/main/resources/metadata.xml?rev=680412&r1=680411&r2=680412&view=diff
==============================================================================
---
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/resources/metadata.xml
(original)
+++
felix/trunk/ipojo/tests/manipulator/manipulation/src/main/resources/metadata.xml
Mon Jul 28 10:25:48 2008
@@ -91,4 +91,7 @@
factory-method="singleton" architecture="true">
<provides />
</component>
+
+ <!-- Try calling super constructors -->
+ <component
className="org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructor"
immediate="true"/>
</ipojo>