Search in sources :

Example 1 with StringArrayArray

use of com.linkedin.data.template.StringArrayArray in project rest.li by linkedin.

the class TestArray method testStringArrayArray.

@Test
public void testStringArrayArray() {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "stringArrayArray");
    @SuppressWarnings("unchecked") Class<StringArrayArray> templateClass = (Class<StringArrayArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();
    List<StringArray> input = new ArrayList<>();
    for (int i = 0; i < 5; ++i) {
        input.add(new StringArray("input" + i));
    }
    List<StringArray> adds = new ArrayList<>();
    for (int i = 0; i < 5; ++i) {
        adds.add(new StringArray("add" + i));
    }
    TestArrayTemplate.testArray(templateClass, schema, input, adds);
}
Also used : ArrayDataSchema(com.linkedin.data.schema.ArrayDataSchema) TestDataTemplateUtil(com.linkedin.data.template.TestDataTemplateUtil) StringArray(com.linkedin.data.template.StringArray) StringArrayArray(com.linkedin.data.template.StringArrayArray) ArrayList(java.util.ArrayList) Test(org.testng.annotations.Test)

Aggregations

ArrayDataSchema (com.linkedin.data.schema.ArrayDataSchema)1 StringArray (com.linkedin.data.template.StringArray)1 StringArrayArray (com.linkedin.data.template.StringArrayArray)1 TestDataTemplateUtil (com.linkedin.data.template.TestDataTemplateUtil)1 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1