source: protocol/src/test/java/geniusweb/protocol/CurrentNegoStateTest.java@ 41

Last change on this file since 41 was 41, checked in by bart, 3 years ago

Reduced memory need of websockets.

File size: 1.6 KB
Line 
1package geniusweb.protocol;
2
3import static org.mockito.Mockito.mock;
4
5import java.util.Arrays;
6import java.util.LinkedList;
7import java.util.List;
8
9import geniusweb.actions.Action;
10import geniusweb.actions.PartyId;
11import geniusweb.progress.Progress;
12import geniusweb.progress.ProgressTime;
13import geniusweb.protocol.session.saop.SAOPSettings;
14import geniusweb.protocol.session.saop.SAOPState;
15import tudelft.utilities.junit.GeneralTests;
16
17public class CurrentNegoStateTest extends GeneralTests<CurrentNegoState> {
18 private PartyId party1 = new PartyId("party1");
19 private PartyId party2 = new PartyId("party2");
20 private List<Action> actions1 = new LinkedList<>();
21
22 private List<PartyId> connections = Arrays.asList(party1);
23 private List<PartyId> connections2 = Arrays.asList(party1, party2);
24
25 private Progress progresstime = mock(ProgressTime.class);
26 private SAOPSettings settings = mock(SAOPSettings.class);
27
28 SAOPState saop1 = new SAOPState(actions1, connections2, progresstime,
29 settings, null, null);
30 SAOPState saop2 = new SAOPState(actions1, connections, progresstime,
31 settings, null, null);
32
33 CurrentNegoState state1 = new CurrentNegoState(saop1);
34 CurrentNegoState state1a = new CurrentNegoState(saop1);
35 CurrentNegoState state2 = new CurrentNegoState(saop2);
36
37 @Override
38 public List<List<CurrentNegoState>> getGeneralTestData() {
39 return Arrays.asList(Arrays.asList(state1, state1a),
40 Arrays.asList(state2));
41 }
42
43 @Override
44 public List<String> getGeneralTestStrings() {
45 return Arrays.asList(
46 "CurrentNegoState.*SAOPState.*party1.*party2.*ProgressTime.*SAOPSettings.*",
47 "CurrentNegoState.*SAOPState.*party1.*ProgressTime.*SAOPSettings.*");
48 }
49
50}
Note: See TracBrowser for help on using the repository browser.