geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yunfen...@apache.org
Subject svn commit: r685852 - in /geronimo/devtools/eclipse-plugin/trunk: ./ testsuite/launcher/ testsuite/plugins/org.apache.geronimo.testsuite.common/ testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/ testsuite/plugins/org.apache.geronimo.test...
Date Thu, 14 Aug 2008 11:11:30 GMT
Author: yunfengma
Date: Thu Aug 14 04:11:26 2008
New Revision: 685852

URL: http://svn.apache.org/viewvc?rev=685852&view=rev
Log:
GERONIMODEVTOOLS-480  Support Web application test using the embeded browser in testsuite

Added:
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/AssertUtil.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
Modified:
    geronimo/devtools/eclipse-plugin/trunk/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/testsuite/launcher/testsuite.properties
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/.classpath
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/.classpath
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/Activator.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/ui/NewServerTest.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/resources/ui-tutorial/index.jsp
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/.classpath
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/Activator.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/ui/NewServerTest.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/resources/ui-tutorial/index.jsp

Modified: geronimo/devtools/eclipse-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/pom.xml?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/pom.xml Thu Aug 14 04:11:26 2008
@@ -208,6 +208,24 @@
                 <artifactId>abbot.swt.eclipse</artifactId>
                 <version>0.1.0.20080305_1254</version>
             </dependency>
+             
+            <dependency>
+                <groupId>org.openqa.selenium.client-drivers</groupId>
+                <artifactId>selenium-java-client-driver</artifactId>
+                <version>1.0-beta-1</version>
+            </dependency>
+            
+            <dependency>
+                <groupId>org.openqa.selenium.server</groupId>
+                <artifactId>selenium-server</artifactId>
+                <version>1.0-beta-1</version>
+            </dependency>
+             
+            <dependency>
+                <groupId>org.openqa.selenium.core</groupId>
+                <artifactId>selenium-core</artifactId>
+                <version>1.0-beta-1</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
                         
@@ -394,6 +412,38 @@
                 <enabled>true</enabled>
             </releases>
         </repository>
+
+        <!--
+         |
+         | Added for Selenium artifacts (and is the same repo used by the server)
+         |
+         -->
+        <repository>
+            <id>releases.openqa.org</id>
+            <name>Openqa Release Repository</name>
+            <url>http://archiva.openqa.org/repository/releases</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+        <repository>
+            <id>snapshots.openqa.org</id>
+            <name>Openqa Snapshot Repository</name>
+            <url>http://archiva.openqa.org/repository/snapshots</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+        </repository>
     </repositories>
                         
     <pluginRepositories>

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/launcher/testsuite.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/launcher/testsuite.properties?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/launcher/testsuite.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/launcher/testsuite.properties Thu Aug
14 04:11:26 2008
@@ -16,6 +16,6 @@
 #
 # @version $Rev$ $Date$
 #
-org.apache.geronimo.devtools.helloworld=org.apache.geronimo.devtools.helloworld-2.1.2
 org.apache.geronimo.testsuite.v21=org.apache.geronimo.testsuite.v21-2.1.2
 org.apache.geronimo.testsuite.v20=org.apache.geronimo.testsuite.v20-2.1.2
+org.apache.geronimo.testsuite.common=org.apache.geronimo.testsuite.common-2.1.2

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/.classpath?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/.classpath
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/.classpath
Thu Aug 14 04:11:26 2008
@@ -1,7 +1,10 @@
 <?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"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="var" path="M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-beta-1/selenium-java-client-driver-1.0-beta-1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/openqa/selenium/server/selenium-server-coreless/1.0-beta-1/selenium-server-coreless-1.0-beta-1.jar"/>
+	<classpathentry kind="var" path="M2_REPO/org/openqa/selenium/core/selenium-core/1.0-beta-1/selenium-core-1.0-beta-1.jar"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/MANIFEST.MF?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/META-INF/MANIFEST.MF
Thu Aug 14 04:11:26 2008
@@ -23,6 +23,11 @@
  org.eclipse.ui.forms,
  org.eclipse.ui.ide,
  org.eclipse.ui.views
-Eclipse-LazyStart: true
-Export-Package: org.apache.geronimo.testsuite.common.ui
+Bundle-ActivationPolicy: lazy
+Export-Package: com.thoughtworks.selenium,
+ org.apache.geronimo.testsuite.common,
+ org.apache.geronimo.testsuite.common.selenium,
+ org.apache.geronimo.testsuite.common.ui
 Import-Package: junit.framework;version="3.8.2"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-LazyStart: true

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/pom.xml?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/pom.xml
Thu Aug 14 04:11:26 2008
@@ -52,6 +52,7 @@
                     <include>NOTICE</include>
                 </includes>
             </resource>
