|
1 | | -package test; |
| 1 | +package net.servicestack.client; |
2 | 2 |
|
3 | 3 | import net.servicestack.client.JsonUtils; |
4 | 4 | import net.servicestack.client.sse.ServerEventMessage; |
| 5 | +import net.servicestack.client.sse.ServerEventReceiver; |
| 6 | + |
| 7 | +import static chat.chatdtos.*; |
5 | 8 |
|
6 | 9 | /** |
7 | 10 | * Created by mythz on 2/11/2017. |
8 | 11 | */ |
9 | 12 |
|
10 | | -public class TestNamedReceiver { |
11 | | - |
12 | | - public class CustomType { |
13 | | - private int id; |
14 | | - private String name; |
15 | | - |
16 | | - public int getId() { |
17 | | - return id; |
18 | | - } |
19 | | - |
20 | | - public void setId(int id) { |
21 | | - this.id = id; |
22 | | - } |
23 | | - |
24 | | - public String getName() { |
25 | | - return name; |
26 | | - } |
27 | | - |
28 | | - public void setName(String name) { |
29 | | - this.name = name; |
30 | | - } |
31 | | - } |
| 13 | +public class TestNamedReceiver extends ServerEventReceiver { |
32 | 14 |
|
33 | 15 | public static CustomType FooMethodReceived; |
34 | 16 | public static CustomType BarMethodReceived; |
35 | 17 | public static CustomType NoSuchMethodReceived; |
36 | 18 | public static String NoSuchMethodSelector; |
| 19 | + public static CustomType QuxSetterReceived; |
| 20 | + |
| 21 | + public void setQuxSetter(CustomType value){ |
| 22 | + QuxSetterReceived = value; |
| 23 | + } |
37 | 24 |
|
38 | | - public void FooMethod(CustomType request) { |
| 25 | + public void fooMethod(CustomType request) { |
39 | 26 | FooMethodReceived = request; |
40 | 27 | } |
41 | 28 |
|
42 | | - public CustomType BarMethod(CustomType request) { |
| 29 | + public CustomType barMethod(CustomType request) { |
43 | 30 | BarMethodReceived = request; |
44 | 31 | return request; |
45 | 32 | } |
46 | 33 |
|
47 | | - public void NoSuchMethod(String selector, Object message) { |
| 34 | + @Override |
| 35 | + public void noSuchMethod(String selector, Object message) { |
48 | 36 | ServerEventMessage msg = (ServerEventMessage)message; |
49 | 37 | NoSuchMethodReceived = JsonUtils.fromJson(msg.getJson(), CustomType.class); |
50 | 38 | NoSuchMethodSelector = selector; |
|
0 commit comments