--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.3"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.autoui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Thu Sep 18 18:22:15 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
+org.eclipse.jdt.core.compiler.source=1.3
--- /dev/null
+#Thu Sep 18 18:28:43 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+filterResources=false
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+useMavenFolders=false
+version=1
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>argeo-slc</artifactId>
+ <version>0.10.3-SNAPSHOT</version>
+ <relativePath>../org.argeo.slc</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.autoui</artifactId>
+ <name>SLC Auto UI</name>
+ <packaging>bundle</packaging>
+ <description />
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.4.3</version>
+ <extensions>true</extensions>
+ <configuration>
+ <manifestLocation>META-INF</manifestLocation>
+ <instructions>
+ <Bundle-SymbolicName>
+ ${pom.artifactId}
+ </Bundle-SymbolicName>
+ <Bundle-Activator>
+ org.argeo.slc.autoui.AutoUiActivator
+ </Bundle-Activator>
+ <Export-Package>
+ org.argeo.slc.autoui.*
+ </Export-Package>
+ <Import-Package>
+ org.argeo.slc.jemmytest.ui.*;resolution=optional
+ </Import-Package>
+ <!--
+ <Export-Service>
+ org.argeo.slc.autoui.AutoUiApplication
+ </Export-Service> -->
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.3</source>
+ <target>1.1</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.argeo.dep.jemmy</groupId>
+ <artifactId>org.argeo.dep.jemmy.nb61</artifactId>
+ </dependency>
+
+ <!-- OSGi -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.main</artifactId>
+ </dependency> -->
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+package org.argeo.slc.autoui;
+
+import java.util.Properties;
+
+import org.argeo.slc.autoui.internal.AutoUiApplicationJemmy;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class AutoUiActivator implements BundleActivator {
+
+ public void start(BundleContext context) throws Exception {
+ stdOut("AutoUi started");
+ Properties properties = new Properties();
+ AutoUiApplicationJemmy applicationJemmy = new AutoUiApplicationJemmy();
+ context.registerService(AutoUiApplication.class.getName(),
+ applicationJemmy, properties);
+ context.registerService(Runnable.class.getName(), applicationJemmy,
+ properties);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ stdOut("AutoUi stopped");
+ }
+
+ public static void stdOut(Object obj) {
+ System.out.println(obj);
+ }
+}
--- /dev/null
+package org.argeo.slc.autoui;
+
+public interface AutoUiApplication extends Runnable{
+ public Object execute(Object object) throws Exception;
+}
--- /dev/null
+package org.argeo.slc.autoui.internal;
+
+import org.argeo.slc.autoui.AutoUiActivator;
+import org.argeo.slc.autoui.AutoUiApplication;
+import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.operators.JButtonOperator;
+import org.netbeans.jemmy.operators.JFrameOperator;
+import org.netbeans.jemmy.operators.JLabelOperator;
+
+public class AutoUiApplicationJemmy implements AutoUiApplication {
+ public void run() {
+ try {
+ execute(new Object());
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException("Could not execute as Runnable", e);
+ }
+ }
+
+ public Object execute(Object object) throws Exception {
+
+ String className = "org.argeo.slc.jemmytest.ui.SwingTestUi";
+ // String[] args = {};
+ // SwingTestUi.main(args);
+ // Start application
+ ClassReference classReference = new ClassReference(className);
+ String[] args = { "noExitOnClose" };
+ classReference.startApplication(args);
+
+ // Find components
+ JFrameOperator jFrameOperator = new JFrameOperator("HelloWorldSwing");
+ JButtonOperator jButtonOperator = new JButtonOperator(jFrameOperator,
+ "Button");
+ JLabelOperator jLabelOperator = new JLabelOperator(jFrameOperator,
+ "Hello World");
+
+ // Execute actions
+ jButtonOperator.push();
+
+ // Performs checks
+ String textAfterPush = jLabelOperator.getText();
+ AutoUiActivator.stdOut("textAfterPush=" + textAfterPush);
+
+ return null;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.autoui.swingtest.rmi;
+
+public interface AutoUiContext {
+ public Object getLocalRef(String key);
+
+ public void setLocalRef(String key, Object ref);
+}
--- /dev/null
+package org.argeo.slc.autoui.swingtest.rmi;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface AutoUiServer extends Remote {
+ public Object executeTask(AutoUiTask task) throws RemoteException;
+}
--- /dev/null
+package org.argeo.slc.autoui.swingtest.rmi;
+
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class AutoUiServerImpl extends UnicastRemoteObject implements
+ AutoUiServer, AutoUiContext {
+ private Map map = new TreeMap();
+
+ public AutoUiServerImpl() throws RemoteException {
+ super();
+ }
+
+ public Object executeTask(AutoUiTask task) throws RemoteException {
+ try {
+ return task.execute(this);
+ } catch (Exception e) {
+ throw new RemoteException("Coul not execute task.", e);
+ }
+ }
+
+ public Object getLocalRef(String key) {
+ return map.get(key);
+ }
+
+ public void setLocalRef(String key, Object ref) {
+ map.put(key, ref);
+ }
+
+ public static void main(String[] args) {
+ if (System.getSecurityManager() == null) {
+ System.setSecurityManager(new SecurityManager());
+ }
+ try {
+ String name = "AutoUiServer";
+ AutoUiServer engine = new AutoUiServerImpl();
+ // AutoUiServer stub = (AutoUiServer) UnicastRemoteObject
+ // .exportObject(engine, 0);
+ // Registry registry = LocateRegistry.getRegistry();
+ // registry.rebind(name, stub);
+ Naming.rebind(name, engine);
+ System.out.println("AutoUiServer bound");
+
+ } catch (Exception e) {
+ System.err.println("AutoUiServer exception:");
+ e.printStackTrace();
+ }
+
+ }
+}
--- /dev/null
+package org.argeo.slc.autoui.swingtest.rmi;
+
+import java.io.Serializable;
+
+public interface AutoUiTask extends Serializable {
+ public Object execute(AutoUiContext context) throws Exception;
+}