use of org.apache.felix.ipojo.Factory in project felix by apache.
the class TestSimpleExport method setUp.
@Before
public void setUp() {
fooProvider = ipojoHelper.getFactory("BazProviderType");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
p1.put("instance.name", "foo1");
Properties p2 = new Properties();
p2.put("instance.name", "foo2");
try {
foo1 = fooProvider.createComponentInstance(p1);
foo2 = fooProvider.createComponentInstance(p2);
} catch (Exception e) {
fail("Fail to create foos : " + e.getMessage());
}
foo1.stop();
foo2.stop();
Factory factory = ipojoHelper.getFactory("composite.export.1");
Properties props = new Properties();
props.put("instance.name", "export");
try {
export1 = factory.createComponentInstance(props);
} catch (Exception e) {
fail("Fail to instantiate exporter " + e.getMessage());
}
}
use of org.apache.felix.ipojo.Factory in project felix by apache.
the class TestDelayedMultipleImport method setUp.
@Before
public void setUp() {
Properties p = new Properties();
p.put("instance.name", "importer");
Factory compFact = ipojoHelper.getFactory("composite.requires.2");
try {
import2 = compFact.createComponentInstance(p);
} catch (Exception e) {
fail("Cannot instantiate the component : " + e.getMessage());
}
import2.stop();
fooProvider = ipojoHelper.getFactory("COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
p1.put("instance.name", "foo1");
Properties p2 = new Properties();
p2.put("instance.name", "foo2");
try {
foo1 = fooProvider.createComponentInstance(p1);
foo2 = fooProvider.createComponentInstance(p2);
} catch (Exception e) {
fail("Cannot instantiate foo providers : " + e.getMessage());
}
}
use of org.apache.felix.ipojo.Factory in project felix by apache.
the class TestDelayedOptionalMultipleImport method setUp.
@Before
public void setUp() {
Properties p = new Properties();
p.put("instance.name", "importer");
Factory compFact = ipojoHelper.getFactory("composite.requires.4");
try {
import4 = compFact.createComponentInstance(p);
} catch (Exception e) {
fail("Cannot instantiate the component : " + e.getMessage());
}
import4.stop();
fooProvider = ipojoHelper.getFactory("COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
p1.put("instance.name", "foo1");
Properties p2 = new Properties();
p2.put("instance.name", "foo2");
try {
foo1 = fooProvider.createComponentInstance(p1);
foo2 = fooProvider.createComponentInstance(p2);
} catch (Exception e) {
fail("Cannot instantiate foo providers : " + e.getMessage());
}
}
use of org.apache.felix.ipojo.Factory in project felix by apache.
the class TestDelayedSimpleImport method setUp.
@Before
public void setUp() {
Properties p = new Properties();
p.put("instance.name", "importer");
Factory compFact = ipojoHelper.getFactory("composite.requires.1");
try {
import1 = compFact.createComponentInstance(p);
} catch (Exception e) {
fail("Cannot instantiate the component : " + e.getMessage());
}
import1.stop();
fooProvider = ipojoHelper.getFactory("COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
Properties p1 = new Properties();
p1.put("instance.name", "foo1");
Properties p2 = new Properties();
p2.put("instance.name", "foo2");
try {
foo1 = fooProvider.createComponentInstance(p1);
foo2 = fooProvider.createComponentInstance(p2);
} catch (Exception e) {
fail("Cannot instantiate foo providers : " + e.getMessage());
}
}
use of org.apache.felix.ipojo.Factory in project felix by apache.
the class TestFilteredImport method setUp.
@Before
public void setUp() {
Properties p = new Properties();
p.put("instance.name", "importer");
Factory compFact = ipojoHelper.getFactory("composite.requires.5");
try {
import1 = compFact.createComponentInstance(p);
} catch (Exception e) {
fail("Cannot instantiate the component : " + e.getMessage());
}
import1.stop();
fooProvider = ipojoHelper.getFactory("COMPO-FooProviderType-1");
assertNotNull("Check fooProvider availability", fooProvider);
fooProvider2 = ipojoHelper.getFactory("COMPO-FooProviderType-2");
assertNotNull("Check fooProvider availability", fooProvider2);
Properties p1 = new Properties();
p1.put("instance.name", "foo1");
Properties p2 = new Properties();
p2.put("instance.name", "foo2");
try {
foo1 = fooProvider.createComponentInstance(p1);
foo2 = fooProvider2.createComponentInstance(p2);
} catch (Exception e) {
fail("Cannot instantiate foo providers : " + e.getMessage());
}
}
Aggregations