use of org.jkiss.dbeaver.ext.postgresql.model.data.PostgreArrayValueHandler in project dbeaver by serge-rider.
the class PostgreValueParserTest method convertArrayToString.
@Test
public void convertArrayToString() {
PostgreArrayValueHandler arrayVH = new PostgreArrayValueHandler();
String[] stringItems = new String[] { "one", "two", " four with spaces ", "f{i,v}e" };
JDBCCollection array = new JDBCCollection(stringItemType, arrayVH, stringItems);
JDBCCollection array3D = new JDBCCollection(stringItemType, arrayVH, new Object[] { array, array });
String arrayString = arrayVH.getValueDisplayString(arrayStringItemType, array, DBDDisplayFormat.NATIVE);
Assert.assertEquals("'{\"one\",\"two\",\" four with spaces \",\"f{i,v}e\"}'", arrayString);
String arrayString3D = arrayVH.getValueDisplayString(arrayStringItemType, array3D, DBDDisplayFormat.NATIVE);
Assert.assertEquals("'{{\"one\",\"two\",\" four with spaces \",\"f{i,v}e\"},{\"one\",\"two\",\" four with spaces \",\"f{i,v}e\"}}'", arrayString3D);
}
Aggregations