+
+struct Goodbyez {
+ 1: i32 val = 325;
+}
+
+senum Thinger {
+ "ASDFKJ",
+ "r32)*F#@",
+ "ASDFLJASDF"
+}
+
struct Hello {
- 1: i32 simple,
- 2: map<i32,i32> complex,
+ 1: i32 simple = 53,
+ 2: map<i32,i32> complex = {23:532, 6243:632, 2355:532},
3: map<i32, map<i32,i32>> complexer,
+ 4: string words = "words",
+ 5: Goodbyez thinz = {'val' : 36632}
}
+const map<i32,map<i32,i32>> CMAP = { 235: {235:235}, 53:{53:53} }
+const i32 CINT = 325;
+const Hello WHOA = {'simple' : 532}
+
exception Goodbye {
1: i32 simple,
2: map<i32,i32> complex,
}
service SmallService {
- Hello testMe(1:i32 hello, 2: Hello wonk) throws (1: Goodbye g),
+ Thinger testThinger(1:Thinger bootz),
+ Hello testMe(1:i32 hello=64, 2: Hello wonk) throws (1: Goodbye g),
void testVoid() throws (1: Goodbye g),
i32 testI32(1:i32 boo)
}
// 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;
}
TBinaryProtocol binaryProtocol =
- new TBinaryProtocol(transport, transport);
+ new TBinaryProtocol(transport);
ThriftTest.Client testClient =
new ThriftTest.Client(binaryProtocol);
/**
* 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
* 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 =
require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php';
/** Include the generated code */
-require_once '/home/mcslee/code/projects/thrift/test/php/'.$GEN_DIR.'/ThriftTest.php';
+require_once $GEN_DIR.'/ThriftTest.php';
+require_once $GEN_DIR.'/ThriftTest_types.php';
$host = 'localhost';
$port = 9090;