diff options
Diffstat (limited to 'same/src/test')
-rw-r--r-- | same/src/test/java/com/orbekk/same/ClientServiceImplTest.java | 18 | ||||
-rw-r--r-- | same/src/test/java/com/orbekk/same/MasterServiceImplTest.java | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java new file mode 100644 index 0000000..75bf75d --- /dev/null +++ b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java @@ -0,0 +1,18 @@ +package com.orbekk.same; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class ClientServiceImplTest { + private State state = new State("ClientNetwork"); + private TestConnectionManager connections = new TestConnectionManager(); + private TestBroadcaster broadcaster = new TestBroadcaster(connections); + private ClientServiceImpl client = new ClientServiceImpl(state, connections); + + @Test public void testSetState() { + client.setState("TestState", "Test data", 100); + assertEquals(100, state.getRevision("TestState")); + assertEquals("Test data", state.getDataOf("TestState")); + } +} diff --git a/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java b/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java index 3cd78d1..25b4073 100644 --- a/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java +++ b/same/src/test/java/com/orbekk/same/MasterServiceImplTest.java @@ -56,5 +56,6 @@ public class MasterServiceImplTest { master.joinNetworkRequest("TestNetwork", "http://client"); assertTrue(master._performWork()); assertTrue(state.getList(".participants").contains("http://client")); + assertEquals(state, client.testGetState()); } } |