diff options
Diffstat (limited to 'src/test/java/com/juick/JsonTests.java')
-rw-r--r-- | src/test/java/com/juick/JsonTests.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/test/java/com/juick/JsonTests.java b/src/test/java/com/juick/JsonTests.java deleted file mode 100644 index ba01e80c..00000000 --- a/src/test/java/com/juick/JsonTests.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.juick; - -import static org.junit.Assert.assertEquals; - -import com.juick.json.MessageSerializer; -import org.junit.Assert; -import org.junit.Test; - -import com.juick.Message; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.TimeZone; - -public class JsonTests { - @Test - public void DateTest() { - Message msg = new Message(); - SimpleDateFormat df= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - df.setTimeZone(TimeZone.getTimeZone("UTC")); - try { - msg.setDate(df.parse("2015-01-01 05:02:10")); - MessageSerializer serializer = new MessageSerializer(); - String json = serializer.serialize(msg).toString(); - assertEquals("{\"timestamp\":\"2015-01-01 05:02:10\"}", json); - } catch (ParseException e) { - e.printStackTrace(); - } - - } -}
\ No newline at end of file |