diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-19 08:01:20 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-19 08:01:20 +1300 |
commit | 54e738d3281a463a0ea3fcf2026c2464529a9b58 (patch) | |
tree | 65e924f480d6489a5939d2f289c354240fd68e59 /test/org/traccar/web | |
parent | 99f09134fb9c710114296d603c97a76f5cfb0d2a (diff) | |
download | traccar-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.gz traccar-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.bz2 traccar-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.zip |
Remove own JSON converter
Diffstat (limited to 'test/org/traccar/web')
-rw-r--r-- | test/org/traccar/web/JsonConverterTest.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/test/org/traccar/web/JsonConverterTest.java b/test/org/traccar/web/JsonConverterTest.java deleted file mode 100644 index 8607d49ee..000000000 --- a/test/org/traccar/web/JsonConverterTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.traccar.web; - -import java.io.StringReader; -import java.text.ParseException; -import java.util.Date; -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -public class JsonConverterTest { - - @Test - public void primitiveConversion() throws ParseException { - - Primitives o = JsonConverter.objectFromJson(new StringReader( - "{" + - "\"boolean\": true, " + - "\"int\": 42, " + - "\"double\": 41.99, " + - "\"string\": \"discworld\", " + - "\"date\":\"2015-07-09T19:02:17.000Z\"" + - "}"), - Primitives.class); - - assertEquals(true, o.getBoolean()); - assertEquals(42, o.getInt()); - assertEquals(41.99, o.getDouble(), 0.001); - assertEquals("discworld", o.getString()); - assertEquals(1436468537000L, o.getDate().getTime()); - - } - - public static class Primitives { - - private boolean b; - public boolean getBoolean() { return b; } - public void setBoolean(boolean b) { this.b = b; } - - private int i; - public int getInt() { return i; } - public void setInt(int i) { this.i = i; } - - private long l; - public long getLong() { return l; } - public void setLong(long l) { this.l = l; } - - private double d; - public double getDouble() { return d; } - public void setDouble(double d) { this.d = d; } - - private String s; - public String getString() { return s; } - public void setString(String s) { this.s = s; } - - private Date t; - public Date getDate() { return t; } - public void setDate(Date t) { this.t = t; } - - } - -} |