use of com.facebook.presto.connector.system.SystemTableHandle in project presto by prestodb.
the class TestSystemTableHandle method testSystemSerialize.
@Test
public void testSystemSerialize() throws Exception {
SystemTableHandle internalHandle = new SystemTableHandle(CONNECTOR_ID, "system_schema", "system_table");
assertTrue(objectMapper.canSerialize(SystemTableHandle.class));
String json = objectMapper.writeValueAsString(internalHandle);
testJsonEquals(json, SCHEMA_AS_MAP);
}
use of com.facebook.presto.connector.system.SystemTableHandle in project presto by prestodb.
the class TestSystemTableHandle method testSystemDeserialize.
@Test
public void testSystemDeserialize() throws Exception {
String json = objectMapper.writeValueAsString(SCHEMA_AS_MAP);
ConnectorTableHandle tableHandle = objectMapper.readValue(json, ConnectorTableHandle.class);
assertEquals(tableHandle.getClass(), SystemTableHandle.class);
SystemTableHandle systemHandle = (SystemTableHandle) tableHandle;
assertEquals(systemHandle.getConnectorId(), CONNECTOR_ID);
assertEquals(systemHandle.getSchemaTableName(), new SchemaTableName("system_schema", "system_table"));
}
Aggregations