예제 #1
0
 @Test
 public void testJsonSerializationObjectVersionOld() throws Exception {
   VersionedObject obj = new VersionedObject();
   obj.setDepricatedInt32Field(241901);
   assertEquals(
       obj,
       versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "json"));
 }
예제 #2
0
 @Test
 public void testJsonSerializationEnumVersionOld() throws Exception {
   VersionedObject obj = new VersionedObject();
   obj.setEnumField(VersionedEnum.Value3);
   assertEquals(
       obj,
       versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "json"));
 }
예제 #3
0
  @Test
  public void testJsonSerializationObjectVersionNew() throws Exception {
    VersionedObject obj = new VersionedObject();
    obj.setNewInt64Field(242341223412L);

    assertEquals(
        obj,
        versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "json"));
  }
예제 #4
0
  @Test
  public void testBinarySerializationEnumVersionNew() throws Exception {
    VersionedObject obj = new VersionedObject();
    obj.setEnumField(VersionedEnum.Value4);

    assertEquals(
        obj,
        versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "binary"));
  }
예제 #5
0
  @Test
  public void testJsonSerializationObjectVersionUseNewValueInOldVersion() throws Exception {
    VersionedObject obj = new VersionedObject();
    obj.setNewInt64Field(1L);

    assertEquals(
        null,
        versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "json")
            .getNewInt64Field());
  }
예제 #6
0
  @Test
  public void testBinarySerializationObjectVersionUseRemovedValue() throws Exception {
    VersionedObject obj = new VersionedObject();
    obj.setDepricatedInt32Field(1);

    assertEquals(
        null,
        versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "binary")
            .getDepricatedInt32Field());
  }
예제 #7
0
  @Test
  public void testJsonSerializationEnumVersionUseRemovedValue() throws Exception {
    thrown.expect(TeslaSerializationException.class);
    thrown.expectMessage("is not allowed");

    VersionedObject obj = new VersionedObject();
    obj.setEnumField(VersionedEnum.Value3);

    versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V2_0, "json");
  }
예제 #8
0
  @Test
  public void testBinarySerializationEnumVersionUseNewValueInOldVersion() throws Exception {
    thrown.expect(TeslaSerializationException.class);
    thrown.expectMessage("is not allowed");

    VersionedObject obj = new VersionedObject();
    obj.setEnumField(VersionedEnum.Value4);

    versioningRoundTripSerailization(obj, Serializer.VERSION_VERSIONING_TEST_V1_0, "binary");
  }