+
         </resources>
 
         <plugins>
@@ -75,6 +76,22 @@
                 <artifactId>maven-antrun-plugin</artifactId>
                 <executions>
                     <execution>
+                        <id>unzip-common</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <unzip src="${settings.localRepository}/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-beta-1/selenium-java-client-driver-1.0-beta-1.jar"
+                                      dest="${project.build.directory}/classes"/>
+                                <unzip src="${settings.localRepository}/org/openqa/selenium/server/selenium-server/1.0-beta-1/selenium-server-1.0-beta-1-standalone.jar"
+                                      dest="${project.build.directory}/classes"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>unzip-selenium</id>
                         <phase>package</phase>
                         <goals>
                             <goal>run</goal>
@@ -158,6 +175,21 @@
             <groupId>abbot</groupId>
             <artifactId>abbot.swt.eclipse</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.openqa.selenium.client-drivers</groupId>
+            <artifactId>selenium-java-client-driver</artifactId>
+        </dependency>
+            
+        <dependency>
+            <groupId>org.openqa.selenium.server</groupId>
+            <artifactId>selenium-server</artifactId>
+        </dependency>
+         
+        <dependency>
+            <groupId>org.openqa.selenium.core</groupId>
+            <artifactId>selenium-core</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

Added: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/AssertUtil.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/AssertUtil.java?rev=685852&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/AssertUtil.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/AssertUtil.java
Thu Aug 14 04:11:26 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.common;
+
+/**
+ * AssertUtil
+ *
+ * @version $Rev$ $Date$
+ */
+public class AssertUtil {
+
+	public static void assertTrue( boolean value ) throws Exception {
+		if ( !value ) {
+			throw new Exception( "Error" );
+		}
+	}
+}

Added: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java?rev=685852&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
Thu Aug 14 04:11:26 2008
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geronimo.testsuite.common.selenium;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintStream;
+
+import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.widgets.Shell;
+import org.openqa.selenium.server.SeleniumServer;
+import org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory;
+
+/**
+ * EclipseSeleniumServer
+ *
+ * @version $Rev$ $Date$
+ */
+public class EclipseSeleniumServer implements ISafeRunnable{
+
+	public static EclipseSeleniumServer INSTANCE;
+	private SeleniumServer server;
+	private AbbotHelper aHelper;
+	private Shell shell;
+	
+	public EclipseSeleniumServer( AbbotHelper aHelper, Shell shell ) {
+		this.aHelper = aHelper;
+		this.shell = shell;
+		INSTANCE = this;
+	}
+	
+	public void stop() {
+		server.stop();
+	}
+	
+	public AbbotHelper getAHelper() {
+		return aHelper;
+	}
+
+	public Shell getShell() {
+		return shell;
+	}
+
+	public void handleException(Throwable arg0) {
+
+	}
+
+	public void run() throws Exception {
+		BrowserLauncherFactory.addBrowserLauncher("EclipseBrowser", EclipseBrowserLauncher.class);
+		SeleniumServer.setDebugMode( true );
+		server = new SeleniumServer();
+		server.start();
+	}
+
+}

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/Tutorial5Minute.java
Thu Aug 14 04:11:26 2008
@@ -19,6 +19,8 @@
 
 import java.io.FileInputStream;
 
+import org.apache.geronimo.testsuite.common.AssertUtil;
+import org.apache.geronimo.testsuite.common.selenium.EclipseSelenium;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -166,23 +168,21 @@
                 new String[] {"&File", "&Close"});
     }
 
