Examples of JsonConvert


Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertTobyte() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    byte actual = new JsonConvert().convertTobyte(jsonObj.get("fbyte"));
    junit.framework.Assert.assertEquals(te.getFbyte(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertTochar() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    char actual = new JsonConvert().convertTochar(jsonObj.get("fchar"));
    junit.framework.Assert.assertEquals(te.getFchar(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertTodouble() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    double actual = new JsonConvert().convertTodouble(jsonObj
        .get("fdouble"));
    junit.framework.Assert.assertEquals(te.getFdouble(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertTofloat() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    float actual = new JsonConvert().convertTofloat(jsonObj.get("ffloat"));
    junit.framework.Assert.assertEquals(te.getFfloat(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertToint() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    int actual = new JsonConvert().convertToint(jsonObj.get("fint"));
    junit.framework.Assert.assertEquals(te.getFint(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertTolong() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    long actual = new JsonConvert().convertTolong(jsonObj.get("flong"));
    junit.framework.Assert.assertEquals(te.getFlong(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

  public void testConvertToshort() throws Exception {
    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);
    JSONObject jsonObj = new JSONObject(jsonStr);

    short actual = new JsonConvert().convertToshort(jsonObj.get("fshort"));
    junit.framework.Assert.assertEquals(te.getFshort(), actual);
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert

    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);

    JSONObject jsonObj = new JSONObject(jsonStr);

    TestEntityII actual = (TestEntityII) new JsonConvert().convertToT(
        jsonObj.get("fObject"), TestEntityII.class);

    junit.framework.Assert.assertEquals(
        ((TestEntityII) te.getFObject()).getId(), actual.getId());
    junit.framework.Assert.assertEquals(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.