Index: events/src/test/java/actions/AcceptTest.java
===================================================================
--- events/src/test/java/actions/AcceptTest.java	(revision 1)
+++ events/src/test/java/actions/AcceptTest.java	(revision 1)
@@ -0,0 +1,94 @@
+package actions;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Accept;
+import geniusweb.actions.Action;
+import geniusweb.actions.PartyId;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.issuevalue.NumberValue;
+import geniusweb.issuevalue.Value;
+import tudelft.utilities.junit.GeneralTests;
+
+public class AcceptTest extends GeneralTests<Accept> {
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final PartyId id = new PartyId("party1");
+	private static final PartyId id2 = new PartyId("party2");
+	private final static Map<String, Value> issuevalues = new HashMap<String, Value>();
+	private final static Map<String, Value> issuevaluesb = new HashMap<String, Value>();
+	private static Bid bid;
+	private static Bid bidb;
+	private final static String ISSUE1 = "issue1";
+	private final static Value VALUE1 = new DiscreteValue("value1");
+	private final static String ISSUE2 = "issue2";
+	private final static Value VALUE2 = new NumberValue("10");
+	// issue 2 is NUMBER and thus serializes with leading '='
+	private final String acceptstring = "{\"accept\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}}}}";
+
+	private static Accept accept, accept1, accept2, acceptb;
+
+	static {
+		issuevalues.put(ISSUE1, VALUE1);
+		issuevalues.put(ISSUE2, VALUE2);
+		bid = new Bid(issuevalues);
+		accept = new Accept(id, bid);
+		accept1 = new Accept(id, bid);
+
+		accept2 = new Accept(id2, bid);
+
+		// values swapped, so different issuevalues.
+		issuevaluesb.put(ISSUE1, VALUE2);
+		issuevaluesb.put(ISSUE2, VALUE2);
+		bidb = new Bid(issuevaluesb);
+		acceptb = new Accept(id, bidb);
+
+	}
+
+	@Override
+	public List<List<Accept>> getGeneralTestData() {
+		List<List<Accept>> list = new LinkedList<>();
+		list.add(Arrays.asList(accept, accept1));
+		list.add(Arrays.asList(accept2));
+		list.add(Arrays.asList(acceptb));
+		return list;
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("Accept.*" + id + ".*]", "Accept.*" + id2 + ".*]",
+				"Accept.*" + id + ".*]");
+	}
+
+	@Before
+	public void before() {
+
+	}
+
+	@Test
+	public void serializeAcceptTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(accept));
+		assertEquals(acceptstring, jackson.writeValueAsString(accept));
+	}
+
+	@Test
+	public void deserializeAcceptTest() throws IOException {
+		Action act = jackson.readValue(acceptstring, Action.class);
+		assertEquals(accept, act);
+	}
+
+}
Index: events/src/test/java/actions/EndNegoTest.java
===================================================================
--- events/src/test/java/actions/EndNegoTest.java	(revision 1)
+++ events/src/test/java/actions/EndNegoTest.java	(revision 1)
@@ -0,0 +1,53 @@
+package actions;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Action;
+import geniusweb.actions.EndNegotiation;
+import geniusweb.actions.PartyId;
+import tudelft.utilities.junit.GeneralTests;
+
+public class EndNegoTest extends GeneralTests<EndNegotiation> {
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private final PartyId id = new PartyId("party1");
+	private final PartyId idb = new PartyId("party2");
+
+	private final EndNegotiation endnego = new EndNegotiation(id);
+	private final EndNegotiation endnego1 = new EndNegotiation(id);
+	private final EndNegotiation endnegob = new EndNegotiation(idb);
+
+	private final String endnegostring = "{\"endnegotiation\":{\"actor\":\"party1\"}}";
+
+	@Override
+	public List<List<EndNegotiation>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(endnego, endnego1), Arrays.asList(endnegob));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("EndNegotiation\\[.*" + id + ".*\\]", "EndNegotiation\\[.*" + idb + ".*\\]");
+	}
+
+	@Test
+	public void serializeEndNegoTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(endnego));
+		assertEquals(endnegostring, jackson.writeValueAsString(endnego));
+	}
+
+	@Test
+	public void deserializeEndNegoTest() throws IOException {
+		Action act = jackson.readValue(endnegostring, Action.class);
+		assertEquals(endnego, act);
+	}
+
+}
Index: events/src/test/java/actions/OfferTest.java
===================================================================
--- events/src/test/java/actions/OfferTest.java	(revision 1)
+++ events/src/test/java/actions/OfferTest.java	(revision 1)
@@ -0,0 +1,82 @@
+package actions;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Action;
+import geniusweb.actions.Offer;
+import geniusweb.actions.PartyId;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.issuevalue.NumberValue;
+import geniusweb.issuevalue.Value;
+import tudelft.utilities.junit.GeneralTests;
+
+public class OfferTest extends GeneralTests<Offer> {
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final PartyId id = new PartyId("party1");
+	private static final Map<String, Value> issuevalues = new HashMap<String, Value>();
+	private static final Map<String, Value> issuevaluesb = new HashMap<String, Value>();
+	private static Bid bid;
+	private static Bid bidb;
+	private static final String ISSUE1 = "issue1";
+	private static final Value VALUE1 = new DiscreteValue("value1");
+	private static final String ISSUE2 = "issue2";
+	private static final Value VALUE2 = new NumberValue("10");
+	private static final String acceptstring = "{\"offer\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}}}}";
+
+	private static Offer offer;
+	private static Offer offer1;
+	private static Offer offerb;
+
+	static {
+		issuevalues.put(ISSUE1, VALUE1);
+		issuevalues.put(ISSUE2, VALUE2);
+		bid = new Bid(issuevalues);
+		offer = new Offer(id, bid);
+		offer1 = new Offer(id, bid);
+
+		// values swapped, so different issuevalues.
+		issuevaluesb.put(ISSUE1, VALUE2);
+		issuevaluesb.put(ISSUE2, VALUE2);
+		bidb = new Bid(issuevaluesb);
+		offerb = new Offer(id, bidb);
+
+	}
+
+	@Override
+	public List<List<Offer>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(offer, offer1),
+				Arrays.asList(offerb));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("Offer\\[.*" + id + ".*Bid.*\\]",
+				"Offer\\[.*" + id + ".*Bid.*\\]");
+	}
+
+	@Test
+	public void serializeAcceptTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(offer));
+		assertEquals(acceptstring, jackson.writeValueAsString(offer));
+	}
+
+	@Test
+	public void deserializeAcceptTest() throws IOException {
+		Action act = jackson.readValue(acceptstring, Action.class);
+		assertEquals(offer, act);
+	}
+
+}
Index: events/src/test/java/actions/PartyIdTest.java
===================================================================
--- events/src/test/java/actions/PartyIdTest.java	(revision 1)
+++ events/src/test/java/actions/PartyIdTest.java	(revision 1)
@@ -0,0 +1,68 @@
+package actions;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+import geniusweb.actions.PartyId;
+import tudelft.utilities.junit.GeneralTests;
+
+public class PartyIdTest extends GeneralTests<PartyId> {
+	private final PartyId id = new PartyId("party1");
+	private final PartyId id1 = new PartyId("party1");
+	private final PartyId idb = new PartyId("party2");
+
+	@Override
+	public List<List<PartyId>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(id, id1), Arrays.asList(idb));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("party1", "party2");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testRestrictions() {
+		new PartyId("");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testRestrictions2() {
+		new PartyId("@2");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testRestrictions3() {
+		new PartyId("_12");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testRestrictions4() {
+		new PartyId("12A");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testRestrictions5() {
+		new PartyId(" fds ");
+	}
+
+	@Test
+	public void testGetName() {
+		assertEquals("party1", id.getName());
+	}
+
+	@Test
+	public void testRestrictions6() {
+		new PartyId("A_1_23_ok");
+	}
+
+	@Test
+	public void testRestrictions7() {
+		new PartyId("a_1_23_ok");
+	}
+
+}
Index: events/src/test/java/actions/PartyIdTest1.java
===================================================================
--- events/src/test/java/actions/PartyIdTest1.java	(revision 1)
+++ events/src/test/java/actions/PartyIdTest1.java	(revision 1)
@@ -0,0 +1,73 @@
+package actions;
+
+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.actions.PartyId;
+import tudelft.utilities.junit.GeneralTests;
+
+public class PartyIdTest1 extends GeneralTests<PartyId> {
+
+	private PartyId party1, party1a, party2, party3;
+	private String asJson = "\"party1\"";
+
+	@Before
+	public void before() throws URISyntaxException {
+		party1 = new PartyId("party1");
+		party1a = new PartyId("party1");
+		party2 = new PartyId("party2");
+		party3 = new PartyId("party3");
+	}
+
+	@Override
+	public List<List<PartyId>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(party1, party1a),
+				Arrays.asList(party2), Arrays.asList(party3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("party1", "party2", "party3");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void smokeTest() throws URISyntaxException {
+		new PartyId("*Csh789&@#^!^@^&");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void nullTest() throws URISyntaxException {
+		new PartyId(null);
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
+
+		String json = jackson.writeValueAsString(party1);
+		System.out.println(json);
+		assertEquals(asJson, json);
+	}
+
+	@Test
+	public void testDeserialize()
+			throws JsonParseException, JsonMappingException, IOException {
+		ObjectMapper jackson = new ObjectMapper();
+		PartyId p = jackson.readValue(asJson, PartyId.class);
+		System.out.println(p);
+		assertEquals(party1, p);
+	}
+
+}
Index: events/src/test/java/events/ActionEventTest.java
===================================================================
--- events/src/test/java/events/ActionEventTest.java	(revision 1)
+++ events/src/test/java/events/ActionEventTest.java	(revision 1)
@@ -0,0 +1,73 @@
+package events;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Action;
+import geniusweb.actions.EndNegotiation;
+import geniusweb.actions.PartyId;
+import geniusweb.events.ActionEvent;
+import geniusweb.events.NegotiationEvent;
+import tudelft.utilities.junit.GeneralTests;
+
+public class ActionEventTest extends GeneralTests<ActionEvent> {
+	private static final long NOW = 101l;
+	private final ObjectMapper jackson = new ObjectMapper();
+	private final String string = "{\"actionevent\":{\"action\":{\"endnegotiation\":{\"actor\":\"party1\"}},\"time\":101}}";
+	private final PartyId id = new PartyId("party1");
+	private final Action action = new EndNegotiation(id);
+	private final ActionEvent evt = new ActionEvent(action, NOW);
+	private final ActionEvent evt1 = new ActionEvent(action, NOW);
+	private final ActionEvent evtb = new ActionEvent(action, NOW + 1);
+
+	@Override
+	public List<List<ActionEvent>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(evt, evt1), Arrays.asList(evtb));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("ActionEvent\\[.*" + NOW + ".*EndNegotiation.*\\]",
+				"ActionEvent\\[.*" + (NOW + 1) + ".*EndNegotiation.*\\]");
+	}
+
+	@Test
+	public void smoketest() {
+		Action action = mock(EndNegotiation.class);
+		ActionEvent evt = new ActionEvent(action, 0l);
+	}
+
+	@Test
+	public void serializeTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(evt));
+		assertEquals(string, jackson.writeValueAsString(evt));
+	}
+
+	@Test
+	public void deserializeTestReadActionEvent() throws IOException {
+		ActionEvent evt1 = jackson.readValue(string, ActionEvent.class);
+		// compare fields, as evt is a derived/new inner class
+		assertEquals(EndNegotiation.class, evt1.getAction().getClass());
+		assertEquals((Long) 101l, evt1.getTime());
+	}
+
+	@Test
+	public void deserializeTestReadEvent() throws IOException {
+		NegotiationEvent evt1 = jackson.readValue(string,
+				NegotiationEvent.class);
+		assertEquals(ActionEvent.class, evt1.getClass());
+		ActionEvent ev1 = (ActionEvent) evt1;
+		assertEquals(EndNegotiation.class, ev1.getAction().getClass());
+		assertEquals((Long) 101l, ev1.getTime());
+	}
+
+}
Index: events/src/test/java/events/SessionStartedTest.java
===================================================================
--- events/src/test/java/events/SessionStartedTest.java	(revision 1)
+++ events/src/test/java/events/SessionStartedTest.java	(revision 1)
@@ -0,0 +1,97 @@
+package events;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.experimental.theories.DataPoint;
+import org.junit.experimental.theories.DataPoints;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.PartyId;
+import geniusweb.events.NegotiationEvent;
+import geniusweb.events.SessionStarted;
+import tudelft.utilities.junit.GeneralTests;
+
+public class SessionStartedTest extends GeneralTests<SessionStarted> {
+
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final Long SESSIONNR = 1l;
+	protected static final Long NOW = (long) 101;
+	protected static final Long NOW1 = NOW + 1;
+
+	private static final PartyId PARTY1 = new PartyId("party1");
+	private static final PartyId PARTY2 = new PartyId("party2");
+
+	private static List<PartyId> parties = Arrays.asList(PARTY1, PARTY2);
+
+	private static final SessionStarted sessionStartedLater = new SessionStarted(
+			SESSIONNR, parties, NOW1);
+	private static final SessionStarted othersessionStarted = new SessionStarted(
+			SESSIONNR + 1, parties, NOW);
+
+	public static SessionStarted sessionStarted = new SessionStarted(SESSIONNR,
+			parties, NOW);
+	private static final SessionStarted sessionStarted1 = new SessionStarted(
+			SESSIONNR, parties, NOW);
+	// jackson expected format.
+	private static String sessionstartedstring = "{\"sessionstarted\":{\"sessionNumber\":1,\"parties\":[\"party1\",\"party2\"],\"time\":101}}";
+	// "{\"sessionstarted\":{\"time\":101,\"sessionNumber\":1,\"parties\":[\"party1\",\"party2\"]}}";
+	public static String expectedstring = "SessionStarted.*101.*";
+
+	@Override
+	public List<List<SessionStarted>> getGeneralTestData() {
+		List<List<SessionStarted>> list = new LinkedList<>();
+		list.add(Arrays.asList(sessionStarted, sessionStarted1));
+		list.add(Arrays.asList(sessionStartedLater));
+		list.add(Arrays.asList(othersessionStarted));
+		return list;
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("SessionStarted.*" + SESSIONNR + ".*" + NOW + ".*",
+				"SessionStarted.*" + SESSIONNR + ".*" + NOW1 + ".*",
+				"SessionStarted.*" + (SESSIONNR + 1) + ".*" + NOW + ".*");
+	}
+
+	@DataPoints("equal")
+	public static SessionStarted[] equal() {
+		return new SessionStarted[] { sessionStarted, sessionStarted1 };
+	}
+
+	@DataPoints("notequal")
+	public static SessionStarted[] notequal() {
+		return new SessionStarted[] { sessionStartedLater,
+				sessionStartedLater };
+	}
+
+	@DataPoint("equalstring")
+
+	@Test
+	public void serializeStartedTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(sessionStarted));
+		assertEquals(sessionstartedstring,
+				jackson.writeValueAsString(sessionStarted));
+	}
+
+	@Test
+	public void deserializeStartedTest() throws IOException {
+		NegotiationEvent evt = jackson.readValue(sessionstartedstring,
+				NegotiationEvent.class);
+		assertEquals(SessionStarted.class, evt.getClass());
+		SessionStarted event = (SessionStarted) evt;
+		// compare fields, as sessionended is a derived/new inner class
+		assertEquals(NOW, event.getTime());
+		assertEquals(SESSIONNR, event.getSessionNumber());
+		assertEquals(2, event.getParties().size());
+	}
+
+}
Index: events/src/test/java/events/TournamentStartedTest.java
===================================================================
--- events/src/test/java/events/TournamentStartedTest.java	(revision 1)
+++ events/src/test/java/events/TournamentStartedTest.java	(revision 1)
@@ -0,0 +1,77 @@
+package events;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.events.NegotiationEvent;
+import geniusweb.events.TournamentStarted;
+import tudelft.utilities.junit.GeneralTests;
+
+public class TournamentStartedTest extends GeneralTests<TournamentStarted> {
+
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final Long SESSIONNR = 1l;
+	protected static final Long NOW = (long) 101;
+	protected static final Long NOW1 = NOW + 1;
+	private static final Long NSESSIONS = 5l;
+
+	private static TournamentStarted tournamentStarted = new TournamentStarted(NSESSIONS, NOW);
+	private static TournamentStarted tournamentStarteda = new TournamentStarted(NSESSIONS, NOW);
+	private TournamentStarted otherTournamentStarted = new TournamentStarted(NSESSIONS + 1, NOW);
+	private TournamentStarted tournamentStartedLater = new TournamentStarted(NSESSIONS, NOW1);
+
+	private String tournamentstartedstring = "{\"tournamentstarted\":{\"time\":101,\"numberOfSessions\":5}}";
+
+	@Override
+	public List<List<TournamentStarted>> getGeneralTestData() {
+		List<List<TournamentStarted>> list = new LinkedList<>();
+		list.add(Arrays.asList(tournamentStarted, tournamentStarteda));
+		list.add(Arrays.asList(otherTournamentStarted));
+		list.add(Arrays.asList(tournamentStartedLater));
+		return list;
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("TournamentStarted\\[.*" + NOW + ".*" + NSESSIONS + ".*\\]",
+				"TournamentStarted\\[.*" + NOW + ".*" + (NSESSIONS + 1) + ".*\\]",
+				"TournamentStarted\\[.*" + NOW1 + ".*" + NSESSIONS + ".*\\]");
+	}
+
+	@Test
+	public void serializeTournamentStartedTest() throws JsonProcessingException {
+		System.out.println(jackson.writeValueAsString(tournamentStarted));
+		assertEquals(tournamentstartedstring, jackson.writeValueAsString(tournamentStarted));
+	}
+
+	@Test
+	public void deserializeTournamentStartedTest() throws IOException {
+		NegotiationEvent evt = jackson.readValue(tournamentstartedstring, NegotiationEvent.class);
+		assertEquals(TournamentStarted.class, evt.getClass());
+		TournamentStarted event = (TournamentStarted) evt;
+		// compare fields, as sessionended is a derived/new inner class
+		assertEquals(NSESSIONS, event.getNumberOfSessions());
+		assertEquals(NOW, event.getTime());
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testNullTime() {
+		new TournamentStarted(NSESSIONS, null);
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testNegativeTime() {
+		new TournamentStarted(NSESSIONS, -1l);
+	}
+
+}