-    public void webTesting () throws MultipleFoundException, NotFoundException {
-        aHelper.clickMenuItem (workbenchShell,
-                new String[] {"&Window", "Web Browser", "&0 Internal Web Browser"});
-        Shell openShell = aHelper.clickMenuItem (workbenchShell,
-                new String[] {"&Window", "Show &View", "&Other..."}, "Show View");
-        aHelper.clickTreeItem (openShell, 
-                new String[] {"General", "Internal Web Browser"});
-        aHelper.clickButton (openShell, IDialogConstants.OK_LABEL);
-
-        aHelper.setCombo (workbenchShell, "http://localhost:8080/SampleWAR/");
-        aHelper.clickToolItem (workbenchShell, "Go to the selected URL");
-        aHelper.waitTime (15000);
+
+    public void webTesting () throws Exception {
+    	EclipseSelenium selenium = new EclipseSelenium();
+        selenium.start();
+   		selenium.open( "http://localhost:8080/SampleWAR/");
+   		selenium.type("name", "Tom");
+	   	selenium.click("submit");
+   		selenium.waitForPageToLoad( "3000" );
+	   	AssertUtil.assertTrue(selenium.getHtmlSource().indexOf( "says hello to" ) > 0);
 
         // TODO fill in a name and click the Process button
         // This is a problem, HTML objects are not the same as SWT objects and 
         // Abbot cannot find these
         //aHelper.setTextField(workbenchShell, "", "MyName");
         //aHelper.clickButton (workbenchShell, "Press me!");
+   		selenium.stop();
     }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/.classpath?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/.classpath
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/.classpath
Thu Aug 14 04:11:26 2008
@@ -2,6 +2,7 @@
 <classpath>
 	<classpathentry kind="src" path="src/main/java"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> 
+	<classpathentry kind="var" path="M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-beta-1/selenium-java-client-driver-1.0-beta-1.jar"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/Activator.java?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/Activator.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/Activator.java
Thu Aug 14 04:11:26 2008
@@ -17,10 +17,16 @@
 
 package org.apache.geronimo.testsuite.v20;
 
+import org.apache.geronimo.testsuite.common.selenium.EclipseSeleniumServer;
+import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.widgets.Shell;
 import org.osgi.framework.BundleContext;
 
+import abbot.swt.eclipse.utils.WorkbenchUtilities;
+
 /**
  * The activator class controls the plug-in life cycle
  *
@@ -34,6 +40,8 @@
 	// The shared instance
 	private static Activator plugin;
 
+	private EclipseSeleniumServer seleniumServer;
+	
 	/**
 	 * The constructor
 	 */
@@ -48,6 +56,16 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
+	    Shell workbenchShell = WorkbenchUtilities.getWorkbenchWindow().getShell();
+	    AbbotHelper aHelper = new AbbotHelper (workbenchShell);
+    	seleniumServer = new EclipseSeleniumServer(aHelper, workbenchShell);
+		try {
+			SafeRunner.run( seleniumServer );
+			Thread.sleep(5000);
+//			new Exception("sdsfsdf").printStackTrace();
+		} catch ( Exception e ) {
+			e.printStackTrace();
+		}
 	}
 
 	/*
@@ -58,6 +76,7 @@
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
 		super.stop(context);
+		seleniumServer.stop();
 	}
 
 	/**

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/ui/NewServerTest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/ui/NewServerTest.java?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/ui/NewServerTest.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/java/org/apache/geronimo/testsuite/v20/ui/NewServerTest.java
Thu Aug 14 04:11:26 2008
@@ -17,6 +17,7 @@
 
 package org.apache.geronimo.testsuite.v20.ui;
 
+import org.apache.geronimo.testsuite.common.selenium.EclipseSelenium;
 import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
 import org.apache.geronimo.testsuite.common.ui.Constants;
 import org.apache.geronimo.testsuite.common.ui.ServerTasks;
@@ -63,10 +64,21 @@
             serverTasks.createServer();
 
             serverTasks.startServer();
+            
+            EclipseSelenium selenium = new EclipseSelenium();
+        	selenium.start();
+            
+            selenium.open( "http://localhost:8080/console/" );
+            selenium.waitForPageToLoad( "2000" );
+            selenium.type("j_username", "system");
+            selenium.type("j_password", "manager");
+            selenium.click("submit");
+            
             serverTasks.stopServer();
 
             // remove the server 
             serverTasks.removeServer();
+            selenium.stop();
 
             success = true;
         }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/resources/ui-tutorial/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/resources/ui-tutorial/index.jsp?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/resources/ui-tutorial/index.jsp
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v20/src/main/resources/ui-tutorial/index.jsp
Thu Aug 14 04:11:26 2008
@@ -26,7 +26,7 @@
   </head>
   <body>
     <form action="${pageContext.request.contextPath}/sayHello">
-      <input type="text" name="name" /><input type="submit" value="Press me!" />
+      <input type="text" name="name" /><input type="submit" name="submit" value="Press
me!" />
     </form>
   </body>
 </html>

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/.classpath?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/.classpath
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/.classpath
Thu Aug 14 04:11:26 2008
@@ -3,5 +3,6 @@
 	<classpathentry kind="src" path="src/main/java"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="var" path="M2_REPO/org/openqa/selenium/client-drivers/selenium-java-client-driver/1.0-beta-1/selenium-java-client-driver-1.0-beta-1.jar"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/Activator.java?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/Activator.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/Activator.java
Thu Aug 14 04:11:26 2008
@@ -17,10 +17,16 @@
 
 package org.apache.geronimo.testsuite.v21;
 
+import org.apache.geronimo.testsuite.common.selenium.EclipseSeleniumServer;
+import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.widgets.Shell;
 import org.osgi.framework.BundleContext;
 
+import abbot.swt.eclipse.utils.WorkbenchUtilities;
+
 /**
  * The activator class controls the plug-in life cycle
  *
@@ -34,6 +40,7 @@
 	// The shared instance
 	private static Activator plugin;
 
+	private EclipseSeleniumServer seleniumServer;
 	/**
 	 * The constructor
 	 */
