Author: veithen
Date: Fri Jan  6 09:53:31 2012
New Revision: 1228046

URL: http://svn.apache.org/viewvc?rev=1228046&view=rev
Log:
Added a flag to the start-server mojo that makes it possible to run manual 
tests on the test server.

Modified:
    
axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java

Modified: 
axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java?rev=1228046&r1=1228045&r2=1228046&view=diff
==============================================================================
--- 
axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java
 (original)
+++ 
axis/axis1/java/trunk/axis-maven-plugin/src/main/java/org/apache/axis/maven/StartServerMojo.java
 Fri Jan  6 09:53:31 2012
@@ -80,6 +80,20 @@ public class StartServerMojo extends Abs
      */
     private WSDD[] wsdds;
     
+    /**
+     * If this flag is set to <code>true</code>, then the execution of the 
goal will block after the
+     * server has been started and the services are deployed. This is useful 
if one wants to
+     * manually test some services deployed on the server or if one wants to 
run the integration
+     * tests from an IDE. The flag can only be set using the command line, but 
not in the POM.
+     * <p>
+     * Note: this feature is implemented using a flag (instead of a distinct 
goal) to make sure that
+     * the server is configured in exactly the same way as in a normal 
integration test execution.
+     * 
+     * @parameter expression="${axis.server.foreground}" default-value="false"
+     * @readonly
+     */
+    private boolean foreground;
+    
     public void execute() throws MojoExecutionException, MojoFailureException {
         Log log = getLog();
         
@@ -151,5 +165,17 @@ public class StartServerMojo extends Abs
         } catch (Exception ex) {
             throw new MojoFailureException("Failed to start server", ex);
         }
+        
+        if (foreground) {
+            Object lock = new Object();
+            synchronized (lock) {
+                try {
+                    lock.wait();
+                } catch (InterruptedException ex) {
+                    // Set interrupt flag and continue
+                    Thread.currentThread().interrupt();
+                }
+            }
+        }
     }
 }


Reply via email to