You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by du...@apache.org on 2007/03/01 16:19:38 UTC
svn commit: r513382 -
/webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java
Author: dug
Date: Thu Mar 1 07:19:37 2007
New Revision: 513382
URL: http://svn.apache.org/viewvc?view=rev&rev=513382
Log:
sync with head
Modified:
webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java
Modified: webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java?view=diff&rev=513382&r1=513381&r2=513382
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java (original)
+++ webservices/axis/trunk/proposals/dug/java/tools/org/apache/axis/tools/ant/axis/RunAxisFunctionalTestsTask.java Thu Mar 1 07:19:37 2007
@@ -71,19 +71,19 @@
// Execute the ant target
new Thread(new TaskRunnable(startTarget)).start();
- if (! startTarget.equals(tcpServerTarget))
- return;
-
- // try a ping for the TCP server
while (true) {
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
}
try {
- sendOnSocket("ping\r\n");
- // if no exception, return
- System.out.println("RunAxisFunctionalTestsTask.callStart successfully pinged server.");
+ if (startTarget.equals(tcpServerTarget)) {
+ sendOnSocket("ping\r\n");
+ System.out.println("RunAxisFunctionalTestsTask.callStart successfully pinged tcp server.");
+ } else {
+ checkHTTPServer();
+ System.out.println("RunAxisFunctionalTestsTask.callStart successfully pinged http server.");
+ }
return;
} catch (Exception ex) {
// loop & try again
@@ -116,12 +116,8 @@
// second, and more involvedly, stop the http server
// Try connecting in case the server is already stopped.
if (httpServerTarget != null) {
- URL url = new URL("http://localhost:8080/");
try {
- HttpURLConnection connection = (HttpURLConnection)url.openConnection();
- connection.connect();
- readFully(connection);
- connection.disconnect();
+ checkHTTPServer();
} catch (IOException e) {
// Server is not running. Make this task a no-op.
System.out.println("Error from HTTP read: " + e);
@@ -186,6 +182,14 @@
callee.init();
callee.setTarget(taskName);
callee.execute();
+ }
+
+ private void checkHTTPServer() throws IOException {
+ URL url = new URL("http://localhost:8080/");
+ HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+ connection.connect();
+ readFully(connection);
+ connection.disconnect();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org