Changeset 10 for exampleparties/randompartypy/src
- Timestamp:
- 01/28/20 10:19:54 (5 years ago)
- Location:
- exampleparties/randompartypy/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/randompartypy/src/main/resources/RandomParty.py
r9 r10 65 65 # Override 66 66 def getCapabilities(self): # -> Capabilities 67 try: 68 return Capabilities(HashSet([ ProtocolRef(URI("SAOP"))])) 69 except: 70 getReporter().log(Level.SEVERE, "Failed to create capabilities URI",e); 71 return None 67 return Capabilities(HashSet([ "SAOP"])) 72 68 73 69 # Override -
exampleparties/randompartypy/src/test/java/geniusweb/exampleparties/randompartypy/RandomPartyTest.java
r9 r10 39 39 import geniusweb.party.inform.YourTurn; 40 40 import geniusweb.profile.Profile; 41 import geniusweb.profile.utilityspace.LinearAdditive UtilitySpace;41 import geniusweb.profile.utilityspace.LinearAdditive; 42 42 import geniusweb.progress.ProgressRounds; 43 43 import geniusweb.pythonadapter.PythonPartyAdapter; … … 51 51 52 52 private static final String PROFILE = "src/test/resources/testprofile.json"; 53 private static final ProtocolRef SAOP = new ProtocolRef("SAOP");53 private static final String SAOP = "SAOP"; 54 54 private static final PartyId otherparty = new PartyId("other"); 55 55 private final static ObjectMapper jackson = new ObjectMapper(); … … 62 62 private final Parameters parameters = new Parameters(); 63 63 64 private LinearAdditive UtilitySpaceprofile; // the real profile64 private LinearAdditive profile; // the real profile 65 65 66 66 @Before … … 80 80 String serialized = new String(Files.readAllBytes(Paths.get(PROFILE)), 81 81 StandardCharsets.UTF_8); 82 profile = (LinearAdditiveUtilitySpace) jackson.readValue(serialized, 83 Profile.class); 82 profile = (LinearAdditive) jackson.readValue(serialized, Profile.class); 84 83 85 84 } … … 98 97 Capabilities capabilities = party.getCapabilities(); 99 98 assertFalse("party does not define protocols", 100 capabilities.get Protocols().isEmpty());99 capabilities.getBehaviours().isEmpty()); 101 100 } 102 101 … … 167 166 @Test 168 167 public void testGetCapabilities() { 169 assertTrue(party.getCapabilities().get Protocols().contains(SAOP));168 assertTrue(party.getCapabilities().getBehaviours().contains(SAOP)); 170 169 } 171 170
Note:
See TracChangeset
for help on using the changeset viewer.