Author: veithen
Date: Sun Dec 9 13:32:22 2012
New Revision: 1418943
URL: http://svn.apache.org/viewvc?rev=1418943&view=rev
Log:
Removed the start-process goal and always use a Daemon implementation. This
ensures that the process is fully initialized when the integration tests start.
Added:
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
(with props)
Removed:
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
Modified:
axis/axis1/java/trunk/samples/transport-sample/pom.xml
axis/axis1/java/trunk/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
Modified: axis/axis1/java/trunk/samples/transport-sample/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/transport-sample/pom.xml?rev=1418943&r1=1418942&r2=1418943&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/transport-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/transport-sample/pom.xml Sun Dec 9 13:32:22
2012
@@ -44,6 +44,11 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-daemon</groupId>
+ <artifactId>commons-daemon</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -84,10 +89,10 @@
<execution>
<id>start-server</id>
<goals>
- <goal>start-process</goal>
+ <goal>start-daemon</goal>
</goals>
<configuration>
-
<mainClass>samples.transport.tcp.TCPListener</mainClass>
+
<daemonClass>samples.transport.tcp.TCPListenerDaemon</daemonClass>
<args>
<arg>-p</arg>
<arg>${test.functional.TCPListenerPort}</arg>
Modified:
axis/axis1/java/trunk/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java?rev=1418943&r1=1418942&r2=1418943&view=diff
==============================================================================
---
axis/axis1/java/trunk/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
(original)
+++
axis/axis1/java/trunk/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
Sun Dec 9 13:32:22 2012
@@ -59,7 +59,7 @@ public class TCPListener implements Runn
private AxisEngine engine = null ;
// becomes true when we want to quit
- private boolean done = false;
+ private volatile boolean done = false;
static final String wsdd =
"<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +
@@ -115,6 +115,10 @@ public class TCPListener implements Runn
}
}
+ public void stop() throws IOException {
+ done = true;
+ srvSocket.close();
+ }
public class SocketHandler implements Runnable {
private Socket socket;
Added:
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
URL:
http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java?rev=1418943&view=auto
==============================================================================
---
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
(added)
+++
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
Sun Dec 9 13:32:22 2012
@@ -0,0 +1,43 @@
+/*
+ * 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 samples.transport.tcp;
+
+import org.apache.commons.daemon.Daemon;
+import org.apache.commons.daemon.DaemonContext;
+import org.apache.commons.daemon.DaemonInitException;
+
+public class TCPListenerDaemon implements Daemon {
+ private TCPListener listener;
+
+ public void init(DaemonContext context) throws DaemonInitException,
Exception {
+ listener = new TCPListener(context.getArguments());
+ }
+
+ public void start() throws Exception {
+ new Thread(listener).start();
+ }
+
+ public void stop() throws Exception {
+ listener.stop();
+ }
+
+ public void destroy() {
+ listener = null;
+ }
+}
Propchange:
axis/axis1/java/trunk/samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
------------------------------------------------------------------------------
svn:eol-style = native