summaryrefslogtreecommitdiff
path: root/same/src/test/java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-11 15:33:01 +0200
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-11 15:33:01 +0200
commita21280cc77c163ec7bd7bc1fc4b451a1fc01a1d8 (patch)
tree233cd6f94da11fb42306677b757049c295076e88 /same/src/test/java
parentea729356b01c542ff46120de68a10fad34bb538c (diff)
Update tests.
Diffstat (limited to 'same/src/test/java')
-rw-r--r--same/src/test/java/com/orbekk/same/FunctionalTest.java12
-rw-r--r--same/src/test/java/com/orbekk/same/MasterTest.java3
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);