Some thrift test code fixes
Reviewed By: tbr-testaditya
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665014 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/java/src/TestClient.java b/test/java/src/TestClient.java
index bc95036..3c8d8b3 100644
--- a/test/java/src/TestClient.java
+++ b/test/java/src/TestClient.java
@@ -3,6 +3,7 @@
// Generated code
import thrift.test.*;
+import com.facebook.thrift.TApplicationException;
import com.facebook.thrift.transport.TTransport;
import com.facebook.thrift.transport.TSocket;
import com.facebook.thrift.transport.THttpClient;
@@ -70,7 +71,7 @@
}
TBinaryProtocol binaryProtocol =
- new TBinaryProtocol(transport, transport);
+ new TBinaryProtocol(transport);
ThriftTest.Client testClient =
new ThriftTest.Client(binaryProtocol);
@@ -96,9 +97,13 @@
/**
* VOID TEST
*/
- System.out.print("testVoid()");
- testClient.testVoid();
- System.out.print(" = void\n");
+ try {
+ System.out.print("testVoid()");
+ testClient.testVoid();
+ System.out.print(" = void\n");
+ } catch (TApplicationException tax) {
+ tax.printStackTrace();
+ }
/**
* STRING TEST
@@ -303,12 +308,14 @@
* INSANITY TEST
*/
Insanity insane = new Insanity();
+ insane.userMap = new HashMap<Integer, Long>();
insane.userMap.put(Numberz.FIVE, (long)5000);
Xtruct truck = new Xtruct();
truck.string_thing = "Truck";
truck.byte_thing = (byte)8;
truck.i32_thing = 8;
truck.i64_thing = 8;
+ insane.xtructs = new ArrayList<Xtruct>();
insane.xtructs.add(truck);
System.out.print("testInsanity()");
AbstractMap<Long,AbstractMap<Integer,Insanity>> whoa =