summaryrefslogtreecommitdiff
path: root/same/src/test/java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-06 14:33:08 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-06 14:33:08 +0100
commit0ac907ad19d62cc773f6f13f74af52bd75f0b5db (patch)
treea44f26d49c9dd12afb8e27a76e38baad6fdb5f2f /same/src/test/java
parent34366d7ae525d28ef153ad6059779d9cef3952c6 (diff)
Fix failing tests.
Tests were failing because of URL problems after refactoring.
Diffstat (limited to 'same/src/test/java')
-rw-r--r--same/src/test/java/com/orbekk/same/MasterServiceImplTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java b/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java
index d5126b6..cc89054 100644
--- a/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java
+++ b/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java
@@ -12,8 +12,7 @@ public class MasterServiceImplTest {
private State state = new State("TestNetwork");
private TestConnectionManager connections = new TestConnectionManager();
private TestBroadcaster broadcaster = new TestBroadcaster();
- private MasterServiceImpl master = MasterServiceImpl.create(
- connections, broadcaster, "http://master/MasterService.json");
+ private MasterServiceImpl master;
public static class UnreachableClient implements ClientService {
@Override
@@ -36,6 +35,8 @@ public class MasterServiceImplTest {
@Before
public void setUp() {
+ state.update(".masterUrl", "http://master/MasterService.json", 1);
+ master = new MasterServiceImpl(state, connections, broadcaster);
connections.masterMap.put("http://master/MasterService.json", master);
}
@@ -70,7 +71,7 @@ public class MasterServiceImplTest {
"http://client/ClientService.json");
ClientService clientS = client.getService();
connections.clientMap.put("http://client/ClientService.json", clientS);
- client.joinNetwork("http://master");
+ client.joinNetwork("http://master/MasterService.json");
assertTrue(master._performWork());
assertTrue(state.getList(".participants").contains("http://client/ClientService.json"));
assertEquals(state, client.testGetState());
@@ -118,7 +119,7 @@ public class MasterServiceImplTest {
"http://client/ClientService.json");
ClientService clientS = client.getService();
connections.clientMap.put("http://client/ClientService.json", clientS);
- client.joinNetwork("http://master");
+ client.joinNetwork("http://master/MasterService.json");
assertTrue(master._performWork());
assertTrue(state.getList(".participants").contains("http://client/ClientService.json"));