Index: party/src/test/java/geniusweb/party/CapabilitiesTest.java
===================================================================
--- party/src/test/java/geniusweb/party/CapabilitiesTest.java	(revision 52)
+++ party/src/test/java/geniusweb/party/CapabilitiesTest.java	(revision 1)
@@ -4,7 +4,7 @@
 
 import java.io.IOException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 
@@ -18,6 +18,6 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-import geniusweb.profile.PartialOrdering;
-import geniusweb.profile.utilityspace.LinearAdditive;
+import geniusweb.party.Capabilities;
+import geniusweb.references.ProtocolRef;
 import tudelft.utilities.junit.GeneralTests;
 
@@ -25,20 +25,17 @@
 
 	private Capabilities capabilities1, capabilities1a, capabilities2,
-			capabilities3, capabilities4;
-	private String asJson = "{\"behaviours\":[\"SAOP\"],\"profiles\":[\"geniusweb.profile.utilityspace.LinearAdditive\"]}";
+			capabilities3;
+	private String asJson = "{\"protocols\":[\"ws:localhost/protocol1\"]}";
 
 	@Before
 	public void before() throws URISyntaxException {
-		capabilities1 = new Capabilities(Sets.newSet("SAOP"),
-				Collections.singleton(LinearAdditive.class));
-		capabilities1a = new Capabilities(Sets.newSet("SAOP"),
-				Collections.singleton(LinearAdditive.class));
-		capabilities2 = new Capabilities(Sets.newSet("SEB"),
-				Collections.singleton(LinearAdditive.class));
-		capabilities3 = new Capabilities(Sets.newSet("SEB", "SAOP"),
-				Collections.singleton(LinearAdditive.class));
-		capabilities4 = new Capabilities(Sets.newSet("SAOP"),
-				Collections.singleton(PartialOrdering.class));
-
+		capabilities1 = new Capabilities(Sets
+				.newSet(new ProtocolRef(new URI("ws:localhost/protocol1"))));
+		capabilities1a = new Capabilities(Sets
+				.newSet(new ProtocolRef(new URI("ws:localhost/protocol1"))));
+		capabilities2 = new Capabilities(Sets
+				.newSet(new ProtocolRef(new URI("ws:localhost/protocol2"))));
+		capabilities3 = new Capabilities(Sets
+				.newSet(new ProtocolRef(new URI("ws:localhost/protocol3"))));
 	}
 
@@ -46,6 +43,5 @@
 	public List<List<Capabilities>> getGeneralTestData() {
 		return Arrays.asList(Arrays.asList(capabilities1, capabilities1a),
-				Arrays.asList(capabilities2), Arrays.asList(capabilities3),
-				Arrays.asList(capabilities4));
+				Arrays.asList(capabilities2), Arrays.asList(capabilities3));
 	}
 
@@ -53,13 +49,12 @@
 	public List<String> getGeneralTestStrings() {
 		return Arrays.asList(
-				"Capabilities.*geniusweb.profile.utilityspace.LinearAdditive.*SAOP.*",
-				"Capabilities.*geniusweb.profile.utilityspace.LinearAdditive.*SEB.*",
-				"Capabilities.*geniusweb.profile.utilityspace.LinearAdditive.*SEB.*SAOP.*",
-				"Capabilities.*geniusweb.profile.PartialOrdering.*SAOP.*");
+				"Capabilities.*Protocols=.*ProtocolRef.*protocol1.*",
+				"Capabilities.*Protocols=.*ProtocolRef.*protocol2.*",
+				"Capabilities.*Protocols=.*ProtocolRef.*protocol3.*");
 	}
 
 	@Test(expected = IllegalArgumentException.class)
 	public void nullTest() throws URISyntaxException {
-		new Capabilities(null, Collections.singleton(LinearAdditive.class));
+		new Capabilities(null);
 	}
 
@@ -82,8 +77,3 @@
 	}
 
-	@Test
-	public void behaviours() {
-		assertEquals(Sets.newSet("SEB", "SAOP"), capabilities3.getBehaviours());
-	}
-
 }
