Skip to content

Commit

Permalink
Reintroduce test class extending from abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 2, 2022
1 parent 8466fff commit 828a2d8
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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 io.trino.tests;

import com.google.common.collect.ImmutableMap;
import io.trino.connector.MockConnectorFactory;
import io.trino.connector.MockConnectorPlugin;
import io.trino.testing.DistributedQueryRunner;
import io.trino.testing.QueryRunner;
import io.trino.tpch.TpchTable;

import static io.airlift.testing.Closeables.closeAllSuppress;
import static io.trino.plugin.memory.MemoryQueryRunner.createMemoryQueryRunner;

public class TestDistributedEngineOnlyQueries
extends AbstractDistributedEngineOnlyQueries
{
@Override
protected QueryRunner createQueryRunner()
throws Exception
{
DistributedQueryRunner queryRunner = createMemoryQueryRunner(ImmutableMap.of(), TpchTable.getTables());
queryRunner.getCoordinator().getSessionPropertyManager().addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
try {
queryRunner.installPlugin(new MockConnectorPlugin(MockConnectorFactory.builder()
.withSessionProperties(TEST_CATALOG_PROPERTIES)
.build()));
queryRunner.createCatalog(TESTING_CATALOG, "mock");
}
catch (RuntimeException e) {
throw closeAllSuppress(e, queryRunner);
}
return queryRunner;
}
}

0 comments on commit 828a2d8

Please sign in to comment.