aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/tests/JsonTests.java
blob: 9a42dea5b047835bd739dd28bf10ba58cf2c13dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
    }
}