use of com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle in project presto by prestodb.
the class TestInformationSchemaTableHandle method testInformationSchemaSerialize.
@Test
public void testInformationSchemaSerialize() throws Exception {
InformationSchemaTableHandle informationSchemaTableHandle = new InformationSchemaTableHandle("information_schema_catalog", "information_schema_schema", "information_schema_table");
assertTrue(objectMapper.canSerialize(InformationSchemaTableHandle.class));
String json = objectMapper.writeValueAsString(informationSchemaTableHandle);
testJsonEquals(json, SCHEMA_AS_MAP);
}
use of com.facebook.presto.connector.informationSchema.InformationSchemaTableHandle in project presto by prestodb.
the class TestInformationSchemaTableHandle method testInformationSchemaDeserialize.
@Test
public void testInformationSchemaDeserialize() throws Exception {
String json = objectMapper.writeValueAsString(SCHEMA_AS_MAP);
ConnectorTableHandle tableHandle = objectMapper.readValue(json, ConnectorTableHandle.class);
assertEquals(tableHandle.getClass(), InformationSchemaTableHandle.class);
InformationSchemaTableHandle informationSchemaHandle = (InformationSchemaTableHandle) tableHandle;
assertEquals(informationSchemaHandle.getCatalogName(), "information_schema_catalog");
assertEquals(informationSchemaHandle.getSchemaName(), "information_schema_schema");
assertEquals(informationSchemaHandle.getTableName(), "information_schema_table");
}
Aggregations