use of org.apache.aries.subsystem.itests.hello.api.Hello in project aries by apache.
the class Activator method start.
@Override
public void start(BundleContext bc) throws Exception {
Hello helloService = new HelloImpl();
_sr = bc.registerService(Hello.class, helloService, null);
}
use of org.apache.aries.subsystem.itests.hello.api.Hello in project aries by apache.
the class Activator method start.
@Override
public void start(BundleContext bc) throws Exception {
System.out.println("into " + this.getClass().getCanonicalName() + ".start()");
Hello helloService = new DynamicImportHelloImpl();
_sr = bc.registerService(Hello.class, helloService, null);
System.out.println("exiting " + this.getClass().getCanonicalName() + ".start()");
}
use of org.apache.aries.subsystem.itests.hello.api.Hello in project aries by apache.
the class BlueprintTest method checkBlueprint.
@Test
public void checkBlueprint() throws Exception {
Subsystem subsystem = installSubsystemFromFile(BLUEPRINT_ESA);
try {
startSubsystem(subsystem);
BundleContext bc = subsystem.getBundleContext();
Hello h = new RichBundleContext(bc).getService(Hello.class);
String message = h.saySomething();
assertEquals("Wrong message back", "messageFromBlueprint", message);
} finally {
stopSubsystem(subsystem);
uninstallSubsystem(subsystem);
}
}
use of org.apache.aries.subsystem.itests.hello.api.Hello in project aries by apache.
the class HelloWorldTest method checkHelloSubsystem.
void checkHelloSubsystem(Subsystem helloSubsystem) throws Exception {
helloSubsystem.start();
BundleContext bc = helloSubsystem.getBundleContext();
Hello h = new RichBundleContext(bc).getService(Hello.class);
String message = h.saySomething();
assertEquals("Wrong message back", "something", message);
helloSubsystem.stop();
}
use of org.apache.aries.subsystem.itests.hello.api.Hello in project aries by apache.
the class DynamicImportTest method testFirstPassWeavingApproach.
@SuppressWarnings("rawtypes")
@Test
public void testFirstPassWeavingApproach() throws Exception {
ServiceRegistration<?> sr = bundleContext.registerService(WeavingHook.class, new TokenWeaver(), null);
try {
Subsystem subsystem = installSubsystemFromFile("dynamicImport.esa");
startSubsystem(subsystem);
BundleContext bc = subsystem.getBundleContext();
Hello h = new RichBundleContext(bc).getService(Hello.class);
String message = h.saySomething();
// DynamicImportHelloImpl.java
assertEquals("Wrong message back", "Hello, this is something", message);
stopSubsystem(subsystem);
uninstallSubsystem(subsystem);
} finally {
sr.unregister();
}
}
Aggregations