Index: party/src/test/java/geniusweb/party/DefaultPartyTest.java
===================================================================
--- party/src/test/java/geniusweb/party/DefaultPartyTest.java	(revision 52)
+++ 	(revision )
@@ -1,103 +1,0 @@
-package geniusweb.party;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import geniusweb.actions.Action;
-import geniusweb.connection.ConnectionEnd;
-import geniusweb.inform.Inform;
-import tudelft.utilities.listener.Listener;
-
-public class DefaultPartyTest {
-
-	private DefaultParty party;
-
-	@Before
-	public void before() {
-		party = new DefaultParty() {
-
-			@Override
-			public void notifyChange(Inform data) {
-				// TODO Auto-generated method stub
-
-			}
-
-			@Override
-			public String getDescription() {
-				// TODO Auto-generated method stub
-				return null;
-			}
-
-			@Override
-			public Capabilities getCapabilities() {
-				// TODO Auto-generated method stub
-				return null;
-			}
-		};
-
-	}
-
-	@Test
-	public void smoke() {
-	}
-
-	@Test
-	public void getReporter() {
-		assertNotNull(party.getReporter());
-	}
-
-	@SuppressWarnings("unchecked")
-	@Test
-	public void connect() {
-
-		ConnectionEnd<Inform, Action> connection = mock(ConnectionEnd.class);
-		party.connect(connection);
-
-		verify(connection, times(1)).addListener(any(Listener.class));
-		assertNotNull(party.getConnection());
-	}
-
-	@SuppressWarnings("unchecked")
-	@Test
-	public void disconnect() {
-
-		ConnectionEnd<Inform, Action> connection = mock(ConnectionEnd.class);
-		party.connect(connection);
-
-		party.disconnect();
-		verify(connection, times(1)).removeListener(any(Listener.class));
-		assertNull(party.getConnection());
-
-		// check second disconnect is ignored
-		party.disconnect();
-		verify(connection, times(1)).removeListener(any(Listener.class));
-		assertNull(party.getConnection());
-
-	}
-
-	@SuppressWarnings("unchecked")
-	@Test
-	public void terminate() {
-
-		ConnectionEnd<Inform, Action> connection = mock(ConnectionEnd.class);
-		party.connect(connection);
-
-		party.terminate();
-		verify(connection, times(1)).removeListener(any(Listener.class));
-		assertNull(party.getConnection());
-
-		// check second terminate is ignored
-		party.terminate();
-		verify(connection, times(1)).removeListener(any(Listener.class));
-		assertNull(party.getConnection());
-
-	}
-
-}
Index: party/src/test/java/geniusweb/party/inform/ActionDoneTest.java
===================================================================
--- party/src/test/java/geniusweb/party/inform/ActionDoneTest.java	(revision 1)
+++ party/src/test/java/geniusweb/party/inform/ActionDoneTest.java	(revision 1)
@@ -0,0 +1,101 @@
+package geniusweb.party.inform;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Accept;
+import geniusweb.actions.PartyId;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.issuevalue.NumberValue;
+import geniusweb.issuevalue.Value;
+import geniusweb.party.inform.ActionDone;
+import geniusweb.party.inform.Inform;
+import tudelft.utilities.junit.GeneralTests;
+
+public class ActionDoneTest extends GeneralTests<ActionDone> {
+
+	private ActionDone finished1, finished1a, finished2;
+
+	private String asJson = "{\"ActionDone\":{\"action\":{\"accept\":{\"actor\":\"me\",\"bid\":{\"issuevalues\":{\"issue3\":9012,\"issue2\":1,\"issue1\":\"b\"}}}}}}";
+
+	private PartyId me = new PartyId("me");
+
+	@Before
+	public void before() throws URISyntaxException {
+		final String ISSUE1 = "issue1";
+		final String ISSUE2 = "issue2";
+		final Value VALUE1 = new DiscreteValue("value1");
+		final Value VALUE2 = new NumberValue("10");
+
+		Map<String, Value> issuevalues = new HashMap<>();
+		issuevalues.put(ISSUE1, new DiscreteValue("b"));
+		issuevalues.put(ISSUE2, new NumberValue(BigDecimal.ONE));
+		issuevalues.put("issue3", new NumberValue(new BigDecimal("9012")));
+		Bid bid = new Bid(issuevalues);
+
+		Map<String, Value> issuevaluesb = new HashMap<>();
+		issuevaluesb.put(ISSUE1, new DiscreteValue("b"));
+		issuevaluesb.put(ISSUE2, new NumberValue(BigDecimal.ONE));
+		Bid bidb = new Bid(issuevaluesb);
+
+		// bidc and bidd have values swapped, so different issuevalues.
+		Map<String, Value> issuevaluesc = new HashMap<>();
+		issuevaluesc.put(ISSUE1, VALUE1);
+		issuevaluesc.put(ISSUE2, VALUE2);
+
+		finished1 = new ActionDone(new Accept(me, bid));
+		finished1a = new ActionDone(new Accept(me, bid));
+		finished2 = new ActionDone(new Accept(me, bidb));
+	}
+
+	@Override
+	public List<List<ActionDone>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(finished1, finished1a),
+				Arrays.asList(finished2));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("ActionDone.*Accept.*", "ActionDone.*Accept.*");
+	}
+
+	@Test
+	public void nullTest() throws URISyntaxException {
+		new ActionDone(null);
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
+
+		String json = jackson.writeValueAsString(finished1);
+		System.out.println(json);
+		assertEquals(asJson, json);
+	}
+
+	@Test
+	public void testDeserialize()
+			throws JsonParseException, JsonMappingException, IOException {
+		ObjectMapper jackson = new ObjectMapper();
+		ActionDone p = (ActionDone) jackson.readValue(asJson, Inform.class);
+		System.out.println(p);
+		assertEquals(finished1, p);
+	}
+
+}
Index: party/src/test/java/geniusweb/party/inform/FinishedTest.java
===================================================================
--- party/src/test/java/geniusweb/party/inform/FinishedTest.java	(revision 1)
+++ party/src/test/java/geniusweb/party/inform/FinishedTest.java	(revision 1)
@@ -0,0 +1,101 @@
+package geniusweb.party.inform;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.issuevalue.NumberValue;
+import geniusweb.issuevalue.Value;
+import geniusweb.party.inform.Finished;
+import geniusweb.party.inform.Inform;
+import tudelft.utilities.junit.GeneralTests;
+
+public class FinishedTest extends GeneralTests<Finished> {
+
+	private Finished finished1, finished1a, finished2, finished3;
+
+	private String asJson = "{\"Finished\":{\"agreedBid\":{\"issuevalues\":{\"issue3\":9012,\"issue2\":1,\"issue1\":\"b\"}}}}";
+
+	@Before
+	public void before() throws URISyntaxException {
+		final String ISSUE1 = "issue1";
+		final String ISSUE2 = "issue2";
+		final Value VALUE1 = new DiscreteValue("value1");
+		final Value VALUE2 = new NumberValue("10");
+
+		Map<String, Value> issuevalues = new HashMap<>();
+		issuevalues.put(ISSUE1, new DiscreteValue("b"));
+		issuevalues.put(ISSUE2, new NumberValue(BigDecimal.ONE));
+		issuevalues.put("issue3", new NumberValue(new BigDecimal("9012")));
+		Bid bid = new Bid(issuevalues);
+
+		Map<String, Value> issuevaluesb = new HashMap<>();
+		issuevaluesb.put(ISSUE1, new DiscreteValue("b"));
+		issuevaluesb.put(ISSUE2, new NumberValue(BigDecimal.ONE));
+		Bid bidb = new Bid(issuevaluesb);
+
+		// bidc and bidd have values swapped, so different issuevalues.
+		Map<String, Value> issuevaluesc = new HashMap<>();
+		issuevaluesc.put(ISSUE1, VALUE1);
+		issuevaluesc.put(ISSUE2, VALUE2);
+		Bid bidc = new Bid(issuevaluesc);
+
+		finished1 = new Finished(bid);
+		finished1a = new Finished(bid);
+		finished2 = new Finished(bidb);
+		finished3 = new Finished(bidc);
+	}
+
+	@Override
+	public List<List<Finished>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(finished1, finished1a),
+				Arrays.asList(finished2), Arrays.asList(finished3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("Finished.*issue3=9012.*issue2=1.*issue1=\"b\".*",
+				"Finished.*issue2=1.*issue1=\"b\".*",
+				"Finished.*issue2=10.*issue1=\"value1\".*");
+	}
+
+	@Test
+	public void nullTest() throws URISyntaxException {
+		new Finished(null);
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
+
+		String json = jackson.writeValueAsString(finished1);
+		System.out.println(json);
+		assertEquals(asJson, json);
+	}
+
+	@Test
+	public void testDeserialize()
+			throws JsonParseException, JsonMappingException, IOException {
+		ObjectMapper jackson = new ObjectMapper();
+		Finished p = (Finished) jackson.readValue(asJson, Inform.class);
+		System.out.println(p);
+		assertEquals(finished1, p);
+	}
+
+}
Index: party/src/test/java/geniusweb/party/inform/NegotiationInfoTest.java
===================================================================
--- party/src/test/java/geniusweb/party/inform/NegotiationInfoTest.java	(revision 1)
+++ party/src/test/java/geniusweb/party/inform/NegotiationInfoTest.java	(revision 1)
@@ -0,0 +1,116 @@
+package geniusweb.party.inform;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.PartyId;
+import geniusweb.party.inform.Inform;
+import geniusweb.party.inform.Settings;
+import geniusweb.progress.ProgressRounds;
+import geniusweb.references.PartyRef;
+import geniusweb.references.ProfileRef;
+import geniusweb.references.ProtocolRef;
+import tudelft.utilities.junit.GeneralTests;
+
+public class NegotiationInfoTest extends GeneralTests<Settings> {
+
+	private PartyId id = new PartyId("party1");
+	private PartyId id2 = new PartyId("party2");
+
+	private final String asJson = "{\"Settings\":"
+			+ "{\"id\":\"party1\",\"profile\":\"ws:profile1\","
+			+ "\"protocol\":\"ws:localhost/protocol1\","
+			+ "\"progress\":{\"rounds\":{\"duration\":10,\"currentRound\":0,\"endtime\":999}}}}";
+
+	private Settings negoinfo1;
+	private Settings negoinfo1a;
+	private Settings negoinfo2;
+	private Settings negoinfo3;
+	private Settings negoinfo4;
+	private final Date date = new Date(999);
+
+	@Before
+	public void before() throws URISyntaxException, JsonParseException,
+			JsonMappingException, IOException {
+		// we can't mock because we want to test the serializer
+		ObjectMapper jackson = new ObjectMapper();
+		ProfileRef profile1 = new ProfileRef(new URI("ws:profile1"));
+		// jackson.readValue(serialized, Profile.class);
+
+		ProtocolRef protocol1 = new ProtocolRef(
+				new URI("ws:localhost/protocol1"));
+		ProtocolRef protocol1a = new ProtocolRef(
+				new URI("ws:localhost/protocol1"));
+		ProtocolRef protocol2 = new ProtocolRef(
+				new URI("ws:localhost/protocol2"));
+		ProgressRounds progress1 = new ProgressRounds(10, 0, date);
+		ProgressRounds progress1a = new ProgressRounds(10, 0, date);
+		ProgressRounds progress2 = new ProgressRounds(12, 0, date);
+
+		negoinfo1 = new Settings(id, profile1, protocol1, progress1);
+		negoinfo1a = new Settings(id, profile1, protocol1a, progress1a);
+		negoinfo2 = new Settings(id, profile1, protocol2, progress1);
+		negoinfo3 = new Settings(id, profile1, protocol1, progress2);
+		negoinfo4 = new Settings(id2, profile1, protocol1, progress2);
+	}
+
+	@Override
+	public List<List<Settings>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(negoinfo1, negoinfo1a),
+				Arrays.asList(negoinfo2), Arrays.asList(negoinfo3),
+				Arrays.asList(negoinfo4));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"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.*");
+
+	}
+
+	@Test
+	public void smokeTest() throws URISyntaxException {
+		new PartyRef(new URI("ws:localhost"));
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void nullTest() throws URISyntaxException {
+		new PartyRef((URI) null);
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
+
+		String json = jackson.writeValueAsString(negoinfo1);
+		System.out.println(json);
+		assertEquals(asJson, json);
+	}
+
+	@Test
+	public void testDeserialize()
+			throws JsonParseException, JsonMappingException, IOException {
+		ObjectMapper jackson = new ObjectMapper();
+		Settings p = (Settings) jackson.readValue(asJson, Inform.class);
+		System.out.println(p);
+		assertEquals(negoinfo1, p);
+	}
+
+}
Index: party/src/test/java/geniusweb/party/inform/YourTurnTest.java
===================================================================
--- party/src/test/java/geniusweb/party/inform/YourTurnTest.java	(revision 1)
+++ party/src/test/java/geniusweb/party/inform/YourTurnTest.java	(revision 1)
@@ -0,0 +1,72 @@
+package geniusweb.party.inform;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.party.inform.Inform;
+import geniusweb.party.inform.YourTurn;
+import tudelft.utilities.junit.GeneralTests;
+
+public class YourTurnTest extends GeneralTests<YourTurn> {
+
+	private YourTurn yourturn1, yourturn1b;
+
+	private String asJson = "{\"YourTurn\":{}}";
+
+	private YourTurn yourturnb;
+
+	@Before
+	public void before() throws URISyntaxException {
+
+		yourturn1 = new YourTurn();
+		yourturn1b = new YourTurn();
+		yourturnb = new YourTurn() {
+			@Override
+			public int hashCode() {
+				return 2;
+			}
+		};
+	}
+
+	@Override
+	public List<List<YourTurn>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(yourturn1, yourturn1b),
+				Arrays.asList(yourturnb));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("YourTurn*", "YourTurn*");
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
+
+		String json = jackson.writeValueAsString(yourturn1);
+		System.out.println(json);
+		assertEquals(asJson, json);
+	}
+
+	@Test
+	public void testDeserialize()
+			throws JsonParseException, JsonMappingException, IOException {
+		ObjectMapper jackson = new ObjectMapper();
+		YourTurn p = (YourTurn) jackson.readValue(asJson, Inform.class);
+		System.out.println(p);
+		assertEquals(yourturn1, p);
+	}
+
+}
