]> git.argeo.org Git - gpl/argeo-slc.git/blob - JemmyTestActivator.java
f33855fbc32cec44c859989a39e0bd768e39a68c
[gpl/argeo-slc.git] / JemmyTestActivator.java
1 package org.argeo.slc.jemmytest;
2
3 import java.util.Properties;
4
5 import org.argeo.slc.autoui.AutoUiApplication;
6 import org.osgi.framework.BundleActivator;
7 import org.osgi.framework.BundleContext;
8 import org.osgi.framework.ServiceEvent;
9 import org.osgi.framework.ServiceListener;
10
11 public class JemmyTestActivator implements BundleActivator, ServiceListener {
12
13 public void start(BundleContext context) throws Exception {
14 stdOut("JemmyTest started");
15 Properties properties = new Properties();
16 AutoUiApplicationJemmy applicationJemmy = new AutoUiApplicationJemmy();
17 context.registerService(AutoUiApplication.class.getName(),
18 applicationJemmy, properties);
19 context.registerService(Runnable.class.getName(), applicationJemmy,
20 properties);
21
22 // ServiceReference ref = context
23 // .getServiceReference("org.argeo.slc.autoui.AutoUiApplication");
24 // Object service = context.getService(ref);
25 // // JemmyTestActivator.stdOut("service=" + service.getClass());
26 // AutoUiApplication app = (AutoUiApplication) service;
27 // app.execute(null);
28
29 }
30
31 public void stop(BundleContext context) throws Exception {
32 stdOut("JemmyTest stopped");
33 }
34
35 public void serviceChanged(ServiceEvent serviceEvent) {
36 stdOut("serviceEvent=" + serviceEvent);
37
38 }
39
40 public static void stdOut(Object obj) {
41 System.out.println(obj);
42 }
43
44 }