use of org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl in project ignite by apache.
the class BinaryObjectBuilderDefaultMappersSelfTest method testRemoveFromExistingObjectAfterGet.
/**
*
*/
public void testRemoveFromExistingObjectAfterGet() {
GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
obj.setDefaultData();
obj.enumArr = null;
BinaryObjectBuilderImpl builder = builder(toBinary(obj));
builder.getField("i_");
builder.removeField("str");
TestCase.assertNull(builder.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
}
use of org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl in project ignite by apache.
the class BinaryObjectBuilderAdditionalSelfTest method testDecimalArrayModification.
/**
*
*/
public void testDecimalArrayModification() {
GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
obj.bdArr = new BigDecimal[] { new BigDecimal(1000), new BigDecimal(1000), new BigDecimal(1000) };
BinaryObjectBuilderImpl mutObj = wrap(obj);
BigDecimal[] arr = mutObj.getField("bdArr");
arr[0] = new BigDecimal(2000);
GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
Assert.assertArrayEquals(new BigDecimal[] { new BigDecimal(1000), new BigDecimal(1000), new BigDecimal(1000) }, res.bdArr);
}
Aggregations