Index: src/test/java/geniusweb/clienttest/EmbeddedTomcat.java
===================================================================
--- src/test/java/geniusweb/clienttest/EmbeddedTomcat.java	(revision 43)
+++ src/test/java/geniusweb/clienttest/EmbeddedTomcat.java	(revision 1)
@@ -11,6 +11,5 @@
 	public void start() {
 		try {
-			// If I don't want to copy files around then the base directory must
-			// be '.'
+			// If I don't want to copy files around then the base directory must be '.'
 			String baseDir = ".";
 			tomcat.setPort(8080);
@@ -30,33 +29,21 @@
 			tomcat.destroy();
 			// Tomcat creates a work folder where the temporary files are stored
+			// FileUtils.deleteDirectory(new File("work"));
 		} catch (LifecycleException e) {
 			throw new RuntimeException(e);
+//		} catch (IOException e) {
+//			throw new RuntimeException(e);
 		}
 	}
 
-	/**
-	 * Deploys the webapp contained in this project
-	 * 
-	 * @param appName the name to use on the server
-	 */
 	public void deploy(String appName) {
-		deployWar(appName, new File("src/main/webapp"));
-	}
-
-	/**
-	 * Deploys the webapp in the given war
-	 * 
-	 * @param appName the name to use on the server
-	 * @param warfile the warfile to deploy. Should include ".war" extension.
-	 */
-	public void deployWar(String appName, File warfile) {
-		tomcat.addWebapp(tomcat.getHost(), "/" + appName,
-				warfile.getAbsolutePath());
-
+		// tomcat.addWebapp(tomcat.getHost(), "/" + appName, new
+		// File("src/main/webapp").getAbsolutePath());
+		tomcat.addWebapp(tomcat.getHost(), "/" + appName, new File("src/main/webapp").getAbsolutePath());
 	}
 
 	public String getApplicationUrl(String appName) {
-		return String.format("http://%s:%d/%s", tomcat.getHost().getName(),
-				tomcat.getConnector().getLocalPort(), appName);
+		return String.format("http://%s:%d/%s", tomcat.getHost().getName(), tomcat.getConnector().getLocalPort(),
+				appName);
 	}
 }
Index: src/test/java/geniusweb/clienttest/JavaClientTest.java
===================================================================
--- src/test/java/geniusweb/clienttest/JavaClientTest.java	(revision 43)
+++ src/test/java/geniusweb/clienttest/JavaClientTest.java	(revision 1)
@@ -5,8 +5,6 @@
 
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 
 import org.junit.AfterClass;
@@ -15,6 +13,4 @@
 import org.python.util.PythonInterpreter;
 
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.neovisionaries.ws.client.WebSocket;
 import com.neovisionaries.ws.client.WebSocketAdapter;
@@ -28,6 +24,15 @@
 	private static final String JSON = "\\{\"ws.*/jobs\":\\[\"ws.*/jobs/jobs1\".*\"ws.*/jobs/jobs2\"\\]\\}";
 
