Index: geniuswebcore/test/geniusweb/inform/SettingsTest.py
===================================================================
--- geniuswebcore/test/geniusweb/inform/SettingsTest.py	(revision 66)
+++ geniuswebcore/test/geniusweb/inform/SettingsTest.py	(revision 67)
@@ -1,62 +1,84 @@
+from typing import Dict, Any, List
+from geniusweb.inform.Settings import Settings
+from unitpy.GeneralTests import GeneralTests
+from geniusweb.actions.PartyId import PartyId
 from datetime import datetime
+from pyson.ObjectMapper import ObjectMapper
+from geniusweb.references.ProfileRef import ProfileRef
+from uri.uri import URI
+from geniusweb.references.ProtocolRef import ProtocolRef
+from geniusweb.progress.ProgressRounds import ProgressRounds
+from geniusweb.references.Parameters import Parameters
+from geniusweb.references.PartyRef import PartyRef
+import json
+from geniusweb.inform.Inform import Inform
 import unittest
 
-from pyson.ObjectMapper import ObjectMapper
-from uri import URI #type:ignore
+class SettingsTest(unittest.TestCase, GeneralTests[Settings]):
 
-from geniusweb.actions.PartyId import PartyId
-from geniusweb.inform.Inform import Inform
-from geniusweb.inform.Settings import Settings
-from geniusweb.progress.ProgressTime import ProgressTime
-from geniusweb.references.Parameters import Parameters
-from geniusweb.references.ProfileRef import ProfileRef
-from geniusweb.references.ProtocolRef import ProtocolRef
+    id = PartyId("party1")
+    id2 = PartyId("party2")
 
+    asJson = "{\"Settings\":"\
+            + "{\"id\":\"party1\",\"profile\":\"ws:profile1\","\
+            + "\"protocol\":\"ws:localhost/protocol1\","\
+            + "\"progress\":{\"ProgressRounds\":{\"duration\":10,\"currentRound\":0,\"endtime\":999}},"\
+            + "\"parameters\":{}}}"
 
-class SettingsTest(unittest.TestCase):
-    id1 = PartyId("party1")
-    id2 = PartyId("party2")
-    profileref1 = ProfileRef(URI("profile:1"))
-    profileref2 = ProfileRef(URI("profile:2"))
-    protocolref1 = ProtocolRef(URI("protocol:1"))
-    protocolref2 = ProtocolRef(URI("protocol:2"))
-    progress1=ProgressTime(1000, datetime.fromtimestamp(12345678))
-    progress2=ProgressTime(2000, datetime.fromtimestamp(12345678))
-    parameters1=Parameters()
-    parameters2=Parameters({'a':1})
+    date = datetime.fromtimestamp(999/1000.)
+    jackson = ObjectMapper()
 
-    settings  = Settings(id1, profileref1, protocolref1, progress1, parameters1 )
-    settings1  = Settings(id1, profileref1, protocolref1, progress1, parameters1 )
-    settings2  = Settings(id2, profileref1, protocolref1, progress1, parameters1 )
-    settings3  = Settings(id1, profileref2, protocolref1, progress1, parameters1 )
-    settings4  = Settings(id1, profileref1, protocolref2, progress1, parameters1 )
-    settings5  = Settings(id1, profileref1, protocolref1, progress2, parameters1 )
+    # we can't mock because we want to test the serializer
+    profile1 = ProfileRef( URI("ws:profile1"))
+    # jackson.readValue(serialized, Profile.class);
 
-    settings1json={'Settings': {'id': 'party1', 'profile': 'profile:1', 'protocol': 'protocol:1', 'progress': {'ProgressTime': {'duration': 1000, 'start': 12345678000}}, 'parameters': {}}}
+    protocol1 = ProtocolRef(URI("ws:localhost/protocol1"))
+    protocol1a = ProtocolRef(URI("ws:localhost/protocol1"))
+    protocol2 = ProtocolRef(URI("ws:localhost/protocol2"))
+    progress1 = ProgressRounds(10, 0, date)
+    progress1a = ProgressRounds(10, 0, date)
+    progress2 = ProgressRounds(12, 0, date)
 
+    settings1 = Parameters()
+    settings2 = Parameters().With("a", 1)
 
+    negoinfo1 = Settings(id, profile1, protocol1, progress1, settings1)
+    negoinfo1a = Settings(id, profile1, protocol1a, progress1a,settings1)
+    negoinfo2 = Settings(id, profile1, protocol2, progress1, settings1)
+    negoinfo3 = Settings(id, profile1, protocol1, progress2, settings1)
+    negoinfo4 = Settings(id2, profile1, protocol1, progress2, settings1)
+    negoinfo5 = Settings(id, profile1, protocol1, progress1, settings2)
+
+    def getGeneralTestData(self)-> List[List[Settings]] :
+        return [[self.negoinfo1, self.negoinfo1a],
+                [self.negoinfo2], [self.negoinfo3],
+                [self.negoinfo4], [self.negoinfo5]]
+
+    def getGeneralTestStrings(self) -> List[str]:
+        return [
+                "Settings.*party1.*ProtocolRef.*protocol1.*ProgressRounds.*0.*10.*",
+                "Settings.*party1.*ProtocolRef.*protocol2.*ProgressRounds.*0.*10.*",
+                "Settings.*party1.*ProtocolRef.*protocol1.*ProgressRounds.*0.*12.*",
+                "Settings.*party2.*ProtocolRef.*protocol1.*ProgressRounds.*0.*12.*",
+                "Settings.*party1.*ProtocolRef.*protocol1.*ProgressRounds.*0.*10.*"]
+
+    def testSmoke(self): 
+        PartyRef(URI("ws:localhost"))
+    
+    def testNull(self):
+        self.assertRaises(ValueError,lambda: PartyRef(None))
+  
     def testSerialize(self):
-        pyson=ObjectMapper()
-        print(str(pyson.toJson(self.settings1)))
-        self.assertEqual(self.settings1json, pyson.toJson(self.settings1))
+        json1 = self.jackson.toJson(self.negoinfo1)
+        print(json1)
+        self.assertEqual(json.loads(self.asJson), json1)
         
     def testDeserialize(self):
-        pyson=ObjectMapper()
-        self.assertEqual(self.settings1, pyson.parse(self.settings1json, Inform))
-        
-    def testRepr(self):
-        self.assertEqual("Settings[party1,ProfileRef[profile:1],ProtocolRef[protocol:1],ProgressTime[12345678.0 , 1000ms],{}]", repr(self.settings))
-        
-    def testEqual(self):
-        self.assertEqual(self.settings, self.settings1)
-        self.assertNotEqual(self.settings, self.settings2)
-        self.assertNotEqual(self.settings, self.settings3)
-        self.assertNotEqual(self.settings, self.settings4)
-        self.assertNotEqual(self.settings, self.settings5)
-        self.assertEqual(hash(self.settings), hash(self.settings1))
-        self.assertNotEqual(hash(self.settings), hash(self.settings2))
-        self.assertNotEqual(hash(self.settings), hash(self.settings3))
-        self.assertNotEqual(hash(self.settings), hash(self.settings4))
-        self.assertNotEqual(hash(self.settings), hash(self.settings5))
-        
-        
+        p = self.jackson.parse(json.loads(self.asJson), Inform)
+        print(p)
+        self.assertEqual(self.negoinfo1, p)
+
+    def testGeneralDict(self):
+        val = self.jackson.parse(json.loads("{\"a\":0.3,\"b\":{\"x\":3},\"c\":[1,2,3]}"), 
+                                 Dict[str,Any])
+        print(val)
