/*
 * 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;
    }
}

/*
 * 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.ServerInfo;
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();
    private final ServerInfo serverInfo = new ServerInfo("testnode", "testenv", "testversion");

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

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

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

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

    @Override
    public ServerInfo getServerInfo()
    {
        return serverInfo;
    }
}

Add ServerInfo to TestingConnectorFactoryContext