diff options
author | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-19 14:12:44 +0000 |
---|---|---|
committer | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-19 14:12:44 +0000 |
commit | 410219d08abdb859315c4d6d0e0375287d64a88b (patch) | |
tree | 3d4610f6cc671147a0aec7bca573a38d6c98b58e /src/uk/org/ury/client/test/ClientTest.java | |
parent | 2efb758e7c2bd85801c76305161d9d8fa6d2be4b (diff) |
Converted protocol to JSON. Now passes its first ever unit test\!
Diffstat (limited to 'src/uk/org/ury/client/test/ClientTest.java')
-rw-r--r-- | src/uk/org/ury/client/test/ClientTest.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/uk/org/ury/client/test/ClientTest.java b/src/uk/org/ury/client/test/ClientTest.java index e83c28c..48669aa 100644 --- a/src/uk/org/ury/client/test/ClientTest.java +++ b/src/uk/org/ury/client/test/ClientTest.java @@ -3,7 +3,7 @@ */ package uk.org.ury.client.test; -import java.util.List; +import java.util.Map; import junit.framework.Assert; @@ -12,6 +12,8 @@ import org.junit.Before; import org.junit.Test; import uk.org.ury.client.Client; +import uk.org.ury.server.protocol.DecodeFailureException; +import uk.org.ury.server.protocol.Directive; /** @@ -55,9 +57,17 @@ public class ClientTest { Client client = new Client (); - List<String> response = client.get ("/server/ServerRequestHandler?function=test"); + Map<?, ?> response = null; - Assert.assertEquals ("INFO: Test succeeded.", response.get (2)); + try + { + response = client.get ("/server/ServerRequestHandler?function=test"); + } + catch (DecodeFailureException e) + { + e.printStackTrace (); + } + + Assert.assertEquals ("Test succeeded.", response.get (Directive.INFO.toString ())); } - } |