]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Integrate detached with standard SLC
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 2 Oct 2008 07:46:32 +0000 (07:46 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 2 Oct 2008 07:46:32 +0000 (07:46 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1676 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

sandbox/argeo.slc.testui/pom.xml
sandbox/argeo.slc.testui/src/main/java/org/argeo/slc/testui/SwingTestUi.java
sandbox/argeo.slc.testui/src/test/java/org/argeo/slc/jemmytest/JemmyRemoteTest.java [deleted file]

index 48edde70253d1fb7d93f91c11d33ff96c37340e3..40d00c243c503e1463535380f947945b44b4e73b 100644 (file)
                </plugins>
        </build>
        <dependencies>
-               <dependency>
-                       <groupId>org.argeo.slc</groupId>
-                       <artifactId>org.argeo.slc.autoui</artifactId>
-                       <version>0.11.1-SNAPSHOT</version>
-                       <scope>test</scope>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.apache.felix</groupId>
-                                       <artifactId>org.osgi.core</artifactId>
-                               </exclusion>
-                               <exclusion>
-                                       <groupId>org.apache.felix</groupId>
-                                       <artifactId>org.apache.felix.main</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
 
                <dependency>
                        <groupId>org.argeo.dep.jemmy</groupId>
index 4ff18c746edc6e802553bc028708870b08c52aff..c02891bb3506ea0d6ad729720d5ca14a30ca48b6 100644 (file)
@@ -25,7 +25,10 @@ public class SwingTestUi {
                frame.getContentPane().add(button);
                button.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
-                               label.setText("Pressed!!");
+                               if (label.getText().equals("Hello World"))
+                                       label.setText("Pressed!!");
+                               else
+                                       label.setText("Hello World");
                        }
                });
 
diff --git a/sandbox/argeo.slc.testui/src/test/java/org/argeo/slc/jemmytest/JemmyRemoteTest.java b/sandbox/argeo.slc.testui/src/test/java/org/argeo/slc/jemmytest/JemmyRemoteTest.java
deleted file mode 100644 (file)
index 19fa9c2..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.argeo.slc.jemmytest;
-
-import java.io.Serializable;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-import junit.framework.TestCase;
-
-import org.argeo.slc.autoui.rmi.AutoUiContext;
-import org.argeo.slc.autoui.rmi.AutoUiServer;
-import org.argeo.slc.autoui.rmi.AutoUiTask;
-import org.argeo.slc.testui.SwingTestUi;
-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 JemmyRemoteTest extends TestCase implements Serializable {
-       static final long serialVersionUID = 1l;
-
-       public void testRemote() throws Exception {
-                if (System.getSecurityManager() == null) {
-                       System.setSecurityManager(new SecurityManager());
-               }
-               String name = "AutoUiServer";
-               Registry registry = LocateRegistry.getRegistry("localhost");
-               AutoUiServer server = (AutoUiServer) registry.lookup(name);
-               AutoUiTask startFrame = new AutoUiTask() {
-                       static final long serialVersionUID = 1l;
-
-                       public Object execute(AutoUiContext context) throws Exception {
-                               // Start application
-                               ClassReference classReference = new ClassReference(
-                                               SwingTestUi.class.getName());
-                               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");
-
-                               context.setLocalRef("label", jLabelOperator);
-                               context.setLocalRef("button", jButtonOperator);
-                               return null;
-                       }
-
-               };
-
-               AutoUiTask pushButton = new AutoUiTask() {
-                       static final long serialVersionUID = 1l;
-
-                       public Object execute(AutoUiContext context) throws Exception {
-                               JButtonOperator jButtonOperator = (JButtonOperator) context
-                                               .getLocalRef("button");
-                               JLabelOperator jLabelOperator = (JLabelOperator) context
-                                               .getLocalRef("label");
-
-                               // Execute actions
-                               jButtonOperator.push();
-
-                               // Performs checks
-                               String textAfterPush = jLabelOperator.getText();
-                               Boolean pressed = new Boolean(textAfterPush.equals("Pressed!!"));
-                               return pressed;
-                       }
-
-               };
-
-               server.executeTask(startFrame);
-               Boolean pressed = (Boolean) server.executeTask(pushButton);
-               assertTrue("Has been pressed", pressed.booleanValue());
-       }
-
-       public static void main(String[] args){
-               try {
-                       JemmyRemoteTest jemmyRemoteTest = new JemmyRemoteTest();
-                       jemmyRemoteTest.testRemote();
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-       }
-}