diff options
author | Vitaly Takmazov | 2015-11-04 14:17:18 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2015-11-04 14:17:18 +0300 |
commit | e1a1f6d450c5ffd79eb8132d13583606663d640d (patch) | |
tree | 4c4904798dbf736daabacab06c504bbf1d253c77 | |
parent | 9d7b2473308fe841d84ce8af9efef164c61518e8 (diff) |
add unit tests stub
-rw-r--r-- | build.gradle | 1 | ||||
-rw-r--r-- | src/test/java/com/juick/tests/JsonTests.java | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle index ab3d39b2..3ebf0fd0 100644 --- a/build.gradle +++ b/build.gradle @@ -57,6 +57,7 @@ dependencies { tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}", "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}" + testCompile 'junit:junit:4.12' } compileJava.options.encoding = 'UTF-8' diff --git a/src/test/java/com/juick/tests/JsonTests.java b/src/test/java/com/juick/tests/JsonTests.java new file mode 100644 index 00000000..9a42dea5 --- /dev/null +++ b/src/test/java/com/juick/tests/JsonTests.java @@ -0,0 +1,23 @@ +package com.juick.tests;
+
+import com.google.gson.Gson;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.juick.Message;
+
+public class JsonTests {
+ @Test
+ public void CompareSerializers() {
+ Message msg = new Message();
+ msg.ReplyTo = 1;
+ msg.MID = 234566;
+ Gson gson = new Gson();
+ String gsonResult = gson.toJson(msg);
+ String ugnichResult = com.juick.json.Message.toJSON(msg).toString();
+ System.out.println(gsonResult);
+ System.out.println(ugnichResult);
+ assertEquals("our result must equal to ugnich", ugnichResult, gsonResult);
+ }
+}
\ No newline at end of file |