THRIFT-645. java: Create ant rules for running the test client and server

I didn't make these depend on compile-test since ant doesn't seem to
detect that the class files are up to date, so it takes a really long
time to recompile everything.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@888931 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/build.xml b/lib/java/build.xml
index 1694414..307fda5 100644
--- a/lib/java/build.xml
+++ b/lib/java/build.xml
@@ -186,6 +186,27 @@
       classpathref="test.classpath" failonerror="true" />
   </target>
 
+  <target name="testclient" description="Run a test client">
+    <java classname="org.apache.thrift.test.TestClient"
+      classpathref="test.classpath" failonerror="true">
+      <arg line="${testargs}" />
+    </java>
+  </target>
+
+  <target name="testserver" description="Run a test server">
+    <java classname="org.apache.thrift.test.TestServer"
+      classpathref="test.classpath" failonerror="true">
+      <arg line="${testargs}" />
+    </java>
+  </target>
+
+  <target name="testnonblockingserver" description="Run a test nonblocking server">
+    <java classname="org.apache.thrift.test.TestNonblockingServer"
+      classpathref="test.classpath" failonerror="true">
+      <arg line="${testargs}" />
+    </java>
+  </target>
+
   <target name="generate">
     <exec executable="../../compiler/cpp/thrift" failonerror="true">
       <arg line="--gen java:hashcode ${test.thrift.home}/ThriftTest.thrift" />
diff --git a/lib/java/test/TestClient b/lib/java/test/TestClient
deleted file mode 100755
index bd3c996..0000000
--- a/lib/java/test/TestClient
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash -v
-
-#
-# 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.
-#
-
-java -cp thrifttest.jar:../../lib/java/libthrift.jar org.apache.thrift.test.TestClient $*
diff --git a/lib/java/test/TestNonblockingServer b/lib/java/test/TestNonblockingServer
deleted file mode 100644
index 070991c..0000000
--- a/lib/java/test/TestNonblockingServer
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash -v
-
-#
-# 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.
-#
-
-java -server -Xmx256m -cp thrifttest.jar:../../lib/java/libthrift.jar org.apache.thrift.test.TestNonblockingServer $*
diff --git a/lib/java/test/TestServer b/lib/java/test/TestServer
deleted file mode 100755
index 0d36b58..0000000
--- a/lib/java/test/TestServer
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash -v
-
-#
-# 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.
-#
-
-java -server -cp thrifttest.jar:../../lib/java/libthrift.jar org.apache.thrift.test.TestServer $*