Index: exampleparties/randomparty/test/RandomPartyTest.py
===================================================================
--- exampleparties/randomparty/test/RandomPartyTest.py	(revision 66)
+++ exampleparties/randomparty/test/RandomPartyTest.py	(revision 67)
@@ -1,4 +1,6 @@
 from datetime import datetime
 from decimal import Decimal
+import json
+from pathlib import Path
 from typing import cast, List
 import unittest
@@ -8,11 +10,17 @@
 from geniusweb.actions.Offer import Offer
 from geniusweb.actions.PartyId import PartyId
+from geniusweb.actions.Votes import Votes
+from geniusweb.bidspace.AllBidsList import AllBidsList
 from geniusweb.connection.ConnectionEnd import ConnectionEnd
 from geniusweb.inform.ActionDone import ActionDone
 from geniusweb.inform.Inform import Inform
 from geniusweb.inform.Settings import Settings
+from geniusweb.inform.Voting import Voting
 from geniusweb.inform.YourTurn import YourTurn
 from geniusweb.issuevalue.Bid import Bid
 from geniusweb.issuevalue.NumberValue import NumberValue
+from geniusweb.profile.Profile import Profile
+from geniusweb.profile.utilityspace.LinearAdditive import LinearAdditive
+from geniusweb.profile.utilityspace.UtilitySpace import UtilitySpace
 from geniusweb.progress.ProgressTime import ProgressTime
 from geniusweb.references.Parameters import Parameters
@@ -20,7 +28,9 @@
 from geniusweb.references.ProtocolRef import ProtocolRef
 from geniusweb.references.Reference import Reference
+from pyson.ObjectMapper import ObjectMapper
+from tudelft.utilities.listener.DefaultListenable import DefaultListenable
+from uri.uri import URI  # type: ignore 
+
 from randomparty.RandomParty import RandomParty
-from tudelft.utilities.listener.DefaultListenable import DefaultListenable
-from uri import URI  # type: ignore 
 
 
@@ -37,5 +47,5 @@
 
     def getRemoteURI(self)->URI: 
-        return None
+        return URI("whatever")
     
     def close(self):
@@ -49,9 +59,22 @@
     
 class RandomPartyTest(unittest.TestCase):
-    id = PartyId("party1")
+    pyson = ObjectMapper()
+    
+    PARTY1 = PartyId("party1")
     profileref = ProfileRef(URI("file:test/resources/japantrip1.json"))
+    PROFILE = ProfileRef(URI("file:test/resources/testprofile.json"))
     protocolref = ProtocolRef(URI("SAOP"))
+    mopacProtocol = ProtocolRef(URI("MOPAC"));
     progress=ProgressTime(1000, datetime.fromtimestamp(12345))
     parameters=Parameters()
+    mopacSettings = Settings(PARTY1,  PROFILE, mopacProtocol,progress, parameters)
+    serialized =  Path("test/resources/testprofile.json").read_text("utf-8")
+    profile:UtilitySpace = pyson.parse(json.loads(serialized), LinearAdditive) #type:ignore     
+
+    def setUp(self):
+        self.party=RandomParty()
+        self.connection = MyConn()
+        # we load the profile here too, to find a good bid
+    
 
     def test_smoke(self):
@@ -59,31 +82,27 @@
         
     def testConnect(self):
-        connection = MyConn()
         party=RandomParty()
-        party.connect(connection)
+        party.connect(self.connection)
         party.disconnect()
         
         
     def testSendInfo(self):
-        settings  = Settings(self.id, self.profileref, self.protocolref, self.progress, self.parameters )
+        settings  = Settings(self.PARTY1, self.profileref, self.protocolref, self.progress, self.parameters )
         
-        connection = MyConn()
-        party=RandomParty()
-        party.connect(connection)
-        connection.notifyListeners(settings)
-        party.disconnect()
-        self.assertEquals([], connection.getActions())
+        self.party.connect(self.connection)
+        self.connection.notifyListeners(settings)
+        self.party.disconnect()
+        self.assertEquals([], self.connection.getActions())
         
     def testSendYourTurn(self):
-        settings  = Settings(self.id, self.profileref, self.protocolref, self.progress, self.parameters )
+        self.assertEqual(0, len(self.connection.getActions()))
+        settings  = Settings(self.PARTY1, self.profileref, self.protocolref, self.progress, self.parameters )
 
-        connection = MyConn()
-        party=RandomParty()
-        party.connect(connection)
-        connection.notifyListeners(settings)
-        connection.notifyListeners(YourTurn())
-        party.disconnect()
+        self.party.connect(self.connection)
+        self.connection.notifyListeners(settings)
+        self.connection.notifyListeners(YourTurn())
+        self.party.disconnect()
         
-        actions = connection.getActions()
+        actions = self.connection.getActions()
         self.assertEquals(1, len(actions))
         self.assertTrue(isinstance(actions[0], Offer))
@@ -91,5 +110,5 @@
 
     def testSendOfferAndYourTurn(self):
-        settings  = Settings(self.id, self.profileref, self.protocolref, self.progress, self.parameters )
+        settings  = Settings(self.PARTY1, self.profileref, self.protocolref, self.progress, self.parameters )
 
         # nonsense bid, party should not accept
@@ -97,14 +116,32 @@
         offer = Offer(PartyId('other'), bid)
 
-        connection = MyConn()
-        party=RandomParty()
-        party.connect(connection)
-        connection.notifyListeners(settings)
-        connection.notifyListeners(ActionDone(offer))
-        connection.notifyListeners(YourTurn())
-        party.disconnect()
+        self.party.connect(self.connection)
+        self.connection.notifyListeners(settings)
+        self.connection.notifyListeners(ActionDone(offer))
+        self.connection.notifyListeners(YourTurn())
+        self.party.disconnect()
         
-        actions = connection.getActions()
+        actions = self.connection.getActions()
         self.assertEquals(1, len(actions))
         self.assertTrue(isinstance(actions[0], Offer))
 
+
+    def testVoting(self) :
+        self.assertEqual(0, len(self.connection.getActions()))
+        self.party.connect(self.connection);
+        self.party.notifyChange(self.mopacSettings);
+
+        bid = self._findGoodBid()
+        offer = Offer(self.PARTY1, bid)
+        self.party.notifyChange(Voting([offer],{self.PARTY1: 1}))
+        self.assertEqual(1, len(self.connection.getActions()))
+        action = self.connection.getActions()[0]
+        self.assertTrue(isinstance(action,Votes))
+        self.assertEqual(1, len(action.getVotes()))
+        self.assertEqual(bid, next(iter(action.getVotes())).getBid())
+        
+    def _findGoodBid(self)-> Bid:
+        for bid in AllBidsList(self.profile.getDomain()):
+            if self.profile.getUtility(bid) > 0.7:
+                     return bid;
+        raise ValueError("Test can not be done: there is no good bid with utility>0.7");
