You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/02/15 23:58:20 UTC
svn commit: r1244780 - in /axis/axis1/java/trunk:
maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/
samples/transport-sample/
samples/transport-sample/src/test/java/test/functional/ test/functional/
Author: veithen
Date: Wed Feb 15 22:58:19 2012
New Revision: 1244780
URL: http://svn.apache.org/viewvc?rev=1244780&view=rev
Log:
Mavenized the TCP transport tests.
Added:
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java (with props)
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java (with props)
axis/axis1/java/trunk/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java
- copied, changed from r1243042, axis/axis1/java/trunk/test/functional/TestTCPTransportSample.java
Removed:
axis/axis1/java/trunk/test/functional/TestTCPTransportSample.java
Modified:
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/DefaultProcessManager.java
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStartAction.java
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStopAction.java
axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartServerMojo.java
axis/axis1/java/trunk/samples/transport-sample/pom.xml
Added: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java?rev=1244780&view=auto
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java (added)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java Wed Feb 15 22:58:19 2012
@@ -0,0 +1,154 @@
+/*
+ * 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.axis.maven.server;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.toolchain.Toolchain;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.util.StringUtils;
+
+public abstract class AbstractStartProcessMojo extends AbstractServerMojo {
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
+ /**
+ * The current build session instance. This is used for toolchain manager API calls.
+ *
+ * @parameter default-value="${session}"
+ * @required
+ * @readonly
+ */
+ private MavenSession session;
+
+ /**
+ * @component
+ */
+ private ToolchainManager toolchainManager;
+
+ /**
+ * The arguments to pass to the JVM when debug mode is enabled.
+ *
+ * @parameter default-value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8899,server=y,suspend=y"
+ */
+ private String debugArgs;
+
+ /**
+ * Indicates whether the Java process should be started in debug mode. This flag should only be
+ * set from the command line.
+ *
+ * @parameter expression="${axis.server.debug}" default-value="false"
+ */
+ private boolean debug;
+
+ /**
+ * The arguments to pass to the JVM when JMX is enabled.
+ *
+ * @parameter default-value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
+ */
+ private String jmxArgs;
+
+ /**
+ * Indicates whether the Java process should be started with remote JMX enabled. This flag
+ * should only be set from the command line.
+ *
+ * @parameter expression="${axis.server.jmx}" default-value="false"
+ */
+ private boolean jmx;
+
+ protected boolean isDebug() {
+ return debug;
+ }
+
+ protected void startJavaProcess(String description, String mainClass, String[] args, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws MojoExecutionException, MojoFailureException {
+ Log log = getLog();
+
+ // Locate java executable to use
+ String jvm;
+ Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", session);
+ if (tc != null) {
+ jvm = tc.findTool("java");
+ } else {
+ jvm = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Java executable: " + jvm);
+ }
+
+ // Get class path
+ List classpath;
+ try {
+ classpath = project.getTestClasspathElements();
+ } catch (DependencyResolutionRequiredException ex) {
+ throw new MojoExecutionException("Unexpected exception", ex);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Class path elements: " + classpath);
+ }
+
+ // Compute JVM arguments
+ List vmArgs = new ArrayList();
+ if (debug) {
+ processVMArgs(vmArgs, debugArgs);
+ }
+ if (jmx) {
+ processVMArgs(vmArgs, jmxArgs);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Additional VM args: " + vmArgs);
+ }
+
+ List cmdline = new ArrayList();
+ cmdline.add(jvm);
+ cmdline.add("-cp");
+ cmdline.add(StringUtils.join(classpath.iterator(), File.pathSeparator));
+ cmdline.addAll(vmArgs);
+ cmdline.add(mainClass);
+ cmdline.addAll(Arrays.asList(args));
+ try {
+ getProcessManager().startProcess(
+ description,
+ (String[])cmdline.toArray(new String[cmdline.size()]),
+ workDir,
+ startAction,
+ stopAction);
+ } catch (Exception ex) {
+ throw new MojoFailureException("Failed to start server", ex);
+ }
+ }
+
+ private static void processVMArgs(List vmArgs, String args) {
+ vmArgs.addAll(Arrays.asList(args.split(" ")));
+ }
+}
Propchange: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/AbstractStartProcessMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/DefaultProcessManager.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/DefaultProcessManager.java?rev=1244780&r1=1244779&r2=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/DefaultProcessManager.java (original)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/DefaultProcessManager.java Wed Feb 15 22:58:19 2012
@@ -50,22 +50,26 @@ public class DefaultProcessManager imple
public void stopAll() throws Exception {
Exception savedException = null;
for (Iterator it = managedProcesses.iterator(); it.hasNext(); ) {
- ManagedProcess server = (ManagedProcess)it.next();
+ ManagedProcess managedProcess = (ManagedProcess)it.next();
int result;
+ logger.debug("Executing stop action");
try {
- result = server.getStopAction().execute(logger);
+ result = managedProcess.getStopAction().execute(logger);
} catch (Exception ex) {
if (savedException == null) {
savedException = ex;
}
result = -1;
}
+ if (logger.isDebugEnabled()) {
+ logger.debug("result = " + result);
+ }
if (result == ProcessStopAction.STOPPING) {
- server.getProcess().waitFor();
+ managedProcess.getProcess().waitFor();
} else {
- server.getProcess().destroy();
+ managedProcess.getProcess().destroy();
}
- logger.info(server.getDescription() + " stopped");
+ logger.info(managedProcess.getDescription() + " stopped");
}
// TODO: need to clear the collection because the same ServerManager instance may be used by multiple projects in a reactor build;
// note that this means that the plugin is not thread safe (i.e. doesn't support parallel builds in Maven 3)
Modified: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStartAction.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStartAction.java?rev=1244780&r1=1244779&r2=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStartAction.java (original)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStartAction.java Wed Feb 15 22:58:19 2012
@@ -27,5 +27,10 @@ import org.codehaus.plexus.logging.Logge
* @author Andreas Veithen
*/
public interface ProcessStartAction {
+ ProcessStartAction NOP = new ProcessStartAction() {
+ public void execute(Logger logger, Process process) throws Exception {
+ }
+ };
+
void execute(Logger logger, Process process) throws Exception;
}
Modified: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStopAction.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStopAction.java?rev=1244780&r1=1244779&r2=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStopAction.java (original)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/ProcessStopAction.java Wed Feb 15 22:58:19 2012
@@ -27,6 +27,12 @@ import org.codehaus.plexus.logging.Logge
* @author Andreas Veithen
*/
public interface ProcessStopAction {
+ ProcessStopAction NOP = new ProcessStopAction() {
+ public int execute(Logger logger) throws Exception {
+ return RUNNING;
+ }
+ };
+
/**
* Indicates that the process is expected to be still running after the action is completed.
*/
Added: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java?rev=1244780&view=auto
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java (added)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java Wed Feb 15 22:58:19 2012
@@ -0,0 +1,61 @@
+/*
+ * 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.axis.maven.server;
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Start an arbitrary Java process.
+ *
+ * @goal start-process
+ * @phase pre-integration-test
+ * @requiresDependencyResolution test
+ */
+public class StartProcessMojo extends AbstractStartProcessMojo {
+ /**
+ * The main class.
+ *
+ * @parameter
+ * @required
+ */
+ private String mainClass;
+
+ /**
+ * The arguments to be passed to the main class.
+ *
+ * @parameter
+ */
+ private String[] args;
+
+ /**
+ * The working directory for the process.
+ *
+ * @parameter default-value="${project.build.directory}/work"
+ * @required
+ */
+ private File workDir;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ workDir.mkdirs();
+ startJavaProcess(mainClass, mainClass, args != null ? args : new String[0], workDir, ProcessStartAction.NOP, ProcessStopAction.NOP);
+ }
+}
Propchange: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartProcessMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartServerMojo.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartServerMojo.java?rev=1244780&r1=1244779&r2=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartServerMojo.java (original)
+++ axis/axis1/java/trunk/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/maven/server/StartServerMojo.java Wed Feb 15 22:58:19 2012
@@ -22,7 +22,6 @@ import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
@@ -31,14 +30,9 @@ import javax.xml.parsers.ParserConfigura
import org.apache.axis.client.AdminClient;
import org.apache.axis.deployment.wsdd.WSDDConstants;
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.toolchain.Toolchain;
-import org.apache.maven.toolchain.ToolchainManager;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
@@ -52,30 +46,7 @@ import org.w3c.dom.Element;
* @phase pre-integration-test
* @requiresDependencyResolution test
*/
-public class StartServerMojo extends AbstractServerMojo {
- /**
- * The maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- /**
- * The current build session instance. This is used for toolchain manager API calls.
- *
- * @parameter default-value="${session}"
- * @required
- * @readonly
- */
- private MavenSession session;
-
- /**
- * @component
- */
- private ToolchainManager toolchainManager;
-
+public class StartServerMojo extends AbstractStartProcessMojo {
/**
* @parameter default-value="${project.build.directory}/axis-server"
* @required
@@ -128,62 +99,9 @@ public class StartServerMojo extends Abs
*/
private boolean foreground;
- /**
- * The arguments to pass to the server JVM when debug mode is enabled.
- *
- * @parameter default-value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8899,server=y,suspend=y"
- */
- private String debugArgs;
-
- /**
- * Indicates whether the server should be started in debug mode. This flag should only be set
- * from the command line.
- *
- * @parameter expression="${axis.server.debug}" default-value="false"
- */
- private boolean debug;
-
- /**
- * The arguments to pass to the server JVM when JMX is enabled.
- *
- * @parameter default-value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
- */
- private String jmxArgs;
-
- /**
- * Indicates whether the server should be started with remote JMX enabled. This flag should only
- * be set from the command line.
- *
- * @parameter expression="${axis.server.jmx}" default-value="false"
- */
- private boolean jmx;
-
public void execute() throws MojoExecutionException, MojoFailureException {
Log log = getLog();
- // Locate java executable to use
- String jvm;
- Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", session);
- if (tc != null) {
- jvm = tc.findTool("java");
- } else {
- jvm = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
- }
- if (log.isDebugEnabled()) {
- log.debug("Java executable: " + jvm);
- }
-
- // Get class path
- List classpath;
- try {
- classpath = project.getTestClasspathElements();
- } catch (DependencyResolutionRequiredException ex) {
- throw new MojoExecutionException("Unexpected exception", ex);
- }
- if (log.isDebugEnabled()) {
- log.debug("Class path elements: " + classpath);
- }
-
// Select WSDD files
List deployments = new ArrayList();
List undeployments = new ArrayList();
@@ -230,18 +148,6 @@ public class StartServerMojo extends Abs
}
}
- // Compute JVM arguments
- List vmArgs = new ArrayList();
- if (debug) {
- processVMArgs(vmArgs, debugArgs);
- }
- if (jmx) {
- processVMArgs(vmArgs, jmxArgs);
- }
- if (log.isDebugEnabled()) {
- log.debug("Additional VM args: " + vmArgs);
- }
-
// Prepare a work directory where the server can create a server-config.wsdd file
File workDir = new File(workDirBase, String.valueOf(port));
if (workDir.exists()) {
@@ -274,30 +180,26 @@ public class StartServerMojo extends Abs
}
// Start the server
- List cmdline = new ArrayList();
- cmdline.add(jvm);
- cmdline.add("-cp");
- cmdline.add(StringUtils.join(classpath.iterator(), File.pathSeparator));
- cmdline.addAll(vmArgs);
- cmdline.add("org.apache.axis.server.standalone.StandaloneAxisServer");
- cmdline.add("-p");
- cmdline.add(String.valueOf(port));
- cmdline.add("-w");
- cmdline.add(workDir.getAbsolutePath());
+ List args = new ArrayList();
+ args.add("-p");
+ args.add(String.valueOf(port));
+ args.add("-w");
+ args.add(workDir.getAbsolutePath());
if (jwsDirs != null && jwsDirs.length > 0) {
- cmdline.add("-j");
- cmdline.add(StringUtils.join(jwsDirs, File.pathSeparator));
+ args.add("-j");
+ args.add(StringUtils.join(jwsDirs, File.pathSeparator));
}
try {
AdminClient adminClient = new AdminClient(true);
adminClient.setTargetEndpointAddress(new URL("http://localhost:" + port + "/axis/services/AdminService"));
- getProcessManager().startProcess(
+ startJavaProcess(
"Server on port " + port,
- (String[])cmdline.toArray(new String[cmdline.size()]),
+ "org.apache.axis.server.standalone.StandaloneAxisServer",
+ (String[])args.toArray(new String[args.size()]),
workDir,
new AxisServerStartAction(port, adminClient,
(File[])deployments.toArray(new File[deployments.size()]),
- debug || foreground ? Integer.MAX_VALUE : 20000),
+ isDebug() || foreground ? Integer.MAX_VALUE : 20000),
new AxisServerStopAction(adminClient,
(File[])undeployments.toArray(new File[undeployments.size()])));
} catch (Exception ex) {
@@ -316,8 +218,4 @@ public class StartServerMojo extends Abs
}
}
}
-
- private static void processVMArgs(List vmArgs, String args) {
- vmArgs.addAll(Arrays.asList(args.split(" ")));
- }
}
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=1244780&r1=1244779&r2=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/transport-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/transport-sample/pom.xml Wed Feb 15 22:58:19 2012
@@ -58,8 +58,73 @@
<execution>
<id>default-test</id>
<configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>reserve-network-port</id>
+ <goals>
+ <goal>reserve-network-port</goal>
+ </goals>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <portNames>
+ <portName>test.functional.TCPListenerPort</portName>
+ </portNames>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>maven-axis-server-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <id>start-server</id>
+ <goals>
+ <goal>start-process</goal>
+ </goals>
+ <configuration>
+ <mainClass>samples.transport.tcp.TCPListener</mainClass>
+ <args>
+ <arg>-p</arg>
+ <arg>${test.functional.TCPListenerPort}</arg>
+ </args>
+ <workDir>${project.build.directory}/axis-server/${test.functional.TCPListenerPort}</workDir>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-server</id>
+ <goals>
+ <goal>stop-all</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/Test*.java</include>
+ </includes>
<!-- Prevent Axis from creating a server-config.wsdd file in the source tree -->
<workingDirectory>${project.build.directory}/work</workingDirectory>
+ <systemPropertyVariables>
+ <test.functional.TCPListenerPort>${test.functional.TCPListenerPort}</test.functional.TCPListenerPort>
+ </systemPropertyVariables>
</configuration>
</execution>
</executions>
Copied: axis/axis1/java/trunk/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java (from r1243042, axis/axis1/java/trunk/test/functional/TestTCPTransportSample.java)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java?p2=axis/axis1/java/trunk/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java&p1=axis/axis1/java/trunk/test/functional/TestTCPTransportSample.java&r1=1243042&r2=1244780&rev=1244780&view=diff
==============================================================================
--- axis/axis1/java/trunk/test/functional/TestTCPTransportSample.java (original)
+++ axis/axis1/java/trunk/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java Wed Feb 15 22:58:19 2012
@@ -40,18 +40,20 @@ import java.net.URL;
public class TestTCPTransportSample extends TestCase {
static Log log =
LogFactory.getLog(TestTCPTransportSample.class.getName());
+
+ private static String uri = "tcp://localhost:" + System.getProperty("test.functional.TCPListenerPort", "8088");
public TestTCPTransportSample(String name) {
super(name);
}
public void doTestDeploy () throws Exception {
- String[] args = { "-ltcp://localhost:8088", "samples/transport/deploy.wsdd" };
+ String[] args = { "-l" + uri, System.getProperty("basedir", ".") + "/src/main/wsdd/deploy.wsdd" };
AdminClient.main(args);
}
public void doTestUndeploy () throws Exception {
- String[] args = { "-ltcp://localhost:8088", "samples/stock/undeploy.wsdd" };
+ String[] args = { "-l" + uri, "samples/stock/undeploy.wsdd" };
AdminClient.main(args);
}
@@ -59,7 +61,7 @@ public class TestTCPTransportSample exte
try {
log.info("Testing TCP stock service...");
GetQuote tester = new GetQuote();
- tester.getQuote(new String [] { "-ltcp://localhost:8088", "XXX" });
+ tester.getQuote(new String [] { "-l" + uri, "XXX" });
String symbol = "XXX"; // args[0] ;
EngineConfiguration defaultConfig =
@@ -73,7 +75,7 @@ public class TestTCPTransportSample exte
Call call = (Call) service.createCall();
- call.setTargetEndpointAddress( new URL("tcp://localhost:8088") );
+ call.setTargetEndpointAddress( new URL(uri) );
call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_FLOAT );