Line | |
---|
1 | package geniusweb.exampleparties.humangui;
|
---|
2 |
|
---|
3 | import java.io.IOException;
|
---|
4 | import java.net.URI;
|
---|
5 | import java.util.LinkedList;
|
---|
6 | import java.util.List;
|
---|
7 |
|
---|
8 | import geniusweb.actions.Action;
|
---|
9 | import geniusweb.connection.ConnectionEnd;
|
---|
10 | import geniusweb.inform.Inform;
|
---|
11 | import geniusweb.references.Reference;
|
---|
12 | import tudelft.utilities.listener.DefaultListenable;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * A "real" connection object, because the party is going to subscribe etc, and
|
---|
16 | * without a real connection we would have to do a lot of mocks that would make
|
---|
17 | * the test very hard to read.
|
---|
18 | *
|
---|
19 | */
|
---|
20 | public class TestConnection extends DefaultListenable<Inform>
|
---|
21 | implements ConnectionEnd<Inform, Action> {
|
---|
22 | private List<Action> actions = new LinkedList<>();
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public void send(Action action) throws IOException {
|
---|
26 | actions.add(action);
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public Reference getReference() {
|
---|
31 | return null;
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public URI getRemoteURI() {
|
---|
36 | return null;
|
---|
37 | }
|
---|
38 |
|
---|
39 | @Override
|
---|
40 | public void close() {
|
---|
41 |
|
---|
42 | }
|
---|
43 |
|
---|
44 | @Override
|
---|
45 | public Error getError() {
|
---|
46 | return null;
|
---|
47 | }
|
---|
48 |
|
---|
49 | public List<Action> getActions() {
|
---|
50 | return actions;
|
---|
51 | }
|
---|
52 |
|
---|
53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.