summaryrefslogtreecommitdiff
path: root/same/src/test/java/com
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-23 14:02:57 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-23 14:02:57 +0100
commitef8563e3106f1774b05fe5ea94f538e9983b0182 (patch)
tree65dd47986646ab319dc34204e8824fff2926d5e9 /same/src/test/java/com
parente59207ad371db3895b36d85b6717f12a9cb7b275 (diff)
Support several state listeners in Client.
Diffstat (limited to 'same/src/test/java/com')
-rw-r--r--same/src/test/java/com/orbekk/same/ClientTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/same/src/test/java/com/orbekk/same/ClientTest.java b/same/src/test/java/com/orbekk/same/ClientTest.java
index a4671d4..91f9760 100644
--- a/same/src/test/java/com/orbekk/same/ClientTest.java
+++ b/same/src/test/java/com/orbekk/same/ClientTest.java
@@ -34,4 +34,13 @@ public class ClientTest {
client.discover("mockClient/ClientService.json");
verify(mockClient).notifyNetwork("ClientNetwork", "master");
}
+
+ @Test public void stateListenerReceivesUpdate() throws Exception {
+ StateChangedListener listener = mock(StateChangedListener.class);
+ client.getInterface().addStateListener(listener);
+ clientS.setState("StateListenerVariable", "100", 1);
+ State.Component component = state.getComponent("StateListenerVariable");
+ assertEquals("100", component.getData());
+ verify(listener).stateChanged(eq(component));
+ }
}