-	private static final String JOBS1PROFILE = "{\"LinearAdditiveUtilitySpace\":{\"domain\":{\"name\":\"jobs\",\"issuesValues\":{\"lease car\":{\"values\":[\"yes\",\"no\"]},\"permanent contract\":{\"values\":[\"yes\",\"no\"]},\"career development opportunities\":{\"values\":[\"low\",\"medium\",\"high\"]},\"fte\":{\"values\":[\"0.6\",\"0.8\",\"1.0\"]},\"salary\":{\"values\":[\"2000\",\"2500\",\"3000\",\"3500\",\"4000\"]},\"work from home\":{\"values\":[\"0\",\"1\",\"2\"]}}},\"name\":\"jobs1\",\"issueUtilities\":{\"lease car\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},\"permanent contract\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},\"career development opportunities\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"high\":1,\"low\":0,\"medium\":0.5}}},\"fte\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"1.0\":0.75,\"0.6\":0.25,\"0.8\":0.5}}},\"salary\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"4000\":1.0,\"2500\":0.25,\"3500\":0.75,\"2000\":0,\"3000\":0.3}}},\"work from home\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"1\":0.5,\"2\":0.666666666666,\"0\":0.333333333}}}},\"issueWeights\":{\"lease car\":0.06,\"permanent contract\":0.16,\"career development opportunities\":0.04,\"fte\":0.32,\"salary\":0.24,\"work from home\":0.18},\"reservationBid\":{\"issuevalues\":{\"lease car\":\"no\",\"permanent contract\":\"yes\",\"career development opportunities\":\"medium\",\"fte\":\"0.8\",\"salary\":\"3500\",\"work from home\":\"1\"}}}}";
-
+	private static final String JOBS1PROFILE = "{\"LinearAdditiveUtilitySpace\":{"
+			+ "\"domain\":{\"name\":\"jobs\",\"issuesValues\":{\"lease car\":{\"values\":[\"yes\",\"no\"]},\"permanent contract\":{\"values\":[\"yes\",\"no\"]},\"career development opportunities\":{\"values\":[\"low\",\"medium\",\"high\"]},\"fte\":{\"values\":[\"0.6\",\"0.8\",\"1.0\"]},\"salary\":{\"values\":[\"2000\",\"2500\",\"3000\",\"3500\",\"4000\"]},\"work from home\":{\"values\":[\"0\",\"1\",\"2\"]}}},"
+			+ "\"name\":\"jobs1\"," + "\"issueUtilities\":{"
+			+ "\"lease car\":{\"discreteutils\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
+			+ "\"permanent contract\":{\"discreteutils\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
+			+ "\"career development opportunities\":{\"discreteutils\":{\"valueUtilities\":{\"high\":1,\"low\":0,\"medium\":0.5}}},"
+			+ "\"fte\":{\"discreteutils\":{\"valueUtilities\":{\"1.0\":0.75,\"0.6\":0.25,\"0.8\":0.5}}},"
+			+ "\"salary\":{\"discreteutils\":{\"valueUtilities\":{\"4000\":1.0,\"2500\":0.25,\"3500\":0.75,\"2000\":0,\"3000\":0.3}}},"
+			+ "\"work from home\":{\"discreteutils\":{\"valueUtilities\":{\"1\":0.5,\"2\":0.666666666666,\"0\":0.333333333}}}},"
+			+ "\"issueWeights\":{\"lease car\":0.06,\"permanent contract\":0.16,\"career development opportunities\":0.04,\"fte\":0.32,\"salary\":0.24,\"work from home\":0.18},"
+			+ "\"reservationBid\":{\"issuevalues\":{\"lease car\":\"no\",\"permanent contract\":\"no\",\"career development opportunities\":\"medium\",\"fte\":\"0.8\",\"salary\":\"300\",\"work from home\":\"0\"}}}}";
 	private static EmbeddedTomcat tomcat = new EmbeddedTomcat();
 
@@ -78,19 +83,8 @@
 		assertTrue(ws.isOpen());
 
-		Thread.sleep(15000);
-
-		assertEquals(1, received.size()); // 1 answer received
-
-		ObjectMapper mapper = new ObjectMapper();
-		TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
-		};
-		Map<String, Object> map = mapper.readValue(received.get(0), typeRef);
-
-		List<String> domains = new LinkedList<>();
-		for (String key : map.keySet()) {
-			domains.add(key.substring(key.indexOf("get")));
-		}
-		assertTrue(domains.contains("get/jobs"));
-		assertTrue(domains.contains("get/7issues"));
+		Thread.sleep(2000);
+		assertEquals(1, received.size());
+		assertTrue(received.get(0).matches(JSON));
+		System.out.println(JSON);
 	}
 
Index: src/test/java/geniusweb/profilesserver/AutoUpdatingProfilesFactoryTest.java
===================================================================
--- src/test/java/geniusweb/profilesserver/AutoUpdatingProfilesFactoryTest.java	(revision 43)
+++ src/test/java/geniusweb/profilesserver/AutoUpdatingProfilesFactoryTest.java	(revision 1)
@@ -44,5 +44,4 @@
  */
 public class AutoUpdatingProfilesFactoryTest {
-
 	private static final String JOBS = "jobs";
 	private static final String JOB1 = "jobs/jobs1";
@@ -51,5 +50,5 @@
 	private List<String> warnings;
 	private Path copyrepodir;
-	private AutoUpdatingProfilesRepository factory;
+	private AutoUpdatingProfilesFactory factory;
 	private final long HIGHRATE = 500; // fast so that we can test quickly.
 	private final List<ChangeEvent> changes = new LinkedList<>();
@@ -80,5 +79,5 @@
 		};
 
