Changeset 10 for exampleparties/randomparty/src
- Timestamp:
- 01/28/20 10:19:54 (5 years ago)
- Location:
- exampleparties/randomparty/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java
r9 r10 3 3 import java.io.IOException; 4 4 import java.math.BigInteger; 5 import java.net.URI;6 import java.net.URISyntaxException;7 5 import java.util.Arrays; 8 6 import java.util.HashSet; … … 30 28 import geniusweb.progress.Progress; 31 29 import geniusweb.progress.ProgressRounds; 32 import geniusweb.references.ProtocolRef;33 30 import tudelft.utilities.logging.Reporter; 34 31 … … 81 78 @Override 82 79 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"))); 91 81 } 92 82 … … 115 105 } 116 106 117 private boolean isGood(Bid bid) {107 private boolean isGood(Bid bid) throws IOException { 118 108 if (bid == null) 119 109 return false; -
exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java
r9 r10 42 42 import geniusweb.party.inform.YourTurn; 43 43 import geniusweb.profile.Profile; 44 import geniusweb.profile.utilityspace.LinearAdditive UtilitySpace;44 import geniusweb.profile.utilityspace.LinearAdditive; 45 45 import geniusweb.progress.ProgressRounds; 46 46 import geniusweb.references.Parameters; … … 53 53 public class RandomPartyTest { 54 54 55 private static final ProtocolRef SAOP = new ProtocolRef("SAOP");55 private static final String SAOP = "SAOP"; 56 56 private static final PartyId otherparty = new PartyId("other"); 57 57 private static final String PROFILE = "src/test/resources/testprofile.json"; … … 63 63 private final ProgressRounds progress = mock(ProgressRounds.class); 64 64 private Settings settings; 65 private LinearAdditive UtilitySpaceprofile;65 private LinearAdditive profile; 66 66 private final Parameters parameters = new Parameters(); 67 67 … … 76 76 String serialized = new String(Files.readAllBytes(Paths.get(PROFILE)), 77 77 StandardCharsets.UTF_8); 78 profile = (LinearAdditiveUtilitySpace) jackson.readValue(serialized, 79 Profile.class); 78 profile = (LinearAdditive) jackson.readValue(serialized, Profile.class); 80 79 81 80 } … … 94 93 Capabilities capabilities = party.getCapabilities(); 95 94 assertFalse("party does not define protocols", 96 capabilities.get Protocols().isEmpty());95 capabilities.getBehaviours().isEmpty()); 97 96 } 98 97 … … 176 175 @Test 177 176 public void testGetCapabilities() { 178 assertTrue(party.getCapabilities().get Protocols().contains(SAOP));177 assertTrue(party.getCapabilities().getBehaviours().contains(SAOP)); 179 178 } 180 179
Note:
See TracChangeset
for help on using the changeset viewer.