/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.testing;

import com.facebook.presto.GroupByHashPageIndexerFactory;
import com.facebook.presto.PagesIndexPageSorter;
import com.facebook.presto.metadata.InMemoryNodeManager;
import com.facebook.presto.spi.NodeManager;
import com.facebook.presto.spi.PageIndexerFactory;
import com.facebook.presto.spi.PageSorter;
import com.facebook.presto.spi.connector.ConnectorFactoryContext;
import com.facebook.presto.spi.type.TypeManager;
import com.facebook.presto.type.TypeRegistry;

public class TestingConnectorFactoryContext
        implements ConnectorFactoryContext
{
    private final TypeManager typeManager = new TypeRegistry();
    private final NodeManager nodeManager = new InMemoryNodeManager();
    private final PageSorter pageSorter = new PagesIndexPageSorter();
    private final PageIndexerFactory pageIndexerFactory = new GroupByHashPageIndexerFactory();

    @Override
    public TypeManager getTypeManager()
    {
        return typeManager;
    }

    @Override
    public NodeManager getNodeManager()
    {
        return nodeManager;
    }

    @Override
    public PageSorter getPageSorter()
    {
        return pageSorter;
    }

    @Override
    public PageIndexerFactory getPageIndexerFactory()
    {
        return pageIndexerFactory;
    }
}

@@ -887,32 +887,75 @@
 spi.PageSorter;%0A
+import com.facebook.presto.spi.ServerInfo;%0A
 import com.faceb
@@ -1004,16 +1004,16 @@
 ontext;%0A
-
 import c
@@ -1488,16 +1488,112 @@
 ctory();
+%0A    private final ServerInfo serverInfo = new ServerInfo(%22testnode%22, %22testenv%22, %22testversion%22);
 %0A%0A    @O
@@ -1934,32 +1934,32 @@
 Factory()%0A    %7B%0A
-
         return p
@@ -1982,11 +1982,103 @@
 y;%0A    %7D
+%0A%0A    @Override%0A    public ServerInfo getServerInfo()%0A    %7B%0A        return serverInfo;%0A    %7D
 %0A%7D%0A

Add ServerInfo to TestingConnectorFactoryContext