geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bjr...@apache.org
Subject svn commit: r737083 - in /geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins: org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/ org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo...
Date Fri, 23 Jan 2009 16:45:59 GMT
Author: bjreed
Date: Fri Jan 23 08:45:58 2009
New Revision: 737083

URL: http://svn.apache.org/viewvc?rev=737083&view=rev
Log:
GERONIMODEVTOOLS handle failures before starting the test cases

Modified:
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ServerTasks.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/Activator.java
    geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/ui/EclipseUITest.java

Modified: 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=737083&r1=737082&r2=737083&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/selenium/EclipseSeleniumServer.java
Fri Jan 23 08:45:58 2009
@@ -39,17 +39,17 @@
     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;
     }
@@ -63,10 +63,17 @@
     }
 
     public void run() throws Exception {
-        BrowserLauncherFactory.addBrowserLauncher("EclipseBrowser", EclipseBrowserLauncher.class);
-        SeleniumServer.setDebugMode( true );
-        server = new SeleniumServer();
-        server.start();
+        try {
+            BrowserLauncherFactory.addBrowserLauncher("EclipseBrowser", EclipseBrowserLauncher.class);
+            SeleniumServer.setDebugMode (true);
+            server = new SeleniumServer();
+            server.start();
+        } catch (Throwable th) {
+            th.printStackTrace();
+            Exception e = new Exception("unable to start Selenium server");
+            e.initCause(th);
+            throw (e);
+        }
     }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ServerTasks.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/ServerTasks.java?rev=737083&r1=737082&r2=737083&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ServerTasks.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.common/src/main/java/org/apache/geronimo/testsuite/common/ui/ServerTasks.java
Fri Jan 23 08:45:58 2009
@@ -35,7 +35,7 @@
         abbotHelper = helper;
         this.serverVersion = serverVersion;
     }
-    
+
     // just getting through this with no exceptions is success.
     public boolean createServer(){
         boolean success = true;
@@ -46,7 +46,7 @@
                     "New");
 
             // Having 2 tree items with the same name is not very good design
-            abbotHelper.clickTreeItem (wizardShell, 
+            abbotHelper.clickTreeItem (wizardShell,
                     new String[] {"Server", "Server"});
             abbotHelper.clickButton (wizardShell, IDialogConstants.NEXT_LABEL);
 
@@ -66,7 +66,7 @@
         return success;
     }
 
