]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Introduce detached execution server.
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 27 Sep 2008 11:40:52 +0000 (11:40 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 27 Sep 2008 11:40:52 +0000 (11:40 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1645 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

21 files changed:
org.argeo.slc.autoui.launcher/src/main/java/org/argeo/slc/autoui/launcher/Main.java
org.argeo.slc.autoui.launcher/src/main/resources/org/argeo/slc/autoui/launcher/felix.properties
org.argeo.slc.autoui/pom.xml
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AbstractDetachedActivator.java
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedDriver.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedException.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedStepRequest.java
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/internal/DetachedExecutionServerImpl.java [new file with mode: 0644]
org.argeo.slc.autoui/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
org.argeo.slc.autoui/src/main/resources/META-INF/slc/conf/applicationContext.xml [new file with mode: 0644]
sandbox/argeo.slc.jemmytest/.classpath
sandbox/argeo.slc.jemmytest/pom.xml
sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/DummyStep.java
sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/jemmytest/JemmyTestActivator.java
sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/applicationContext.xml [new file with mode: 0644]
sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/common/import.xml [new file with mode: 0644]

index 0aa79afa327a5e8d77d9a9879964fc1a8ae065c5..73d628be38cd74762b9cdcc5a4b44ab896aca4a0 100644 (file)
@@ -10,15 +10,20 @@ import java.util.List;
 import java.util.Properties;
 import java.util.Vector;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.felix.framework.Felix;
 import org.apache.felix.framework.cache.BundleCache;
 import org.apache.felix.main.AutoActivator;
 import org.argeo.slc.autoui.AutoUiActivator;
+import org.argeo.slc.autoui.DetachedExecutionServer;
 import org.argeo.slc.autoui.DetachedStep;
+import org.argeo.slc.autoui.DetachedStepRequest;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
 public class Main {
+       private final static Log log = LogFactory.getLog(Main.class);
 
        public static void main(String[] args) {
                try {
@@ -34,7 +39,7 @@ public class Main {
                        // Automate
                        automateUi(felix.getBundleContext());
 
-                       felix.stop();
+                       // felix.stop();
                } catch (Exception e) {
                        e.printStackTrace();
                        System.exit(-1);
@@ -116,12 +121,14 @@ public class Main {
                        throws Exception {
                // Retrieve service and execute it
                ServiceReference ref = bundleContext
-                               .getServiceReference("org.argeo.slc.autoui.DetachedStep");
+                               .getServiceReference(DetachedExecutionServer.class.getName());
                Object service = bundleContext.getService(ref);
 
-               AutoUiActivator.stdOut("service.class=" + service.getClass());
-               DetachedStep app = (DetachedStep) service;
-               app.execute(null, null);
+               log.debug("service.class=" + service.getClass());
+               DetachedExecutionServer app = (DetachedExecutionServer) service;
+               DetachedStepRequest request = new DetachedStepRequest();
+               request.setStepRef("jemmyTest");
+               app.executeStep(request);
        }
 
        /* UTILITIES */
index d3b0220659b3fe4756b93baa1dd4521c5d31cedb..698b8712b18c87c65c8dd6fae2494ff14ffff71b 100644 (file)
@@ -15,6 +15,7 @@ org.osgi.framework.system.packages=org.osgi.framework; version=1.4.0, \
  org.osgi.util.tracker; version=1.3.3, \
  org.argeo.slc.autoui; version=0.10.3.SNAPSHOT, \
  org.argeo.slc.testui, \
+ org.apache.commons.logging, \
  org.springframework.beans.factory.support,\
  org.springframework.beans.factory.xml,\
  org.springframework.context,\
@@ -33,7 +34,8 @@ felix.auto.start.1= \
  ${argeo.slc.mavenBase}org/apache/felix/org.apache.felix.shell/1.0.2/org.apache.felix.shell-1.0.2.jar \
  ${argeo.slc.mavenBase}org/apache/felix/org.apache.felix.shell.tui/1.0.2/org.apache.felix.shell.tui-1.0.2.jar \
  ${argeo.slc.mavenBase}org/argeo/dep/jemmy/org.argeo.dep.jemmy.nb61/0.2.2/org.argeo.dep.jemmy.nb61-0.2.2.jar \
- ${argeo.slc.mavenBase}org/argeo/slc/sandbox/org.argeo.slc.sandbox.jemmytest/0.1.2-SNAPSHOT/org.argeo.slc.sandbox.jemmytest-0.1.2-SNAPSHOT.jar"
+ reference:file:/home/mbaudier/dev/src/slc/sandbox/argeo.slc.jemmytest/bin/
+# ${argeo.slc.mavenBase}org/argeo/slc/sandbox/org.argeo.slc.sandbox.jemmytest/0.1.2-SNAPSHOT/org.argeo.slc.sandbox.jemmytest-0.1.2-SNAPSHOT.jar"
 
 
 felix.log.level=1
index c47610cc36dd63d2784352c1e5cc372278252f22..85d7ed8caf000a21fb6924cfb6627ecc6eecf21f 100644 (file)
@@ -20,7 +20,7 @@
                                <version>1.4.3</version>
                                <extensions>true</extensions>
                                <configuration>
-                                       <manifestLocation>META-INF</manifestLocation>
+                                       <manifestLocation>src/main/resources/META-INF</manifestLocation>
                                        <instructions>
                                                <Bundle-SymbolicName>
                                                        ${pom.artifactId}
index 7f18d50a4d0c6c652432bddcc5c64a56459ee7af..b1fe56922695f39f6c55141a557cfa20b38fc665 100644 (file)
@@ -1,6 +1,7 @@
 package org.argeo.slc.autoui;
 
 import java.net.URL;
+import java.util.Properties;
 
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
@@ -12,11 +13,12 @@ import org.springframework.context.support.GenericApplicationContext;
 import org.springframework.core.io.UrlResource;
 
 public class AbstractDetachedActivator implements BundleActivator {
-       private AbstractApplicationContext applicationContext;
+       private SpringStaticRefProvider staticRefProvider;
 
        public final void start(BundleContext context) throws Exception {
                ClassLoader classLoader = getClass().getClassLoader();
 
+               // Creates application context
                Thread cur = Thread.currentThread();
                ClassLoader save = cur.getContextClassLoader();
                cur.setContextClassLoader(classLoader);
@@ -25,7 +27,7 @@ public class AbstractDetachedActivator implements BundleActivator {
                        // applicationContext = new ClassPathXmlApplicationContext(
                        // "/slc/conf/applicationContext.xml");
 
-                       applicationContext = new GenericApplicationContext();
+                       AbstractApplicationContext applicationContext = new GenericApplicationContext();
                        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
                                        (BeanDefinitionRegistry) applicationContext);
                        Bundle bundle = context.getBundle();
@@ -38,6 +40,14 @@ public class AbstractDetachedActivator implements BundleActivator {
                                xmlReader.loadBeanDefinitions(new UrlResource(url));
                        }
 
+                       // Register static ref provider
+                       staticRefProvider = new SpringStaticRefProvider(applicationContext);
+                       Properties properties = new Properties();
+                       properties.setProperty("slc.detached.bundle", bundle
+                                       .getSymbolicName());
+                       context.registerService(StaticRefProvider.class.getName(),
+                                       staticRefProvider, properties);
+
                } catch (Exception e) {
                        e.printStackTrace();
                        throw new Exception("Could not initialize application context");
@@ -56,8 +66,8 @@ public class AbstractDetachedActivator implements BundleActivator {
        public final void stop(BundleContext context) throws Exception {
                stopAutoBundle(context);
 
-               if (applicationContext != null) {
-                       applicationContext.close();
+               if (staticRefProvider != null) {
+                       staticRefProvider.close();
                }
 
        }
@@ -67,8 +77,7 @@ public class AbstractDetachedActivator implements BundleActivator {
 
        }
 
-       public Object getStaticRef(String id) {
-               return applicationContext.getBean(id);
+       protected StaticRefProvider getStaticRefProvider() {
+               return staticRefProvider;
        }
-
 }
index cc78b2911440ef35f0d76688a377a61179ad9186..b95d6b4b9d747826306fc84fe0fc7911c792b7fb 100644 (file)
@@ -1,19 +1,32 @@
 package org.argeo.slc.autoui;
 
-import org.osgi.framework.BundleActivator;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.autoui.internal.DetachedExecutionServerImpl;
 import org.osgi.framework.BundleContext;
 
-public class AutoUiActivator implements BundleActivator {
+public class AutoUiActivator extends AbstractDetachedActivator {
+       private final Log log = LogFactory.getLog(getClass());
 
-       public void start(BundleContext context) throws Exception {
-               stdOut("AutoUi started");
-       }
+       private DetachedExecutionServerImpl executionServer;
+
+       public void startAutoBundle(BundleContext context) throws Exception {
+               Object obj = getStaticRefProvider().getStaticRef("executionServer");
+               if (obj != null)
+                       executionServer = (DetachedExecutionServerImpl) obj;
+               else
+                       throw new DetachedException("Could not find execution server.");
+
+               executionServer.setBundleContext(context);
 
-       public void stop(BundleContext context) throws Exception {
-               stdOut("AutoUi stopped");
+               context.registerService(DetachedExecutionServer.class.getName(),
+                               executionServer, new Properties());
+               log.info("AutoUi started");
        }
 
-       public static void stdOut(Object obj) {
-               System.out.println(obj);
+       public void stopAutoBundle(BundleContext context) throws Exception {
+               log.info("AutoUi stopped");
        }
 }
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedDriver.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedDriver.java
new file mode 100644 (file)
index 0000000..dbfa3a3
--- /dev/null
@@ -0,0 +1,6 @@
+package org.argeo.slc.autoui;
+
+public interface DetachedDriver {
+       /** Blocks until it receives a request. */
+       public DetachedStepRequest receiveRequest();
+}
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedException.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedException.java
new file mode 100644 (file)
index 0000000..f6ba5d1
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.slc.autoui;
+
+public class DetachedException extends RuntimeException {
+       private Exception cause;
+
+       public DetachedException(String message) {
+               super(message);
+       }
+
+       public DetachedException(String message, Exception cause) {
+               super(message);
+               this.cause = cause;
+       }
+}
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java
new file mode 100644 (file)
index 0000000..637eab8
--- /dev/null
@@ -0,0 +1,5 @@
+package org.argeo.slc.autoui;
+
+public interface DetachedExecutionServer {
+       public DetachedStepAnswer executeStep(DetachedStepRequest request);
+}
index 9c61afc83c34b6dc29d13789adea9cd11f3fe2e7..25737496d66ac6515581cef86c7064502b7b7f23 100644 (file)
@@ -6,4 +6,28 @@ public class DetachedStepRequest {
        private Properties inputParameters;
        private String stepRef;
        private String path;
+
+       public Properties getInputParameters() {
+               return inputParameters;
+       }
+
+       public void setInputParameters(Properties inputParameters) {
+               this.inputParameters = inputParameters;
+       }
+
+       public String getStepRef() {
+               return stepRef;
+       }
+
+       public void setStepRef(String stepRef) {
+               this.stepRef = stepRef;
+       }
+
+       public String getPath() {
+               return path;
+       }
+
+       public void setPath(String path) {
+               this.path = path;
+       }
 }
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java
new file mode 100644 (file)
index 0000000..8fb757f
--- /dev/null
@@ -0,0 +1,26 @@
+package org.argeo.slc.autoui;
+
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class SpringStaticRefProvider implements StaticRefProvider {
+       private final ConfigurableApplicationContext applicationContext;
+
+       public SpringStaticRefProvider(
+                       ConfigurableApplicationContext applicationContext) {
+               this.applicationContext = applicationContext;
+       }
+
+       public Object getStaticRef(String id) {
+               try {
+                       return applicationContext.getBean(id);
+               } catch (NoSuchBeanDefinitionException e) {
+                       // silent
+                       return null;
+               }
+       }
+
+       public void close(){
+               applicationContext.close();
+       }
+}
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java
new file mode 100644 (file)
index 0000000..d0f2b07
--- /dev/null
@@ -0,0 +1,6 @@
+package org.argeo.slc.autoui;
+
+public interface StaticRefProvider {
+       /** Returns null if no such ref. */
+       public Object getStaticRef(String id);
+}
diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/internal/DetachedExecutionServerImpl.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/internal/DetachedExecutionServerImpl.java
new file mode 100644 (file)
index 0000000..2edf08e
--- /dev/null
@@ -0,0 +1,58 @@
+package org.argeo.slc.autoui.internal;
+
+import org.argeo.slc.autoui.DetachedContextImpl;
+import org.argeo.slc.autoui.DetachedException;
+import org.argeo.slc.autoui.DetachedExecutionServer;
+import org.argeo.slc.autoui.DetachedStep;
+import org.argeo.slc.autoui.DetachedStepAnswer;
+import org.argeo.slc.autoui.DetachedStepRequest;
+import org.argeo.slc.autoui.StaticRefProvider;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class DetachedExecutionServerImpl implements DetachedExecutionServer {
+       private final DetachedContextImpl detachedContext;
+
+       private BundleContext bundleContext;
+
+       public DetachedExecutionServerImpl() {
+               detachedContext = new DetachedContextImpl();
+       }
+
+       public DetachedStepAnswer executeStep(DetachedStepRequest request) {
+               try {
+                       DetachedStep step = null;
+
+                       // Find step
+                       ServiceReference[] refs = bundleContext.getAllServiceReferences(
+                                       StaticRefProvider.class.getName(), null);
+                       for (int i = 0; i < refs.length; i++) {
+                               StaticRefProvider provider = (StaticRefProvider) bundleContext
+                                               .getService(refs[i]);
+                               Object obj = provider.getStaticRef(request.getStepRef());
+                               if (obj != null) {
+                                       step = (DetachedStep) obj;
+                                       break;
+                               }
+                       }
+
+                       if (step == null)
+                               throw new DetachedException("Could not find step with ref "
+                                               + request.getStepRef());
+
+                       return step.execute(detachedContext, request);
+               } catch (DetachedException e) {
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       throw new DetachedException(
+                                       "Unexpected exception while executing request " + request,
+                                       e);
+               }
+       }
+
+       public void setBundleContext(BundleContext bundleContext) {
+               this.bundleContext = bundleContext;
+       }
+
+}
diff --git a/org.argeo.slc.autoui/src/main/resources/META-INF/MANIFEST.MF b/org.argeo.slc.autoui/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..0e594c4
--- /dev/null
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0\r
+Export-Package: org.argeo.slc.autoui.rmi,org.argeo.slc.autoui;uses:="o\r
+ rg.springframework.beans.factory.support,org.apache.commons.logging,o\r
+ rg.springframework.context.support,org.springframework.core.io,org.os\r
+ gi.framework,org.springframework.beans.factory.xml,org.springframewor\r
+ k.context,org.springframework.beans.factory",org.argeo.slc.autoui.int\r
+ ernal;uses:="org.argeo.slc.autoui"\r
+Built-By: mbaudier\r
+Tool: Bnd-0.0.255\r
+Bundle-Name: SLC Auto UI\r
+Created-By: Apache Maven Bundle Plugin\r
+Bundle-Vendor: Argeo\r
+Build-Jdk: 1.6.0_0\r
+Bundle-Version: 0.11.1.SNAPSHOT\r
+Bnd-LastModified: 1222511849722\r
+Bundle-ManifestVersion: 2\r
+Bundle-Activator: org.argeo.slc.autoui.AutoUiActivator\r
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+Import-Package: org.apache.commons.logging,org.argeo.slc.autoui,org.ar\r
+ geo.slc.autoui.internal,org.argeo.slc.autoui.rmi,org.osgi.framework;v\r
+ ersion="1.4",org.springframework.beans.factory,org.springframework.be\r
+ ans.factory.support,org.springframework.beans.factory.xml,org.springf\r
+ ramework.context,org.springframework.context.support,org.springframew\r
+ ork.core.io\r
+Bundle-SymbolicName: org.argeo.slc.autoui\r
+Bundle-DocURL: http://www.argeo.org\r
+Originally-Created-By: Apache Maven Bundle Plugin\r
+\r
diff --git a/org.argeo.slc.autoui/src/main/resources/META-INF/slc/conf/applicationContext.xml b/org.argeo.slc.autoui/src/main/resources/META-INF/slc/conf/applicationContext.xml
new file mode 100644 (file)
index 0000000..a2f3e13
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+       <bean id="executionServer"
+               class="org.argeo.slc.autoui.internal.DetachedExecutionServerImpl">
+       </bean>
+
+</beans>
\ No newline at end of file
index c3624f87cec710f92cfac0f17204466abf8b1bbf..1aa73cdbf084050c2f4611c2f74041009d5307dc 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src/main/resources"/>
        <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
        <classpathentry kind="output" path="bin"/>
index 1f41d1b8df2d531368830c018157828cb4539a18..a78a89d8b260ba0714ffd8845328d0c53183d0e7 100644 (file)
@@ -7,7 +7,7 @@
        <name>SLC Sandbox JemmyTest</name>
        <version>0.1.2-SNAPSHOT</version>
        <packaging>bundle</packaging>
-       <build>
+       <build><!--
                <resources>
                        <resource>
                                <directory>src/main/slc</directory>
@@ -16,7 +16,7 @@
                                        <include>**/*</include>
                                </includes>
                        </resource>
-               </resources>
+               </resources>-->
                <plugins>
                        <plugin>
                                <groupId>org.apache.felix</groupId>
@@ -24,7 +24,7 @@
                                <version>1.4.3</version>
                                <extensions>true</extensions>
                                <configuration>
-                                       <manifestLocation>META-INF</manifestLocation>
+                                       <manifestLocation>src/main/resources/META-INF</manifestLocation>
                                        <instructions>
                                                <Bundle-SymbolicName>
                                                        ${pom.artifactId}
index d06661f7f371d3df05f183d66f2e2e336a88850b..6213dd2a4ea04700185624c771fdb0d50465999c 100644 (file)
@@ -1,5 +1,7 @@
 package org.argeo.slc.jemmytest;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.argeo.slc.autoui.AutoUiActivator;
 import org.argeo.slc.autoui.DetachedContext;
 import org.argeo.slc.autoui.DetachedStep;
@@ -10,6 +12,8 @@ import org.netbeans.jemmy.operators.JFrameOperator;
 import org.netbeans.jemmy.operators.JLabelOperator;
 
 public class DummyStep implements DetachedStep {
+       private final static Log log = LogFactory.getLog(DummyStep.class);
+
        public DetachedStepAnswer execute(DetachedContext detachedContext,
                        DetachedStepRequest detachedStepRequest) {
 
@@ -25,7 +29,7 @@ public class DummyStep implements DetachedStep {
 
                // Performs checks
                String textAfterPush = jLabelOperator.getText();
-               AutoUiActivator.stdOut("textAfterPush=" + textAfterPush);
+               log.info("textAfterPush=" + textAfterPush);
 
                return null;
        }
index a67dc5ab2a82e7ebf730addeba8e40c937723697..cfadbd5bc978f32b0af818502858ca4a867fd55d 100644 (file)
@@ -2,25 +2,24 @@ package org.argeo.slc.jemmytest;
 
 import java.util.Properties;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.argeo.slc.autoui.AbstractDetachedActivator;
 import org.argeo.slc.autoui.DetachedStep;
 import org.osgi.framework.BundleContext;
 
 public class JemmyTestActivator extends AbstractDetachedActivator {
+       private final Log log = LogFactory.getLog(getClass());
+       
        protected void startAutoBundle(BundleContext context) throws Exception {
-               Properties properties = new Properties();
-               DummyStep applicationJemmy = (DummyStep) getStaticRef("jemmyTest");
-               context.registerService(DetachedStep.class.getName(),
-                               applicationJemmy, properties);
-               stdOut("JemmyTest started");
+//             Properties properties = new Properties();
+//             DummyStep applicationJemmy = (DummyStep) getStaticRef("jemmyTest");
+//             context.registerService(DetachedStep.class.getName(),
+//                             applicationJemmy, properties);
+               log.info("JemmyTest started");
        }
 
        public void stopAutoBundle(BundleContext context) throws Exception {
-               stdOut("JemmyTest stopped");
+               log.info("JemmyTest stopped");
        }
-
-       public static void stdOut(Object obj) {
-               System.out.println(obj);
-       }
-
 }
diff --git a/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/MANIFEST.MF b/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..8624b41
--- /dev/null
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0\r
+Build-Jdk: 1.5.0\r
+Bnd-LastModified: 1222510300891\r
+Bundle-Name: SLC Sandbox JemmyTest\r
+Originally-Created-By: Apache Maven Bundle Plugin\r
+Bundle-SymbolicName: org.argeo.slc.sandbox.jemmytest\r
+Bundle-ManifestVersion: 2\r
+Bundle-Activator: org.argeo.slc.jemmytest.JemmyTestActivator\r
+Tool: Bnd-0.0.255\r
+Created-By: Apache Maven Bundle Plugin\r
+Bundle-Version: 0.1.2.SNAPSHOT\r
+Built-By: mbaudier\r
+Import-Package: org.apache.commons.logging,org.argeo.slc.autoui,org.arge\r
+ o.slc.jemmytest,org.netbeans.jemmy.operators,org.osgi.framework;version\r
+ ="1.4",org.springframework.beans.factory.xml\r
+Export-Package: org.argeo.slc.jemmytest;uses:="org.argeo.slc.autoui,org.\r
+ osgi.framework,org.netbeans.jemmy.operators,org.apache.commons.logging"\r
+\r
diff --git a/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/applicationContext.xml b/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/applicationContext.xml
new file mode 100644 (file)
index 0000000..aaa91ce
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+       <import resource="common/import.xml"/>
+
+       <bean id="jemmyTest"
+               class="org.argeo.slc.jemmytest.DummyStep">
+       </bean>
+
+</beans>
\ No newline at end of file
diff --git a/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/common/import.xml b/sandbox/argeo.slc.jemmytest/src/main/resources/META-INF/slc/conf/common/import.xml
new file mode 100644 (file)
index 0000000..b895c21
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+       <bean id="jemmyTest2"
+               class="org.argeo.slc.jemmytest.DummyStep">
+       </bean>
+
+</beans>
\ No newline at end of file