-		factory = new AutoUpdatingProfilesRepository(logger) {
+		factory = new AutoUpdatingProfilesFactory(logger) {
 
 			@Override
@@ -120,8 +119,7 @@
 	@Test
 	public void getDomainsTest() {
-		assertTrue(factory.getDomains().size() > 2);
-		assertTrue(factory.getDomains().contains(JOBS));
-		assertTrue(factory.getDomains().contains(JOBS));
-		assertTrue(factory.getDomains().contains("7issues"));
+		assertEquals(2, factory.getDomains().size());
+		assertEquals(JOBS, factory.getDomains().get(0));
+		assertEquals("7issues", factory.getDomains().get(1));
 
 	}
@@ -146,9 +144,8 @@
 		Thread.sleep(HIGHRATE);
 
-		assertEquals(4, changes.size());
+		assertEquals(3, changes.size());
 		assertTrue(changes.get(0) instanceof ProfileChangeEvent);
 		assertTrue(changes.get(1) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(2) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(3) instanceof DomainChangeEvent);
+		assertTrue(changes.get(2) instanceof DomainChangeEvent);
 		assertEquals(1, warnings.size()); // jobs domain file missing
 		assertNull(factory.getDomain(JOBS));
@@ -164,9 +161,8 @@
 		Thread.sleep(HIGHRATE);
 
-		assertEquals(4, changes.size());
+		assertEquals(3, changes.size());
 		assertTrue(changes.get(0) instanceof ProfileChangeEvent);
 		assertTrue(changes.get(1) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(2) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(3) instanceof DomainChangeEvent);
+		assertTrue(changes.get(2) instanceof DomainChangeEvent);
 		assertEquals(1, warnings.size()); // wrong domain file, wrong profile
 		assertNull(factory.getDomain(JOBS));
@@ -222,20 +218,4 @@
 	}
 
-	@Test
-	public void saveProfileTest() throws IOException {
-		assertEquals(0, changes.size());
-		LinearAdditiveUtilitySpace profile = (LinearAdditiveUtilitySpace) factory
-				.getProfile(JOB1);
-		Profile newprofile = new LinearAdditiveUtilitySpace(profile.getDomain(),
-				"jobsA", profile.getUtilities(), profile.getWeights(),
-				profile.getReservationBid());
-		factory.putProfile(newprofile);
-		// check response immediately
-		assertEquals(1, changes.size());
-		assertTrue(changes.get(0) instanceof ProfileChangeEvent);
-		// check file was written
-		assertTrue(copyrepodir.resolve("jobs/jobsA.json").toFile().exists());
-	}
-
 	/**
 	 * We remove jobs domain.
@@ -251,19 +231,9 @@
 		assertNull(factory.getProfile(JOB1));
 
-		assertEquals(4, changes.size());
+		assertEquals(3, changes.size());
 		assertTrue(changes.get(0) instanceof ProfileChangeEvent);
 		assertTrue(changes.get(1) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(2) instanceof ProfileChangeEvent);
-		assertTrue(changes.get(3) instanceof DomainChangeEvent);
+		assertTrue(changes.get(2) instanceof DomainChangeEvent);
 		assertEquals(0, warnings.size());
-	}
-
-	@Test
-	public void testEnvVariable() throws IOException {
-		Path dir = Files.createTempDirectory("tempdir");
-		// This test does not work because we can not set the env variable.
-		// new EnvironmentVariables().set("PROFILES_ROOTDIR", "1");
-		System.setProperty("PROFILES_ROOTDIR", "1");// dir.toAbsolutePath().toString());
-		System.out.println(System.getenv("PROFILES_ROOTDIR"));
 	}
 
Index: src/test/java/geniusweb/profilesserver/DefaultProfilesFactoryTest.java
===================================================================
--- src/test/java/geniusweb/profilesserver/DefaultProfilesFactoryTest.java	(revision 43)
+++ src/test/java/geniusweb/profilesserver/DefaultProfilesFactoryTest.java	(revision 1)
@@ -27,5 +27,5 @@
 	private Domain domain1 = mock(Domain.class);
 	private List<ChangeEvent> events = new LinkedList<>();
-	private DefaultProfilesRepository factory;
+	private DefaultProfilesFactory factory;
 
 	private Profile profile1 = mock(Profile.class);
@@ -40,5 +40,5 @@
 		when(profile1a.getDomain()).thenReturn(domain1);
 		when(profile1a.getName()).thenReturn(PROFILE1);
-		factory = new DefaultProfilesRepository();
+		factory = new DefaultProfilesFactory();
 		factory.addListener(new Listener<ChangeEvent>() {
 