-    public boolean showServerOverview() { 
+    public boolean showServerOverview() {
         boolean success = true;
         try {
             String serverDisplay = Constants.getConstant(serverVersion, Constants.SERVERDISPLAY);
@@ -83,23 +83,23 @@
     public boolean startServer () {
         return startServer (false);
     }
-    
+
     public boolean startServer (boolean restart) {
         boolean success = true;
         try {
             String serverDisplay = Constants.getConstant(serverVersion, Constants.SERVERDISPLAY);
             abbotHelper.clickMenuItem (workbenchShell,
                     new String[] {"&Window", "Show &View", "Servers"});
-        
+
             if (restart == true) {
                 abbotHelper.rightClickItem (workbenchShell, serverDisplay,
-                        new String[] {"&Restart"});                
+                        new String[] {"&Restart"});
             } else {
                 abbotHelper.rightClickItem (workbenchShell, serverDisplay,
                         new String[] {"&Start"});
             }
             abbotHelper.waitForServerStatus (workbenchShell, serverDisplay, "Started");
-        
+
             abbotHelper.waitTime (AbbotHelper.WAIT_STANDARD);
 
             // if starting the server for the first time, do a quick sanity check
@@ -107,11 +107,11 @@
                 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");
+                selenium.open ("http://localhost:8080/console/");
+                selenium.waitForPageToLoad ("2000");
+                selenium.type ("j_username", "system");
+                selenium.type ("j_password", "manager");
+                selenium.click ("submit");
 
                 selenium.stop();
             }
@@ -121,7 +121,7 @@
         }
         return success;
     }
-    
+
     public boolean stopServer () {
         boolean success = true;
         try {
@@ -132,7 +132,7 @@
             abbotHelper.rightClickItem (workbenchShell, serverDisplay,
                     new String[] {"S&top"});
             abbotHelper.waitForServerStatus (workbenchShell, serverDisplay, "Stopped");
-        
+
             abbotHelper.waitTime (AbbotHelper.WAIT_STANDARD);
         } catch (Exception e) {
             e.printStackTrace();
@@ -141,7 +141,7 @@
         return success;
     }
 
-    
+
     // remove the server so that the test will be reset back to its original state.
     public boolean removeServer () {
         boolean success = true;
@@ -154,7 +154,7 @@
                     new String[] {"Server", "Runtime Environments"});
             abbotHelper.clickItem (preferenceShell, Constants.getConstant(serverVersion,
Constants.SERVERRUNTIME));
             Shell questionShell = abbotHelper.clickButton (preferenceShell, "&Remove",
"Server");
-        
+
             abbotHelper.clickButton (questionShell, IDialogConstants.OK_LABEL);
             abbotHelper.clickButton (preferenceShell, IDialogConstants.OK_LABEL);
         } catch (Exception e) {
@@ -168,13 +168,13 @@
         boolean success = true;
         try {
             String serverDisplay = Constants.getConstant(serverVersion, Constants.SERVERDISPLAY);
-        
+
             abbotHelper.clickMenuItem (workbenchShell,
                     new String[] {"&Window", "Show &View", "Servers"});
             Shell deployShell = abbotHelper.rightClickItem (workbenchShell, serverDisplay,
                     new String[] {"Add and Remove &Projects..."}, "Add and Remove Projects");
             abbotHelper.clickButton (deployShell, "Add A&ll >>");
-        
+
             abbotHelper.clickButton (deployShell, IDialogConstants.FINISH_LABEL);
             abbotHelper.waitForDialogDisposal (deployShell);
         } catch (Exception e) {
@@ -188,13 +188,13 @@
         boolean success = true;
         try {
             String serverDisplay = Constants.getConstant(serverVersion, Constants.SERVERDISPLAY);
-        
+
             abbotHelper.clickMenuItem (workbenchShell,
                     new String[] {"&Window", "Show &View", "Servers"});
             Shell deployShell = abbotHelper.rightClickItem (workbenchShell, serverDisplay,
                     new String[] {"Add and Remove &Projects..."}, "Add and Remove Projects");
             abbotHelper.clickButton (deployShell, "<< Re&move All");
-        
+
             abbotHelper.clickButton (deployShell, IDialogConstants.FINISH_LABEL);
             abbotHelper.waitForDialogDisposal (deployShell);
         } catch (Exception e) {
@@ -221,5 +221,5 @@
         }
         location = location + File.separatorChar + Constants.getConstant(serverVersion, Constants.SERVERPATH);
;
         return location;
-    }  
+    }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/Activator.java?rev=737083&r1=737082&r2=737083&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/Activator.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/Activator.java
Fri Jan 23 08:45:58 2009
@@ -50,26 +50,26 @@
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
      */
-    public void start(BundleContext context) throws Exception {
-        super.start(context);
+    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);
+        seleniumServer = new EclipseSeleniumServer (aHelper, workbenchShell);
         try {
-            SafeRunner.run( seleniumServer );
+            SafeRunner.run (seleniumServer);
             Thread.sleep(5000);
 //          new Exception("sdsfsdf").printStackTrace();
-        } catch ( Exception e ) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
      */
     public void stop(BundleContext context) throws Exception {
@@ -80,13 +80,13 @@
 
     /**
      * Returns the shared instance
-     * 
+     *
      * @return the shared instance
      */
     public static Activator getDefault() {
         return plugin;
     }
-    
+
     public static void log(int severity, String message, Throwable throwable) {
         plugin.getLog().log(new Status(severity, PLUGIN_ID, 0, message, throwable));
     }

Modified: geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/ui/EclipseUITest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/ui/EclipseUITest.java?rev=737083&r1=737082&r2=737083&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/ui/EclipseUITest.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/testsuite/plugins/org.apache.geronimo.testsuite.v22/src/main/java/org/apache/geronimo/testsuite/v22/ui/EclipseUITest.java
Fri Jan 23 08:45:58 2009
@@ -91,7 +91,7 @@
     private boolean installServer() {
         boolean success = serverTasks.createServer();
         if (success == true) {
-            serverTasks.startServer (false);
+            success = serverTasks.startServer (false);
         }
         return success;
     }



Mime
View raw message