Examples of Derialize()


Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void SerizlizeSqlDate() throws Exception {
    Serializer serializer = new Serializer();
    Object data = new java.sql.Date((new Date()).getTime());
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, java.sql.Date.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void SerizlizeSqlTimestamp() throws Exception {
    Serializer serializer = new Serializer();
    Object data = new java.sql.Timestamp((new Date()).getTime());
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, java.sql.Timestamp.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void SerizlizeSqlTime() throws Exception {
    Serializer serializer = new Serializer();
    Object data = new java.sql.Time((new Date()).getTime());
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, java.sql.Time.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestIntArray() throws Exception {
    Integer[] data = new Integer[] { 12, 32, 44 };
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    assertArrayEquals((Integer[]) expect, (Integer[]) obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    data.put("123", "asdfasd");
    data.put(234, 444);
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, HashMap.class);
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    data.add("234");
    data.add(1234);
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestString() throws Exception {
    String data = "$^%&^*&([新闻]智慧的星球 Sun的力量可强化?serializer.Derialize(buffer, data.getClass())";
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestBoolean() throws Exception {
    Boolean data = false;
    Serializer serializer = new Serializer();
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    assertEquals(expect, obj);

    Boolean data2 = true;
    byte[] buffer2 = serializer.Serialize(data2);
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

    assertEquals(expect, obj);

    Boolean data2 = true;
    byte[] buffer2 = serializer.Serialize(data2);
    assertNotNull(buffer2);
    Object obj2 = serializer.Derialize(buffer2, data2.getClass());
    Object expect2 = data2;
    assertEquals(expect2, obj2);
  }

  @Test
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.serializer.Serializer.Derialize()

  public void TestEnum() throws Exception {
    Serializer serializer = new Serializer();
    Object data = EnmReadState.UnRead;
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    assertEquals(expect, obj);
  }

  @Test
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.