You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2008/04/30 00:25:45 UTC
svn commit: r652169 [4/10] - in /felix/trunk/ipojo/tests: ./
tests.composite.service.import-export/
tests.composite.service.import-export/src/
tests.composite.service.import-export/src/main/
tests.composite.service.import-export/src/main/java/ tests.co...
Modified: felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java?rev=652169&r1=652168&r2=652169&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java (original)
+++ felix/trunk/ipojo/tests/tests.composite/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java Tue Apr 29 15:25:39 2008
@@ -21,13 +21,7 @@
import junit.framework.Test;
import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.composite.exporter.ExportTestSuite;
-import org.apache.felix.ipojo.test.composite.importer.ImportTestSuite;
import org.apache.felix.ipojo.test.composite.infrastructure.InfrastructureTestSuite;
-import org.apache.felix.ipojo.test.composite.instance.SimpleInstance;
-import org.apache.felix.ipojo.test.composite.instantiator.InstantiatorTestSuite;
-import org.apache.felix.ipojo.test.composite.provides.ProvidesTestSuite;
-import org.apache.felix.ipojo.test.composite.test.CompositeTest;
import org.osgi.framework.BundleContext;
public class CompositeTestSuite {
@@ -35,13 +29,6 @@
public static Test suite(BundleContext bc) {
OSGiTestSuite ots = new OSGiTestSuite("iPOJO Composites Test Suite", bc);
ots.addTest(InfrastructureTestSuite.suite(bc));
- ots.addTest(InstantiatorTestSuite.suite(bc));
- ots.addTest(ImportTestSuite.suite(bc));
- ots.addTest(ExportTestSuite.suite(bc));
- ots.addTestSuite(CompositeTest.class);
- ots.addTestSuite(SimpleInstance.class);
- ots.addTest(ProvidesTestSuite.suite(bc));
-
return ots;
}
Modified: felix/trunk/ipojo/tests/tests.composite/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.composite/src/main/resources/metadata.xml?rev=652169&r1=652168&r2=652169&view=diff
==============================================================================
--- felix/trunk/ipojo/tests/tests.composite/src/main/resources/metadata.xml (original)
+++ felix/trunk/ipojo/tests/tests.composite/src/main/resources/metadata.xml Tue Apr 29 15:25:39 2008
@@ -71,223 +71,37 @@
</provides>
</component>
- <!-- Composite -->
- <composite name="composite.empty" factory="true" architecture="true">
- </composite>
-
- <composite name="composite.bar.1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService"/>
- </composite>
-
- <composite name="composite.bar.2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" aggregate="true"/>
- </composite>
-
- <composite name="composite.bar.3" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" optional="true"/>
- </composite>
-
- <composite name="composite.bar.4" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" optional="true"/>
- </composite>
-
- <composite name="composite.bar.5-accept" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService">
- <property name="boolean" value="true"/>
- <property name="string" value="foo"/>
- <property name="strAprop" value="{foo, bar, baz}"/>
- <property name="int" value="5"/>
- </subservice>
- </composite>
-
- <composite name="composite.bar.5-refuse1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
- <property name="foo" value="bar"/>
- <property name="boolean" value="true"/>
- <property name="string" value="foo"/>
- <property name="strAprop" value="{foo, bar, baz}"/>
- <property name="int" value="5"/>
- </subservice>
- </composite>
-
- <composite name="composite.bar.5-refuse2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
- <property name="string" value="foo"/>
- <property name="strAprop" value="{foo, bar, baz}"/>
- </subservice>
- </composite>
-
- <composite name="composite.inst.1" factory="true" architecture="true">
- <instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv" -->
- <instance component="COMPO-FooProviderType-Dyn2">
- <property name="boolean" value="true"/>
- <property name="string" value="foo"/>
- <property name="strAProp" value="{a,b,c}"/>
- </instance>
- </composite>
-
- <composite name="composite.requires.1" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" scope="composite"/>
- </composite>
-
- <composite name="composite.requires.2" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" scope="composite"/>
- </composite>
-
- <composite name="composite.requires.3" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" optional="true" scope="composite"/>
- </composite>
-
- <composite name="composite.requires.4" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" optional="true" aggregate="true" scope="composite"/>
- </composite>
-
- <composite name="composite.requires.5" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.FooService" filter="(&(int=2)(long=40))" scope="composite"/>
- </composite>
-
- <component className="org.apache.felix.ipojo.test.composite.component.BazProviderType1" factory="BazProviderType" scope="composite">
- <provides/>
+ <component
+ className="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
+ factory="BazProviderType" scope="composite">
+ <provides />
</component>
- <composite name="composite.export.1" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
- </composite>
-
- <composite name="composite.export.2" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" optional="true"/>
- </composite>
-
- <composite name="composite.export.3" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite" aggregate="true" optional="true" filter="(!(instance.name=export))"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true"/>
- </composite>
-
- <composite name="composite.export.4" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true"/>
- </composite>
-
- <composite name="composite.export.5" architecture="true">
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" optional="true" filter="(!(instance.name=export))" scope="composite"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(instance.name=foo1)"/>
- </composite>
-
- <component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" factory="Baz2CheckProvider" architecture="true">
- <requires field="fs" scope="composite"/>
- <provides/>
+ <component
+ classname="org.apache.felix.ipojo.test.composite.component.TataProvider"
+ factory="tata">
+ <provides />
</component>
- <composite name="composite.test.3" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" aggregate="true" filter="(factory.name=BazProviderType)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
- </composite>
-
- <composite name="composite.test.2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.CheckService" filter="(factory.name=Baz2CheckProvider)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.CheckService"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.BazService" scope="composite"/>
- </composite>
-
- <composite name="composite.test.1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(factory.name=composite.test.3)" />
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.CheckService" filter="(factory.name=composite.test.2)"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.CheckService"/>
- </composite>
-
- <composite name="composite.instantiator" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BazService" filter="(factory.name=composite.test.3)"/>
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.BazService"/>
- <provides action="export" specification="org.apache.felix.ipojo.test.composite.service.FooService"/>
- </composite>
-
- <!-- Test composition provides -->
- <component classname="org.apache.felix.ipojo.test.composite.component.TataProvider" factory="tata">
- <provides/>
+ <component
+ classname="org.apache.felix.ipojo.test.composite.component.TotoProvider"
+ factory="toto" architecture="true">
+ <provides />
</component>
-
- <component classname="org.apache.felix.ipojo.test.composite.component.TotoProvider" factory="toto" architecture="true">
- <provides/>
- </component>
-
- <component classname="org.apache.felix.ipojo.test.composite.component.TotoProviderGlue" factory="totoglue">
- <requires field="m_toto" scope="composite"/>
- </component>
-
- <composite name="comp-0" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
- </composite>
-
- <composite name="comp-1" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
- <delegation method="tataInt" policy="One"/>
- <delegation method="toto1" policy="All"/>
- </provides>
- </composite>
- <composite name="comp-2" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate="true"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
- <delegation method="tataInt" policy="One"/>
- <delegation method="toto1" policy="All"/>
- </provides>
- </composite>
-
- <composite name="comp-3" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" optional="true"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
- </provides>
- </composite>
-
- <composite name="comp-4" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" optional="true"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
- <delegation method="tataInt" policy="One"/>
- <delegation method="toto1" policy="All"/>
- </provides>
- </composite>
-
- <composite name="comp-5" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
- <!-- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate ="true" optional="true"/> -->
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota">
- <delegation method="tataInt" policy="One"/>
- <delegation method="toto1" policy="All"/>
- </provides>
- </composite>
-
- <composite name="comp-6" architecture="true">
- <subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.Tata" aggregate="true"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto" aggregate="true" optional="true"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Toto">
- <delegation method="toto1" policy="All"/>
- </provides>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tata">
- <delegation method="tataInt" policy="One"/>
- </provides>
- </composite>
+ <component
+ classname="org.apache.felix.ipojo.test.composite.component.TotoProviderGlue"
+ factory="totoglue">
+ <requires field="m_toto" scope="composite" />
+ </component>
- <composite name="comp-7" architecture="true">
- <instance component="tata"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
+ <!-- Composite -->
+ <composite name="composite.empty" factory="true" architecture="true">
</composite>
- <composite name="comp-8" architecture="true">
- <instance component="tata"/>
- <instance component="totoglue"/>
- <subservice action="import" specification="org.apache.felix.ipojo.test.composite.service.Toto"/>
- <provides action="implement" specification="org.apache.felix.ipojo.test.composite.service.Tota"/>
- </composite>
+ <component className="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" factory="Baz2CheckProvider" architecture="true">
+ <requires field="fs" scope="composite"/>
+ <provides/>
+ </component>
</ipojo>
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/pom.xml?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/pom.xml (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/pom.xml Tue Apr 29 15:25:39 2008
@@ -0,0 +1,106 @@
+<!--
+ 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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging>
+ <name>iPOJO Annotations Test Suite</name>
+ <artifactId>tests.core.annotations</artifactId>
+ <groupId>ipojo.tests</groupId>
+ <version>0.7.6-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.metadata</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>ipojo.examples</groupId>
+ <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.annotations</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ </dependency>
+
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.4.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.apache.felix.ipojo.test.scenarios.annotations.service
+ </Export-Package>
+ <Bundle-SymbolicName>
+ ${pom.artifactId}
+ </Bundle-SymbolicName>
+ <Private-Package>
+ org.apache.felix.ipojo.test*
+ </Private-Package>
+ <Test-Suite>
+ org.apache.felix.ipojo.test.scenarios.annotations.AnnotationsTestSuite
+ </Test-Suite>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>0.7.6-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,78 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class AggregateDependency extends OSGiTestCase {
+
+ private Element[] deps ;
+
+ public void setUp() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
+ deps = meta.getElements("requires");
+ }
+
+
+ public void testCallbackBind() {
+ Element dep = getDependencyById(deps, "Bar");
+ String opt = dep.getAttribute("aggregate");
+ assertEquals("Check aggregate", "true", opt);
+ }
+
+ public void testCallbackUnbind() {
+ Element dep = getDependencyById(deps, "Baz");
+ String opt = dep.getAttribute("aggregate");
+ assertEquals("Check aggregate", "true", opt);
+ }
+
+ public void testBindOnly() {
+ Element dep = getDependencyById(deps, "bindonly");
+ String opt = dep.getAttribute("aggregate");
+ assertEquals("Check aggregate", "true", opt);
+ }
+
+ public void testUnbindOnly() {
+ Element dep = getDependencyById(deps, "unbindonly");
+ String opt = dep.getAttribute("aggregate");
+ assertEquals("Check aggregate", "true", opt);
+ }
+
+
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,47 @@
+/*
+ * 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.ipojo.test.scenarios.annotations;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
+import org.osgi.framework.BundleContext;
+
+public class AnnotationsTestSuite extends TestSuite {
+
+ public static Test suite(BundleContext bc) {
+ OSGiTestSuite ots = new OSGiTestSuite("Annotations Test Suite", bc);
+ ots.addTestSuite(ServiceProdiving.class);
+ ots.addTestSuite(LifecycleController.class);
+ ots.addTestSuite(LifecycleCallbacks.class);
+ ots.addTestSuite(Properties.class);
+ ots.addTestSuite(Architecture.class);
+ ots.addTestSuite(Factory.class);
+ ots.addTestSuite(Dependency.class);
+ ots.addTestSuite(OptionalDependency.class);
+ ots.addTestSuite(AggregateDependency.class);
+ ots.addTestSuite(PolicyDependency.class);
+ ots.addTestSuite(FilteredDependency.class);
+ ots.addTestSuite(RankedDependency.class);
+ return ots;
+ }
+
+}
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,26 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class Architecture extends OSGiTestCase {
+
+ public void testArch() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Arch");
+ String arch = meta.getAttribute("architecture");
+ assertNotNull("Architecture exists ", arch);
+ assertEquals("Architecture value", "true", arch);
+ }
+
+ public void testNoArch() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoArch");
+ String arch = meta.getAttribute("architecture");
+ assertNotNull("Architecture exists ", arch);
+ assertEquals("Architecture value", "false", arch);
+ }
+
+
+
+}
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,106 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class Dependency extends OSGiTestCase {
+
+ public void testDependencyDeclaration() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Dependency");
+ Element[] deps = meta.getElements("requires");
+
+ // Check fs
+ Element dep = getDependencyById(deps, "fs");
+ String field = dep.getAttribute("field");
+ String id = dep.getAttribute("id");
+ String bind = getBind(dep);
+ String unbind = getUnbind(dep);
+ assertNotNull("Check fs field", field);
+ assertEquals("Check fs field", "fs", field);
+ assertNull("Check fs bind", bind);
+ assertNull("Check fs unbind", unbind);
+ assertNull("Check fs id", id);
+
+ // Check bar
+ dep = getDependencyById(deps, "Bar");
+ field = dep.getAttribute("field");
+ id = dep.getAttribute("id");
+ bind = getBind(dep);
+ unbind = getUnbind(dep);
+ assertNull("Check bar field", field);
+ assertEquals("Check bar bind", "bindBar", bind);
+ assertEquals("Check bar unbind", "unbindBar", unbind);
+ assertEquals("Check bar id", "Bar", id);
+
+ // Check baz
+ dep = getDependencyById(deps, "Baz");
+ field = dep.getAttribute("field");
+ id = dep.getAttribute("id");
+ bind = getBind(dep);
+ unbind = getUnbind(dep);
+ assertNull("Check baz field", field);
+ assertEquals("Check baz bind", "bindBaz", bind);
+ assertEquals("Check baz unbind", "unbindBaz", unbind);
+ assertEquals("Check baz id", "Baz", id);
+
+ // Check fs2
+ dep = getDependencyById(deps, "fs2");
+ field = dep.getAttribute("field");
+ id = dep.getAttribute("id");
+ bind = getBind(dep);
+ unbind = getUnbind(dep);
+ assertNotNull("Check fs2 field", field);
+ assertEquals("Check fs2 field", "fs2", field);
+ assertEquals("Check fs2 bind", "bindFS2", bind);
+ assertEquals("Check fs2 unbind", "unbindFS2", unbind);
+
+ // Check fs2inv
+ dep = getDependencyById(deps, "fs2inv");
+ field = dep.getAttribute("field");
+ id = dep.getAttribute("id");
+ bind = getBind(dep);
+ unbind = getUnbind(dep);
+ assertNotNull("Check fs2inv field", field);
+ assertEquals("Check fs2 field", "fs2inv", field);
+ assertEquals("Check fs2 bind", "bindFS2Inv", bind);
+ assertEquals("Check fs2 unbind", "unbindFS2Inv", unbind);
+ assertEquals("Check fs2 id", "inv", id);
+ }
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,32 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class Factory extends OSGiTestCase {
+
+ public void testArch() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Factory");
+ String fact = meta.getAttribute("factory");
+ String name = meta.getAttribute("name");
+ assertNotNull("Factory exists ", fact);
+ assertEquals("Factory value", "true", fact);
+ assertNotNull("Name exists ", name);
+ assertEquals("Name value", "factory", name);
+ }
+
+ public void testNoArch() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoFactory");
+ String fact = meta.getAttribute("factory");
+ String name = meta.getAttribute("name");
+ assertNotNull("Factory exists ", fact);
+ assertEquals("Factory value", "false", fact);
+ assertNotNull("Name exists ", name);
+ assertEquals("Name value", "nofactory", name);
+ }
+
+
+
+}
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,89 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class FilteredDependency extends OSGiTestCase {
+
+ private Element[] deps ;
+
+ public void setUp() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
+ deps = meta.getElements("requires");
+ }
+
+ public void testField() {
+ Element dep = getDependencyById(deps, "fs");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+ public void testCallbackBind() {
+ Element dep = getDependencyById(deps, "Bar");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+ public void testCallbackUnbind() {
+ Element dep = getDependencyById(deps, "Baz");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+ public void testBoth() {
+ Element dep = getDependencyById(deps, "inv");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+ public void testBindOnly() {
+ Element dep = getDependencyById(deps, "bindonly");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+ public void testUnbindOnly() {
+ Element dep = getDependencyById(deps, "unbindonly");
+ String opt = dep.getAttribute("filter");
+ assertEquals("Check filter", "(foo=bar)", opt);
+ }
+
+
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,49 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class LifecycleCallbacks extends OSGiTestCase {
+
+ public void testCallbacks() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+ Element[] cbs = meta.getElements("callback");
+ assertNotNull("Callbacks exists ", cbs);
+ assertEquals("Callbacks count ", 2, cbs.length);
+
+ Element elem = getCallbackByMethodName(cbs, "start");
+ assertEquals("Check start method", "start", elem.getAttribute("method"));
+ assertEquals("Check start transition", "validate", elem.getAttribute("transition"));
+
+ elem = getCallbackByMethodName(cbs, "stop");
+ assertEquals("Check stop method", "stop", elem.getAttribute("method"));
+ assertEquals("Check stop transition", "invalidate", elem.getAttribute("transition"));
+ }
+
+ public void testImmediate() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Immediate");
+ assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
+ assertEquals("Immediate attribute value", "true", meta.getAttribute("immediate"));
+ }
+
+ public void testNoImmediate() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
+ assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
+ assertEquals("Immediate attribute value", "false", meta.getAttribute("immediate"));
+ }
+
+ private Element getCallbackByMethodName(Element[] cbs, String method) {
+ for (int i = 0; i < cbs.length; i++) {
+ String met = cbs[i].getAttribute("method");
+ if (met != null && met.equalsIgnoreCase(method)) {
+ return cbs[i];
+ }
+ }
+ fail("Cannot found the callback with the method " + method);
+ return null;
+ }
+
+
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,21 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class LifecycleController extends OSGiTestCase {
+
+ public void testLFC() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Lifecycle");
+ Element[] ctrls = meta.getElements("controller");
+ assertNotNull("Controller exists ", ctrls);
+ Element ctrl = ctrls[0];
+ assertNotNull("Field", ctrl.getAttribute("field"));
+ assertEquals("Field", "lfc", ctrl.getAttribute("field"));
+ }
+
+
+
+}
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,123 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class OptionalDependency extends OSGiTestCase {
+
+ private Element[] deps ;
+
+ public void setUp() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
+ deps = meta.getElements("requires");
+ }
+
+ public void testField() {
+ Element dep = getDependencyById(deps, "fs");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testFieldNoOptional() {
+ Element dep = getDependencyById(deps, "fs2");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "false", opt);
+ }
+
+ public void testCallbackBind() {
+ Element dep = getDependencyById(deps, "Bar");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testCallbackUnbind() {
+ Element dep = getDependencyById(deps, "Baz");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testBoth() {
+ Element dep = getDependencyById(deps, "inv");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testBindOnly() {
+ Element dep = getDependencyById(deps, "bindonly");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testUnbindOnly() {
+ Element dep = getDependencyById(deps, "unbindonly");
+ String opt = dep.getAttribute("optional");
+ assertEquals("Check optionality", "true", opt);
+ }
+
+ public void testNullable() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+ Element[] deps = meta.getElements("requires");
+ Element fs = getDependencyById(deps, "fs");
+ String nullable = fs.getAttribute("nullable");
+ assertNotNull("Check nullable", nullable);
+ assertEquals("Check nullable value", "true", nullable);
+ }
+
+ public void testNoNullable() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NullableDependency");
+ Element[] deps = meta.getElements("requires");
+ Element fs = getDependencyById(deps, "fs2");
+ String nullable = fs.getAttribute("nullable");
+ assertNotNull("Check nullable", nullable);
+ assertEquals("Check nullable value", "false", nullable);
+ }
+
+ public void testDefaultImplmentation() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.DefaultImplementationDependency");
+ Element[] deps = meta.getElements("requires");
+ Element fs = getDependencyById(deps, "fs");
+ String di = fs.getAttribute("default-implementation");
+ assertNotNull("Check DI", di);
+ assertEquals("Check DI value", ProvidesSimple.class.getName(), di);
+ }
+
+
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,95 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class PolicyDependency extends OSGiTestCase {
+
+ private Element[] deps ;
+
+ public void setUp() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
+ deps = meta.getElements("requires");
+ }
+
+ public void testField() {
+ Element dep = getDependencyById(deps, "fs");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+ public void testFieldDPpolicy() {
+ Element dep = getDependencyById(deps, "fs2");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "dynamic-priority", opt);
+ }
+
+ public void testCallbackBind() {
+ Element dep = getDependencyById(deps, "Bar");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+ public void testCallbackUnbind() {
+ Element dep = getDependencyById(deps, "Baz");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+ public void testBoth() {
+ Element dep = getDependencyById(deps, "inv");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+ public void testBindOnly() {
+ Element dep = getDependencyById(deps, "bindonly");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+ public void testUnbindOnly() {
+ Element dep = getDependencyById(deps, "unbindonly");
+ String opt = dep.getAttribute("policy");
+ assertEquals("Check policy", "static", opt);
+ }
+
+
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,131 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class Properties extends OSGiTestCase {
+
+ public void testProperties() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ Element[] props = prov.getElements("property");
+ assertEquals("Number of properties", props.length, 5);
+ //Foo
+ Element foo = getPropertyByName(props, "foo");
+ assertEquals("Check foo field", "m_foo", foo.getAttribute("field"));
+ assertEquals("Check foo name", "foo", foo.getAttribute("name"));
+ //Bar
+ Element bar = getPropertyByName(props, "bar");
+ assertEquals("Check bar field", "bar", bar.getAttribute("field"));
+ assertEquals("Check bar value", "4", bar.getAttribute("value"));
+ //Boo
+ Element boo = getPropertyByName(props, "boo");
+ assertEquals("Check boo field", "boo", boo.getAttribute("field"));
+ assertEquals("Check boo method", "setboo", boo.getAttribute("method"));
+ //Baa
+ Element baa = getPropertyByName(props, "baa");
+ assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));
+ assertEquals("Check baa name", "baa", baa.getAttribute("name"));
+ assertEquals("Check baa method", "setbaa", baa.getAttribute("method"));
+
+ //Bar
+ Element baz = getPropertyByName(props, "baz");
+ assertEquals("Check baz method", "setbaz", baz.getAttribute("method"));
+ assertEquals("Check baz name", "baz", baz.getAttribute("name"));
+ }
+
+ public void testAbsentPropagation() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("propagation");
+ assertNull("Propagation", att);
+ }
+
+ public void testPropagation() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Propagation");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("propagation");
+ assertNotNull("Propagation", att);
+ assertEquals("Propagation value", "true", att);
+ }
+
+ public void testNoPropagation() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.NoPropagation");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("propagation");
+ assertNotNull("Propagation", att);
+ assertEquals("Propagation value", "false", att);
+ }
+
+ public void testPID() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ManagedServicePID");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("pid");
+ assertNotNull("PID", att);
+ assertEquals("PID Value", "MyPID", att);
+ }
+
+ public void testAbsentPID() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.Properties");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("pid");
+ assertNull("PID", att);
+ }
+
+ public void testPropagationAndPID() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PropagationandPID");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("pid");
+ assertNotNull("PID", att);
+ assertEquals("PID Value", "MyPID", att);
+ att = prov.getAttribute("propagation");
+ assertNotNull("Propagation", att);
+ assertEquals("Propagation value", "true", att);
+ }
+
+ public void testPIDAndPropagation() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.PIDandPropagation");
+ Element[] provs = meta.getElements("properties");
+ assertNotNull("Properties exists ", provs);
+ Element prov = provs[0];
+ String att = prov.getAttribute("pid");
+ assertNotNull("PID", att);
+ assertEquals("PID Value", "MyPID", att);
+ att = prov.getAttribute("propagation");
+ assertNotNull("Propagation", att);
+ assertEquals("Propagation value", "true", att);
+ }
+
+ private Element getPropertyByName(Element[] props, String name) {
+ for (int i = 0; i < props.length; i++) {
+ String na = props[i].getAttribute("name");
+ String field = props[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return props[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return props[i];
+ }
+ }
+ fail("Property " + name + " not found");
+ return null;
+ }
+
+
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,90 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.test.scenarios.component.MyComparator;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class RankedDependency extends OSGiTestCase {
+
+ private Element[] deps ;
+
+ public void setUp() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
+ deps = meta.getElements("requires");
+ }
+
+ public void testField() {
+ Element dep = getDependencyById(deps, "fs");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+ public void testCallbackBind() {
+ Element dep = getDependencyById(deps, "Bar");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+ public void testCallbackUnbind() {
+ Element dep = getDependencyById(deps, "Baz");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+ public void testBoth() {
+ Element dep = getDependencyById(deps, "inv");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+ public void testBindOnly() {
+ Element dep = getDependencyById(deps, "bindonly");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+ public void testUnbindOnly() {
+ Element dep = getDependencyById(deps, "unbindonly");
+ String opt = dep.getAttribute("comparator");
+ assertEquals("Check comparator", MyComparator.class.getName(), opt);
+ }
+
+
+
+ private Element getDependencyById(Element[] deps, String name) {
+ for (int i = 0; i < deps.length; i++) {
+ String na = deps[i].getAttribute("id");
+ String field = deps[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return deps[i];
+ }
+ }
+ fail("Dependency " + name + " not found");
+ return null;
+ }
+
+ private String getBind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("bind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+ private String getUnbind(Element dep) {
+ Element[] elem = dep.getElements("callback");
+ for (int i = 0; elem != null && i < elem.length; i++) {
+ if (elem[i].getAttribute("type").equalsIgnoreCase("unbind")) {
+ return elem[i].getAttribute("method");
+ }
+ }
+ return null;
+ }
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,101 @@
+package org.apache.felix.ipojo.test.scenarios.annotations;
+
+import java.util.List;
+
+import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.ParseUtils;
+import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
+import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
+import org.apache.felix.ipojo.test.scenarios.util.Utils;
+
+public class ServiceProdiving extends OSGiTestCase {
+
+ public void testProvidesSimple() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
+ Element[] provs = meta.getElements("provides");
+ assertNotNull("Provides exists ", provs);
+ Element prov = provs[0];
+ }
+
+ public void testProvidesDouble() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
+ Element[] provs = meta.getElements("provides");
+ assertNotNull("Provides exists ", provs);
+ Element prov = provs[0];
+ }
+
+ public void testProvidesTriple() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesTriple");
+ Element[] provs = meta.getElements("provides");
+ assertNotNull("Provides exists ", provs);
+ Element prov = provs[0];
+ String itfs = prov.getAttribute("interface");
+ List list = ParseUtils.parseArraysAsList(itfs);
+ assertTrue("Provides CS ", list.contains(CheckService.class.getName()));
+ }
+
+ public void testProvidesQuatro() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesQuatro");
+ Element[] provs = meta.getElements("provides");
+ assertNotNull("Provides exists ", provs);
+ Element prov = provs[0];
+ String itfs = prov.getAttribute("interface");
+ List list = ParseUtils.parseArraysAsList(itfs);
+ assertTrue("Provides CS ", list.contains(CheckService.class.getName()));
+ assertTrue("Provides Foo ", list.contains(FooService.class.getName()));
+ }
+
+ public void testProperties() {
+ Element meta = Utils.getMetatadata(context, "org.apache.felix.ipojo.test.scenarios.component.ProvidesProperties");
+ Element[] provs = meta.getElements("provides");
+ assertNotNull("Provides exists ", provs);
+ Element prov = provs[0];
+ Element[] props = prov.getElements("property");
+ assertEquals("Number of properties", props.length, 5);
+ //Foo
+ Element foo = getPropertyByName(props, "foo");
+ assertEquals("Check foo field", "m_foo", foo.getAttribute("field"));
+ assertEquals("Check foo name", "foo", foo.getAttribute("name"));
+ //Bar
+ Element bar = getPropertyByName(props, "bar");
+ assertEquals("Check bar field", "bar", bar.getAttribute("field"));
+ assertEquals("Check bar value", "4", bar.getAttribute("value"));
+ //Boo
+ Element boo = getPropertyByName(props, "boo");
+ assertEquals("Check boo field", "boo", boo.getAttribute("field"));
+ assertEquals("Check boo method", "setboo", boo.getAttribute("method"));
+ //Baa
+ Element baa = getPropertyByName(props, "baa");
+ assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));
+ assertEquals("Check baa name", "baa", baa.getAttribute("name"));
+ assertEquals("Check baa method", "setbaa", baa.getAttribute("method"));
+
+ //Bar
+ Element baz = getPropertyByName(props, "baz");
+ assertEquals("Check baz field", "m_baz", baz.getAttribute("field"));
+ assertEquals("Check baz method", "setBaz", baz.getAttribute("method"));
+ assertEquals("Check baz name", "baz", baz.getAttribute("name"));
+
+
+
+ }
+
+ private Element getPropertyByName(Element[] props, String name) {
+ for (int i = 0; i < props.length; i++) {
+ String na = props[i].getAttribute("name");
+ String field = props[i].getAttribute("field");
+ if (na != null && na.equalsIgnoreCase(name)) {
+ return props[i];
+ }
+ if (field != null && field.equalsIgnoreCase(name)) {
+ return props[i];
+ }
+ }
+ fail("Property " + name + " not found");
+ return null;
+ }
+
+
+
+}
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,29 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+import java.util.Properties;
+
+public interface BarService {
+
+ public boolean bar();
+
+ public Properties getProps();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+import java.util.Properties;
+
+public interface CheckService {
+
+ public static final String foo = "foo";
+
+ public boolean check();
+
+ public Properties getProps();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,25 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+public interface ChildInterface extends ParentInterface1, ParentInterface2 {
+
+ public void processChild();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,39 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+import java.util.Properties;
+
+public interface FooService {
+
+ boolean foo();
+
+ Properties fooProps();
+
+ Boolean getObject();
+
+ boolean getBoolean();
+
+ int getInt();
+
+ long getLong();
+
+ double getDouble();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,25 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+public interface ParentInterface1 extends ParentParentInterface {
+
+ public void processParent1();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,25 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+public interface ParentInterface2 {
+
+ public void processParent2();
+
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,25 @@
+/*
+ * 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.ipojo.test.scenarios.annotations.service;
+
+public interface ParentParentInterface {
+
+ public void processParentParent();
+
+}
Propchange: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 29 15:25:39 2008
@@ -0,0 +1,9 @@
+target*
+bin*
+.settings*
+.classpath
+.project
+.checkstyle
+maven-eclipse.xml
+.externalToolBuilders
+
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,25 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import org.apache.felix.ipojo.annotations.Bind;
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Unbind;
+
+@Component
+public class AggregateDependency {
+
+ @Unbind(aggregate=true)
+ public void unbindBar() { }
+ @Bind
+ public void bindBar() { }
+
+ @Unbind
+ public void unbindBaz() { }
+ @Bind(aggregate=true)
+ public void bindBaz() { }
+
+ @Unbind(aggregate=true, id="unbindonly")
+ public void unbind() { }
+
+ @Bind(aggregate=true, id="bindonly")
+ public void bind() { }
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import org.apache.felix.ipojo.annotations.Component;
+
+@Component(architecture=true)
+public class Arch {
+}
Added: felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java?rev=652169&view=auto
==============================================================================
--- felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java (added)
+++ felix/trunk/ipojo/tests/tests.core.annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java Tue Apr 29 15:25:39 2008
@@ -0,0 +1,12 @@
+package org.apache.felix.ipojo.test.scenarios.component;
+
+import org.apache.felix.ipojo.annotations.Component;
+import org.apache.felix.ipojo.annotations.Requires;
+import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
+
+@Component
+public class DefaultImplementationDependency {
+
+ @Requires(defaultimplementation=ProvidesSimple.class, optional=true)
+ public FooService fs;
+}