@Test public void testNegative() { String[] negatives = {"decim", "decimal(1,", "decimal(12)", "char1", "char(1", "varchar()", "varchar(a)", "struct<name:int,>", "struct<name:int", "struct<name,age:int>", "struct(name:int,age:int)", "struct<name:int;age:int>, map<int.string>", "array<int,>", "map<int, stri ng>"}; int count = 0; for (String name : negatives) { try { TypeInfoParser.getTypeInfoFromTypeString(name); } catch (IllegalArgumentException e) { count++; } } Assert.assertEquals(count, negatives.length); }
public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name);  }