Ignore:
Timestamp:
01/28/20 10:19:54 (5 years ago)
Author:
bart
Message:

Update 28 jan 2020

Location:
exampleparties/randomparty/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java

    r9 r10  
    33import java.io.IOException;
    44import java.math.BigInteger;
    5 import java.net.URI;
    6 import java.net.URISyntaxException;
    75import java.util.Arrays;
    86import java.util.HashSet;
     
    3028import geniusweb.progress.Progress;
    3129import geniusweb.progress.ProgressRounds;
    32 import geniusweb.references.ProtocolRef;
    3330import tudelft.utilities.logging.Reporter;
    3431
     
    8178        @Override
    8279        public Capabilities getCapabilities() {
    83                 try {
    84                         return new Capabilities(new HashSet<>(
    85                                         Arrays.asList(new ProtocolRef(new URI("SAOP")))));
    86                 } catch (URISyntaxException e) {
    87                         getReporter().log(Level.SEVERE, "Failed to create capabilities URI",
    88                                         e);
    89                         return null;
    90                 }
     80                return new Capabilities(new HashSet<>(Arrays.asList("SAOP")));
    9181        }
    9282
     
    115105        }
    116106
    117         private boolean isGood(Bid bid) {
     107        private boolean isGood(Bid bid) throws IOException {
    118108                if (bid == null)
    119109                        return false;
  • exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java

    r9 r10  
    4242import geniusweb.party.inform.YourTurn;
    4343import geniusweb.profile.Profile;
    44 import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
     44import geniusweb.profile.utilityspace.LinearAdditive;
    4545import geniusweb.progress.ProgressRounds;
    4646import geniusweb.references.Parameters;
     
    5353public class RandomPartyTest {
    5454
    55         private static final ProtocolRef SAOP = new ProtocolRef("SAOP");
     55        private static final String SAOP = "SAOP";
    5656        private static final PartyId otherparty = new PartyId("other");
    5757        private static final String PROFILE = "src/test/resources/testprofile.json";
     
    6363        private final ProgressRounds progress = mock(ProgressRounds.class);
    6464        private Settings settings;
    65         private LinearAdditiveUtilitySpace profile;
     65        private LinearAdditive profile;
    6666        private final Parameters parameters = new Parameters();
    6767
     
    7676                String serialized = new String(Files.readAllBytes(Paths.get(PROFILE)),
    7777                                StandardCharsets.UTF_8);
    78                 profile = (LinearAdditiveUtilitySpace) jackson.readValue(serialized,
    79                                 Profile.class);
     78                profile = (LinearAdditive) jackson.readValue(serialized, Profile.class);
    8079
    8180        }
     
    9493                Capabilities capabilities = party.getCapabilities();
    9594                assertFalse("party does not define protocols",
    96                                 capabilities.getProtocols().isEmpty());
     95                                capabilities.getBehaviours().isEmpty());
    9796        }
    9897
     
    176175        @Test
    177176        public void testGetCapabilities() {
    178                 assertTrue(party.getCapabilities().getProtocols().contains(SAOP));
     177                assertTrue(party.getCapabilities().getBehaviours().contains(SAOP));
    179178        }
    180179
Note: See TracChangeset for help on using the changeset viewer.