You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2011/02/22 21:15:03 UTC
svn commit: r1073484 -
/thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java
Author: roger
Date: Tue Feb 22 20:15:03 2011
New Revision: 1073484
URL: http://svn.apache.org/viewvc?rev=1073484&view=rev
Log:
THRIFT-1065 Unexpected exceptions not proper handled on JS
THRIFT-847 same bahavior for Java and C++(test/cpp/src/TestServer.cpp)
Patch: Henrique Mendonca
Modified:
thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java
Modified: thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java?rev=1073484&r1=1073483&r2=1073484&view=diff
==============================================================================
--- thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java (original)
+++ thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java Tue Feb 22 20:15:03 2011
@@ -29,6 +29,7 @@ import java.util.Set;
import junit.framework.TestCase;
import org.apache.thrift.TException;
+import org.apache.thrift.TApplicationException;
import org.apache.thrift.TProcessor;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TCompactProtocol;
@@ -227,13 +228,18 @@ public abstract class ServerTestBase ext
return hello;
}
- public void testException(String arg) throws Xception {
+ public void testException(String arg) throws Xception, TApplicationException {
System.out.print("testException("+arg+")\n");
if (arg.equals("Xception")) {
Xception x = new Xception();
x.errorCode = 1001;
x.message = "This is an Xception";
throw x;
+ } else if (arg.equals("ApplicationException")) {
+ throw new TApplicationException("This is a ApplicationException");
+ } else {
+ Xtruct result = new Xtruct();
+ result.string_thing = arg;
}
return;
}