diff options
Diffstat (limited to 'same/src/test/java')
-rw-r--r-- | same/src/test/java/com/orbekk/same/FunctionalTest.java | 12 | ||||
-rw-r--r-- | same/src/test/java/com/orbekk/same/MasterTest.java | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/same/src/test/java/com/orbekk/same/FunctionalTest.java b/same/src/test/java/com/orbekk/same/FunctionalTest.java index 5e0af41..fc71803 100644 --- a/same/src/test/java/com/orbekk/same/FunctionalTest.java +++ b/same/src/test/java/com/orbekk/same/FunctionalTest.java @@ -20,6 +20,7 @@ import com.orbekk.util.DelayedOperation; public class FunctionalTest { Master master; String masterUrl = "http://master/MasterService.json"; + String masterLocation = "master:1"; Client client1; Client client2; Client client3; @@ -33,7 +34,7 @@ public class FunctionalTest { @Before public void setUp() { master = Master.create(connections, - broadcaster, masterUrl, "TestMaster"); + broadcaster, masterUrl, "TestMaster", masterLocation); masterServiceProxy = new MasterServiceProxy(master.getService()); connections.masterMap.put(masterUrl, masterServiceProxy); @@ -109,8 +110,9 @@ public class FunctionalTest { @Test public void clientBecomesMaster() { String newMasterUrl = "http://newMaster/MasterService.json"; + String newMasterLocation = "newMaster:1"; final Master newMaster = Master.create(connections, - broadcaster, newMasterUrl, "TestMaster"); + broadcaster, newMasterUrl, "TestMaster", newMasterLocation); connections.masterMap.put(newMasterUrl, newMaster.getService()); joinClients(); MasterController controller = new MasterController() { @@ -133,8 +135,9 @@ public class FunctionalTest { @Test public void onlyOneNewMaster() { String newMasterUrl = "http://newMaster/MasterService.json"; + String newMasterLocation = "newMaster:1"; final Master newMaster = Master.create(connections, - broadcaster, newMasterUrl, "TestMaster"); + broadcaster, newMasterUrl, "TestMaster", newMasterLocation); connections.masterMap.put(newMasterUrl, newMaster.getService()); joinClients(); MasterController controller = new MasterController() { @@ -161,8 +164,9 @@ public class FunctionalTest { @Test public void masterFails() { String newMasterUrl = "http://newMaster/MasterService.json"; + String newMasterLocation = "newMaster:2"; final Master newMaster = Master.create(connections, - broadcaster, newMasterUrl, "TestMaster"); + broadcaster, newMasterUrl, "TestMaster", newMasterLocation); connections.masterMap.put(newMasterUrl, newMaster.getService()); joinClients(); MasterController controller = new MasterController() { diff --git a/same/src/test/java/com/orbekk/same/MasterTest.java b/same/src/test/java/com/orbekk/same/MasterTest.java index 39bee1f..423f292 100644 --- a/same/src/test/java/com/orbekk/same/MasterTest.java +++ b/same/src/test/java/com/orbekk/same/MasterTest.java @@ -37,9 +37,10 @@ public class MasterTest { @Before public void setUp() { + String masterLocation = "master:1000"; state.update(".masterUrl", "http://master/MasterService.json", 1); master = new Master(state, connections, broadcaster, - "http://master/MasterService.json"); + "http://master/MasterService.json", masterLocation); masterS = master.getService(); connections.masterMap.put("http://master/MasterService.json", masterS); |