Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactors to SqlServer type mapping tests #11207

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public abstract class BaseSqlServerTypeMapping
private final ZoneId kathmandu = ZoneId.of("Asia/Kathmandu");
private final LocalDateTime timeGapInKathmandu = LocalDateTime.of(1986, 1, 1, 0, 13, 7);

protected TestingSqlServer sqlServer;

@BeforeClass
public void setUp()
{
Expand Down Expand Up @@ -756,5 +758,8 @@ private static void checkIsGap(ZoneId zone, LocalDateTime dateTime)
verify(isGap(zone, dateTime), "Expected %s to be a gap in %s", dateTime, zone);
}

protected abstract SqlExecutor onRemoteDatabase();
protected SqlExecutor onRemoteDatabase()
{
return sqlServer::execute;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;

import static io.trino.plugin.sqlserver.SqlServerQueryRunner.createSqlServerQueryRunner;

public class TestSqlServerTypeMapping
extends BaseSqlServerTypeMapping
{
protected TestingSqlServer sqlServer;

@Override
protected QueryRunner createQueryRunner()
throws Exception
Expand All @@ -36,10 +33,4 @@ protected QueryRunner createQueryRunner()
ImmutableMap.of(),
ImmutableList.of());
}

@Override
protected SqlExecutor onRemoteDatabase()
{
return sqlServer::execute;
}
}