summaryrefslogtreecommitdiff
path: root/same/src/test/java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-17 17:11:12 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-17 17:11:12 +0100
commita2f0a58484bdfc22a8af7b16df051c1e611fc83d (patch)
tree5b3a67d53db242971fdf64e89a4ef5df985363ab /same/src/test/java
parent057ed9266ddfeb4fecd1531f6aa51255a4003b68 (diff)
Fix revision update.
Change State to take the *new* revision when updating.
Diffstat (limited to 'same/src/test/java')
-rw-r--r--same/src/test/java/com/orbekk/same/MasterServiceImplTest.java13
1 files changed, 9 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 583e464..9c72319 100644
--- a/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java
+++ b/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java
@@ -15,6 +15,11 @@ public class MasterServiceImplTest {
private MasterServiceImpl master = new MasterServiceImpl(state,
connections, broadcaster);
+ @Before
+ public void setUp() {
+ connections.masterMap.put("http://master", master);
+ }
+
@Test
public void setsMasterUrl() {
master.setUrl("http://10.0.0.54:10050/");
@@ -53,7 +58,7 @@ public class MasterServiceImplTest {
new State("ClientNetwork"), connections);
client.setUrl("http://client/");
connections.clientMap.put("http://client/ClientService.json", client);
- master.joinNetworkRequest("http://client/ClientService.json");
+ client.joinNetwork("http://master");
assertTrue(master._performWork());
assertTrue(state.getList(".participants").contains("http://client/ClientService.json"));
assertEquals(state, client.testGetState());
@@ -68,11 +73,11 @@ public class MasterServiceImplTest {
connections.clientMap.put("http://client/ClientService.json", client1);
ClientServiceImpl client2 = new ClientServiceImpl(
new State("ClientNetwork"), connections);
- client1.setUrl("http://client2/");
+ client2.setUrl("http://client2/");
connections.clientMap.put("http://client2/ClientService.json", client2);
- master.joinNetworkRequest("http://client/ClientService.json");
- master.joinNetworkRequest("http://client2/ClientService.json");
+ client1.joinNetwork("http://master");
+ client2.joinNetwork("http://master");
assertTrue(master._performWork());
assertTrue(state.getList(".participants").contains("http://client/ClientService.json"));