File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
dubbo-rpc/dubbo-rpc-triple/src
main/java/org/apache/dubbo/rpc
test/java/org/apache/dubbo/rpc Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 19
19
import org .apache .dubbo .common .utils .StringUtils ;
20
20
import org .apache .dubbo .remoting .TimeoutException ;
21
21
22
+ import java .io .Serializable ;
23
+
22
24
import io .netty .handler .codec .http .HttpResponseStatus ;
23
25
import io .netty .handler .codec .http .QueryStringDecoder ;
24
26
import io .netty .handler .codec .http .QueryStringEncoder ;
35
37
/**
36
38
* See https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
37
39
*/
38
- public class TriRpcStatus {
40
+ public class TriRpcStatus implements Serializable {
39
41
40
42
public static final TriRpcStatus OK = fromCode (Code .OK );
41
43
public static final TriRpcStatus UNKNOWN = fromCode (Code .UNKNOWN );
Original file line number Diff line number Diff line change 19
19
import org .apache .dubbo .remoting .TimeoutException ;
20
20
import org .apache .dubbo .rpc .TriRpcStatus .Code ;
21
21
22
+ import java .io .Serializable ;
23
+
22
24
import io .netty .handler .codec .http .HttpResponseStatus ;
23
25
import org .junit .jupiter .api .Assertions ;
24
26
import org .junit .jupiter .api .Test ;
@@ -214,4 +216,11 @@ void triCodeToDubboCode() {
214
216
Assertions .assertEquals (METHOD_NOT_FOUND , TriRpcStatus .triCodeToDubboCode (Code .UNIMPLEMENTED ));
215
217
Assertions .assertEquals (UNKNOWN_EXCEPTION , TriRpcStatus .triCodeToDubboCode (Code .UNKNOWN ));
216
218
}
219
+
220
+ @ Test
221
+ void testSerializable () {
222
+ TriRpcStatus status = TriRpcStatus .INTERNAL .withDescription ("test" );
223
+ Assertions .assertInstanceOf (Serializable .class , status .asException ());
224
+ Assertions .assertInstanceOf (Serializable .class , status .asException ().getStatus ());
225
+ }
217
226
}
You can’t perform that action at this time.
0 commit comments