@@ -48,6 +55,16 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
+	    Shell workbenchShell = WorkbenchUtilities.getWorkbenchWindow().getShell();
+	    AbbotHelper aHelper = new AbbotHelper (workbenchShell);
+    	seleniumServer = new EclipseSeleniumServer(aHelper, workbenchShell);
+		try {
+			SafeRunner.run( seleniumServer );
+			Thread.sleep(5000);
+//			new Exception("sdsfsdf").printStackTrace();
+		} catch ( Exception e ) {
+			e.printStackTrace();
+		}
 	}
 
 	/*
@@ -58,6 +75,7 @@
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
 		super.stop(context);
+		seleniumServer.stop();
 	}
 
 	/**

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/ui/NewServerTest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/ui/NewServerTest.java?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/ui/NewServerTest.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/java/org/apache/geronimo/testsuite/v21/ui/NewServerTest.java
Thu Aug 14 04:11:26 2008
@@ -17,23 +17,19 @@
 
 package org.apache.geronimo.testsuite.v21.ui;
 
-import java.io.File;
-
+import org.apache.geronimo.testsuite.common.selenium.EclipseSelenium;
+import org.apache.geronimo.testsuite.common.selenium.EclipseSeleniumServer;
 import org.apache.geronimo.testsuite.common.ui.AbbotHelper;
 import org.apache.geronimo.testsuite.common.ui.Constants;
 import org.apache.geronimo.testsuite.common.ui.ServerTasks;
 import org.apache.geronimo.testsuite.common.ui.WorkbenchTasks;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.swt.widgets.Shell;
 
 import abbot.swt.eclipse.junit.extensions.WorkbenchTestCase;
 import abbot.swt.eclipse.utils.Preferences;
 import abbot.swt.eclipse.utils.WorkbenchUtilities;
 import abbot.swt.eclipse.utils.Preferences.Mode;
-import abbot.swt.finder.generic.MultipleFoundException;
-import abbot.swt.finder.generic.NotFoundException;
 
 /**
  * @version $Rev$ $Date$
@@ -59,21 +55,39 @@
         try {
             workbenchShell = WorkbenchUtilities.getWorkbenchWindow().getShell();
             aHelper = new AbbotHelper (workbenchShell);
-            
+
+
             ServerTasks serverTasks = new ServerTasks(workbenchShell, aHelper, Constants.SERVER_V21
);
             WorkbenchTasks workbenchTasks = new WorkbenchTasks(workbenchShell, aHelper);
             
             // so we are sure that we are looking in the desired perspective
             workbenchTasks.showJEEPerspective();
+       		
+
 
             // create server from an installed instance
             serverTasks.createServer();
 
             serverTasks.startServer();
+
+            
+            EclipseSelenium selenium = new EclipseSelenium();
+        	selenium.start();
+            
+            selenium.open( "http://localhost:8080/console/" );
+            selenium.waitForPageToLoad( "2000" );
+            selenium.type("j_username", "system");
+            selenium.type("j_password", "manager");
+            selenium.click("submit");
+            
+            
             serverTasks.stopServer();
 
             // remove the server 
             serverTasks.removeServer();
+            
+            selenium.stop();
+
 
             success = true;
         }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/resources/ui-tutorial/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/resources/ui-tutorial/index.jsp?rev=685852&r1=685851&r2=685852&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/resources/ui-tutorial/index.jsp
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v21/src/main/resources/ui-tutorial/index.jsp
Thu Aug 14 04:11:26 2008
@@ -26,7 +26,7 @@
   </head>
   <body>
     <form action="${pageContext.request.contextPath}/sayHello">
-      <input type="text" name="name" /><input type="submit" value="Press me!" />
+      <input type="text" name="name" /><input type="submit" name="submit" value="Press
me!" />
     </form>
   </body>
 </html>



Mime
View raw message