Thrift now works in PHP, hot stuff
Summary: End to end communication working in Thrift with PHP
Problem: It's a bit slower than pillar still. Need to find out why.
Reviewed By: aditya
Test Plan: Unit tests are in the test directory. Get lucas on the PHP case...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664720 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/java/src/TestServer.java b/test/java/src/TestServer.java
index c5edca4..0acc8a2 100644
--- a/test/java/src/TestServer.java
+++ b/test/java/src/TestServer.java
@@ -35,21 +35,11 @@
return thing;
}
- public UInt32 testU32(UInt32 thing) {
- System.out.print("testU32(" + thing.get() + ")\n");
- return thing;
- }
-
public Int32 testI32(Int32 thing) {
System.out.print("testI32(" + thing.get() + ")\n");
return thing;
}
- public UInt64 testU64(UInt64 thing) {
- System.out.print("testU64(" + thing.toLong() + ")\n");
- return thing;
- }
-
public Int64 testI64(Int64 thing) {
System.out.print("testI64(" + thing.get() + ")\n");
return thing;
@@ -59,9 +49,7 @@
System.out.print("testStruct({" +
"\"" + thing.string_thing.value + "\", " +
thing.byte_thing.get() + ", " +
- thing.u32_thing.get() + ", " +
thing.i32_thing.get() + ", " +
- thing.u64_thing.toLong() + ", " +
thing.i64_thing.get() + "})\n");
return thing;
}
@@ -72,9 +60,7 @@
nest.byte_thing.get() + ", {" +
"\"" + thing.string_thing.value + "\", " +
thing.byte_thing.get() + ", " +
- thing.u32_thing.get() + ", " +
thing.i32_thing.get() + ", " +
- thing.u64_thing.toLong() + ", " +
thing.i64_thing.get() + "}, " +
nest.i32_thing.get() + "})\n");
return nest;
@@ -130,8 +116,8 @@
return thing;
}
- public UInt64 testTypedef(UInt64 thing) {
- System.out.print("testTypedef(" + thing.toLong() + ")\n");
+ public Int64 testTypedef(Int64 thing) {
+ System.out.print("testTypedef(" + thing.get() + ")\n");
return thing;
}
@@ -153,31 +139,27 @@
return mapmap;
}
- public HashMap<UInt64, HashMap<Int32,Insanity>> testInsanity(Insanity argument) {
+ public HashMap<Int64, HashMap<Int32,Insanity>> testInsanity(Insanity argument) {
System.out.print("testInsanity()\n");
Xtruct hello = new Xtruct();
hello.string_thing.value = "Hello2";
hello.byte_thing.set((short)2);
- hello.u32_thing.set(2);
hello.i32_thing.set(2);
- hello.u64_thing.set(2);
hello.i64_thing.set(2);
Xtruct goodbye = new Xtruct();
goodbye.string_thing.value = "Goodbye4";
goodbye.byte_thing.set((short)4);
- goodbye.u32_thing.set(4);
goodbye.i32_thing.set(4);
- goodbye.u64_thing.set(4);
goodbye.i64_thing.set(4);
Insanity crazy = new Insanity();
- crazy.userMap.put(Numberz.EIGHT, new UInt64(8));
+ crazy.userMap.put(Numberz.EIGHT, new Int64(8));
crazy.xtructs.add(goodbye);
Insanity looney = new Insanity();
- crazy.userMap.put(Numberz.FIVE, new UInt64(5));
+ crazy.userMap.put(Numberz.FIVE, new Int64(5));
crazy.xtructs.add(hello);
HashMap<Int32,Insanity> first_map = new HashMap<Int32, Insanity>();
@@ -188,10 +170,10 @@
second_map.put(Numberz.SIX, looney);
- HashMap<UInt64,HashMap<Int32,Insanity>> insane =
- new HashMap<UInt64, HashMap<Int32,Insanity>>();
- insane.put(new UInt64(1), first_map);
- insane.put(new UInt64(2), second_map);
+ HashMap<Int64,HashMap<Int32,Insanity>> insane =
+ new HashMap<Int64, HashMap<Int32,Insanity>>();
+ insane.put(new Int64(1), first_map);
+ insane.put(new Int64(2), second_map);
return insane;
}