[35] | 1 | package geniusweb.protocol;
|
---|
| 2 |
|
---|
| 3 | import static org.mockito.Mockito.mock;
|
---|
| 4 |
|
---|
| 5 | import java.util.Arrays;
|
---|
| 6 | import java.util.LinkedList;
|
---|
| 7 | import java.util.List;
|
---|
| 8 |
|
---|
| 9 | import geniusweb.actions.Action;
|
---|
| 10 | import geniusweb.actions.PartyId;
|
---|
| 11 | import geniusweb.progress.Progress;
|
---|
| 12 | import geniusweb.progress.ProgressTime;
|
---|
| 13 | import geniusweb.protocol.session.saop.SAOPSettings;
|
---|
| 14 | import geniusweb.protocol.session.saop.SAOPState;
|
---|
| 15 | import tudelft.utilities.junit.GeneralTests;
|
---|
| 16 |
|
---|
| 17 | public 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 | }
|
---|