Changeset 9 for protocol/src/test/java


Ignore:
Timestamp:
11/28/19 14:40:48 (5 years ago)
Author:
bart
Message:

Release 1.1.0

Location:
protocol/src/test/java/geniusweb/protocol
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocol/src/test/java/geniusweb/protocol/session/ConnectionWithPartiesTest.java

    r1 r9  
    1414
    1515import geniusweb.actions.PartyId;
    16 import geniusweb.protocol.partyconnection.ConnectionWithParties;
    17 import geniusweb.protocol.partyconnection.ConnectionWithParty;
     16import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
     17import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
    1818import tudelft.utilities.junit.GeneralTests;
    1919
    2020public class ConnectionWithPartiesTest
    21                 extends GeneralTests<ConnectionWithParties> {
     21                extends GeneralTests<ProtocolToPartyConnections> {
    2222        PartyId party1 = new PartyId("party1");
    2323        PartyId party2 = new PartyId("party2");
    2424        PartyId party3 = new PartyId("party3");
    2525
    26         private ConnectionWithParty con1 = mock(ConnectionWithParty.class);
    27         private ConnectionWithParty con2 = mock(ConnectionWithParty.class);
    28         private ConnectionWithParty con3 = mock(ConnectionWithParty.class);
     26        private ProtocolToPartyConn con1 = mock(ProtocolToPartyConn.class);
     27        private ProtocolToPartyConn con2 = mock(ProtocolToPartyConn.class);
     28        private ProtocolToPartyConn con3 = mock(ProtocolToPartyConn.class);
    2929
    30         private ConnectionWithParties conns1 = new ConnectionWithParties(
     30        private ProtocolToPartyConnections conns1 = new ProtocolToPartyConnections(
    3131                        Arrays.asList(con1, con2));
    32         private ConnectionWithParties conns1a = new ConnectionWithParties(
     32        private ProtocolToPartyConnections conns1a = new ProtocolToPartyConnections(
    3333                        Arrays.asList(con1, con2));
    34         private ConnectionWithParties conns2 = new ConnectionWithParties(
     34        private ProtocolToPartyConnections conns2 = new ProtocolToPartyConnections(
    3535                        Arrays.asList(con1, con3));
    36         private ConnectionWithParties conns3 = new ConnectionWithParties(
     36        private ProtocolToPartyConnections conns3 = new ProtocolToPartyConnections(
    3737                        Arrays.asList(con2, con1));
    38         private ConnectionWithParties conns4 = new ConnectionWithParties(
     38        private ProtocolToPartyConnections conns4 = new ProtocolToPartyConnections(
    3939                        Arrays.asList(con2, con1, con3));
    40         private ConnectionWithParties conns5 = new ConnectionWithParties(
     40        private ProtocolToPartyConnections conns5 = new ProtocolToPartyConnections(
    4141                        Arrays.asList(con2, con1, con3, con1));
    4242
     
    5454
    5555        @Override
    56         public List<List<ConnectionWithParties>> getGeneralTestData() {
     56        public List<List<ProtocolToPartyConnections>> getGeneralTestData() {
    5757                return Arrays.asList(Arrays.asList(conns1, conns1a),
    5858                                Arrays.asList(conns2), Arrays.asList(conns3),
     
    9898        @Test
    9999        public void withPartyTest() {
    100                 ConnectionWithParties conns = conns3.with(con3);
     100                ProtocolToPartyConnections conns = conns3.with(con3);
    101101                assertEquals(2, conns3.size());
    102102                assertEquals(3, conns.size());
  • protocol/src/test/java/geniusweb/protocol/session/DefaultSessionStateTest.java

    r8 r9  
    2727import geniusweb.progress.ProgressTime;
    2828import geniusweb.protocol.ProtocolException;
    29 import geniusweb.protocol.partyconnection.ConnectionWithParties;
     29import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
    3030import geniusweb.protocol.session.saop.SAOPSettings;
    3131import geniusweb.references.Parameters;
     
    4848                PartyId party1 = new PartyId("party1");
    4949                actions.add(new EndNegotiation(party1));
    50                 ConnectionWithParties conns = new ConnectionWithParties(
     50                ProtocolToPartyConnections conns = new ProtocolToPartyConnections(
    5151                                Collections.EMPTY_LIST);
    5252                DeadlineTime deadline = new DeadlineTime(1000);
     
    126126
    127127        public DefaultSessionState1(List<Action> actions,
    128                         ConnectionWithParties conns, Progress progr,
     128                        ProtocolToPartyConnections conns, Progress progr,
    129129                        SessionSettings settings,
    130130                        Map<PartyId, PartyWithProfile> partyprofiles, ProtocolException e) {
  • protocol/src/test/java/geniusweb/protocol/session/saop/SAOPStateTest.java

    r4 r9  
    2727import geniusweb.progress.ProgressTime;
    2828import geniusweb.protocol.ProtocolException;
    29 import geniusweb.protocol.partyconnection.ConnectionWithParties;
    30 import geniusweb.protocol.partyconnection.ConnectionWithParty;
     29import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
     30import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
    3131import geniusweb.protocol.session.SessionSettings;
    3232import tudelft.utilities.junit.GeneralTests;
     
    4242        private List<Action> actions2 = Arrays.asList(action);
    4343
    44         private ConnectionWithParty party1conn = mock(ConnectionWithParty.class);
    45         private ConnectionWithParty party2conn = mock(ConnectionWithParty.class);
    46         private ConnectionWithParty party3conn = mock(ConnectionWithParty.class);
    47 
    48         private ConnectionWithParties connections = new ConnectionWithParties(
     44        private ProtocolToPartyConn party1conn = mock(ProtocolToPartyConn.class);
     45        private ProtocolToPartyConn party2conn = mock(ProtocolToPartyConn.class);
     46        private ProtocolToPartyConn party3conn = mock(ProtocolToPartyConn.class);
     47
     48        private ProtocolToPartyConnections connections = new ProtocolToPartyConnections(
    4949                        Arrays.asList(party1conn, party2conn));
    50         private ConnectionWithParties connections2 = new ConnectionWithParties(
     50        private ProtocolToPartyConnections connections2 = new ProtocolToPartyConnections(
    5151                        Arrays.asList(party1conn, party3conn));
    52         private ConnectionWithParties connections3 = new ConnectionWithParties(
     52        private ProtocolToPartyConnections connections3 = new ProtocolToPartyConnections(
    5353                        Arrays.asList(party1conn, party2conn, party3conn));
    5454
     
    114114        @Test
    115115        public void constructWith0Connection() {
    116                 new SAOPState(actions, new ConnectionWithParties(Arrays.asList()),
     116                new SAOPState(actions, new ProtocolToPartyConnections(Arrays.asList()),
    117117                                progresstime, settings, null, null);
    118118        }
     
    132132        @Test
    133133        public void testNextActor2() {
    134                 ConnectionWithParties conns = new ConnectionWithParties(
     134                ProtocolToPartyConnections conns = new ProtocolToPartyConnections(
    135135                                Arrays.asList(party2conn, party3conn));
    136136                SAOPState state = new SAOPState(actions, conns, progresstime, settings,
  • protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java

    r8 r9  
    3939import geniusweb.progress.Progress;
    4040import geniusweb.protocol.ProtocolException;
    41 import geniusweb.protocol.partyconnection.ConnectionWithParties;
    42 import geniusweb.protocol.partyconnection.ConnectionWithParty;
    43 import geniusweb.protocol.partyconnection.ConnectionWithPartyFactory;
     41import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
     42import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
     43import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
    4444import geniusweb.references.Parameters;
    4545import geniusweb.references.PartyRef;
     
    7676        private final PartyWithProfile party2 = mock(PartyWithProfile.class);
    7777        private SAOP saop;
    78         private ConnectionWithPartyFactory factory;
     78        private ProtocolToPartyConnFactory factory;
    7979        private List connections;
    80         private ConnectionWithParty conn1 = mock(ConnectionWithParty.class),
    81                         conn2 = mock(ConnectionWithParty.class);
     80        private ProtocolToPartyConn conn1 = mock(ProtocolToPartyConn.class),
     81                        conn2 = mock(ProtocolToPartyConn.class);
    8282        private Map<PartyId, PartyWithProfile> partyprofiles;
    8383        private Progress progress = mock(Progress.class);
    8484        private ProfileRef profile1;
    8585        private ProfileRef profile2;
    86         private ConnectionWithParties connectionswithparties = mock(
    87                         ConnectionWithParties.class);;
     86        private ProtocolToPartyConnections connectionswithparties = mock(
     87                        ProtocolToPartyConnections.class);;
    8888        @SuppressWarnings("unchecked")
    8989        private final Listener<ProtocolEvent> testlistener = mock(Listener.class);
     
    116116                when(settings.getDeadline()).thenReturn(deadlinetime);
    117117
    118                 factory = mock(ConnectionWithPartyFactory.class);
     118                factory = mock(ProtocolToPartyConnFactory.class);
    119119                connections = mock(List.class);
    120120                when(factory.connect(any(List.class))).thenReturn(connections);
     
    159159                when(state.getPartyProfiles()).thenReturn(partyprofiles);
    160160                when(state.getProgress()).thenReturn(progress);
    161                 when(state.with(any(ConnectionWithParty.class),
     161                when(state.with(any(ProtocolToPartyConn.class),
    162162                                any(PartyWithProfile.class))).thenReturn(connectedstate);
    163163                when(state.getNextActor()).thenReturn(PARTY1ID);
  • protocol/src/test/java/geniusweb/protocol/tournament/AllPermutationsProtocolTest.java

    r1 r9  
    2424import geniusweb.protocol.NegoState;
    2525import geniusweb.protocol.SessionResult;
    26 import geniusweb.protocol.partyconnection.ConnectionWithPartyFactory;
     26import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
    2727import geniusweb.protocol.session.SessionProtocol;
    2828import geniusweb.protocol.session.SessionSettings;
     
    4242        private final AllPermutationsProtocol app = new AllPermutationsProtocol(
    4343                        state, log);
    44         private final ConnectionWithPartyFactory factory = mock(
    45                         ConnectionWithPartyFactory.class);
     44        private final ProtocolToPartyConnFactory factory = mock(
     45                        ProtocolToPartyConnFactory.class);
    4646        private final SessionSettings settings = mock(SessionSettings.class);
    4747        private final SessionState finalsessionstate = mock(SessionState.class);
     
    140140
    141141        @Override
    142         public void start(ConnectionWithPartyFactory connectionfactory) {
     142        public void start(ProtocolToPartyConnFactory connectionfactory) {
    143143
    144144        }
Note: See TracChangeset for help on using the changeset viewer.