{
String[] constantFieldsExcept = { "1,2" };
TypeInformation<?> type = new TupleTypeInfo<Tuple3<Integer, Integer, Integer>>(BasicTypeInfo.INT_TYPE_INFO,
BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO);
SingleInputSemanticProperties sp = SemanticPropUtil.getSemanticPropsSingleFromString(null, constantFieldsExcept, null, type, type);
FieldSet fs = sp.getForwardedField(0);
Assert.assertTrue(fs.size() == 1);
Assert.assertTrue(fs.contains(0));
Assert.assertNull(sp.getForwardedField(1));
Assert.assertNull(sp.getForwardedField(2));
}
// with spaces
{
String[] constantFieldsExcept = { " 1 , 2" };
TypeInformation<?> type = new TupleTypeInfo<Tuple3<Integer, Integer, Integer>>(BasicTypeInfo.INT_TYPE_INFO,
BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO);
SingleInputSemanticProperties sp = SemanticPropUtil.getSemanticPropsSingleFromString(null, constantFieldsExcept, null, type, type);
FieldSet fs = sp.getForwardedField(0);
Assert.assertTrue(fs.size() == 1);
Assert.assertTrue(fs.contains(0));
Assert.assertNull(sp.getForwardedField(1));
Assert.assertNull(sp.getForwardedField(2));
}
}