Search in sources :

Example 6 with NestedGroupObject

use of com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.NestedGroupObject in project hazelcast by hazelcast.

the class CompactStreamSerializerValueReaderSpecTest method fromObjectArrayAnyToObjectArrayAnyToPrimitiveScenarios.

// ----------------------------------------------------------------------------------------------------------
// from PORTABLE_ARRAY[any] via PORTABLE_ARRAY[any] to further PRIMITIVE access
// ----------------------------------------------------------------------------------------------------------
private static void fromObjectArrayAnyToObjectArrayAnyToPrimitiveScenarios(List<Object[]> result) {
    String p = "fromObjectArrayAnyToObjectArrayAnyToPrimitiveScenarios";
    // =============================================
    // INPUT mixed
    // =============================================
    PrimitiveObject p1 = prim(1, NONE);
    PrimitiveObject p10 = prim(10, FULL);
    PrimitiveObject p20 = prim(20, FULL);
    NestedGroupObject input = nested(new GroupObject[] { new GroupObject(new PrimitiveObject[0]), group(p1, p10), new GroupObject((PrimitiveObject[]) null), group(new PrimitiveObject[] { p20 }) });
    result.addAll(asList(scenario(input, list(null, p1.byte_, p10.byte_, p20.byte_), "objects[any].objects[any].byte_", p), scenario(input, list(null, p1.short_, p10.short_, p20.short_), "objects[any].objects[any].short_", p), scenario(input, list(null, p1.int_, p10.int_, p20.int_), "objects[any].objects[any].int_", p), scenario(input, list(null, p1.long_, p10.long_, p20.long_), "objects[any].objects[any].long_", p), scenario(input, list(null, p1.float_, p10.float_, p20.float_), "objects[any].objects[any].float_", p), scenario(input, list(null, p1.double_, p10.double_, p20.double_), "objects[any].objects[any].double_", p), scenario(input, list(null, p1.boolean_, p10.boolean_, p20.boolean_), "objects[any].objects[any].boolean_", p), scenario(input, list(null, p1.string_, p10.string_, p20.string_), "objects[any].objects[any].string_", p)));
    // =============================================
    // INPUT empty
    // =============================================
    NestedGroupObject inputEmpty = nested(new GroupObject[0]);
    result.addAll(asList(scenario(inputEmpty, null, "objects[any].objects[any].byte_", p), scenario(inputEmpty, null, "objects[any].objects[any].short_", p), scenario(inputEmpty, null, "objects[any].objects[any].int_", p), scenario(inputEmpty, null, "objects[any].objects[any].long_", p), scenario(inputEmpty, null, "objects[any].objects[any].float_", p), scenario(inputEmpty, null, "objects[any].objects[any].double_", p), scenario(inputEmpty, null, "objects[any].objects[any].boolean_", p), scenario(inputEmpty, null, "objects[any].objects[any].string_", p)));
    // =============================================
    // INPUT null
    // =============================================
    NestedGroupObject inputNull = nested((GroupObject[]) null);
    result.addAll(asList(scenario(inputNull, null, "objects[any].objects[any].byte_", p), scenario(inputNull, null, "objects[any].objects[any].short_", p), scenario(inputNull, null, "objects[any].objects[any].int_", p), scenario(inputNull, null, "objects[any].objects[any].long_", p), scenario(inputNull, null, "objects[any].objects[any].float_", p), scenario(inputNull, null, "objects[any].objects[any].double_", p), scenario(inputNull, null, "objects[any].objects[any].boolean_", p), scenario(inputNull, null, "objects[any].objects[any].string_", p)));
}
Also used : PrimitiveObject(com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.PrimitiveObject) GroupObject(com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.GroupObject) NestedGroupObject(com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.NestedGroupObject) NestedGroupObject(com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.NestedGroupObject)

Aggregations

GroupObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.GroupObject)6 NestedGroupObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.NestedGroupObject)6 PrimitiveObject (com.hazelcast.internal.serialization.impl.compact.reader.CompactValueReaderTestStructure.PrimitiveObject)6