diff --git a/dev-tools/checkstyle_suppressions.xml b/dev-tools/checkstyle_suppressions.xml index ea7537e6a0e..0cb7222566e 100644 --- a/dev-tools/checkstyle_suppressions.xml +++ b/dev-tools/checkstyle_suppressions.xml @@ -5,6 +5,12 @@ + + + + + + diff --git a/plugin/src/test/java/org/elasticsearch/xpack/sql/TestUtils.java b/plugin/src/test/java/org/elasticsearch/xpack/sql/TestUtils.java index 8824f467638..a34a774d56e 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/sql/TestUtils.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/sql/TestUtils.java @@ -5,35 +5,18 @@ */ package org.elasticsearch.xpack.sql; -import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.xpack.sql.analysis.catalog.EsCatalog; import org.elasticsearch.xpack.sql.execution.PlanExecutor; -import org.elasticsearch.xpack.sql.plugin.cli.http.CliUtils; -import org.elasticsearch.xpack.sql.session.RowSetCursor; public class TestUtils { + // NOCOMMIT I think these may not be needed if we switch to integration tests for the protos public static PlanExecutor planExecutor(Client client) { PlanExecutor executor = new PlanExecutor(client, () -> client.admin().cluster().prepareState().get(TimeValue.timeValueMinutes(1)).getState()); ((EsCatalog) executor.catalog()).setIndexNameExpressionResolver(new IndexNameExpressionResolver(client.settings())); return executor; } - - public static void sqlOut(PlanExecutor executor, String sql) { - executor.sql(sql, new ActionListener() { - - @Override - public void onResponse(RowSetCursor cursor) { - System.out.println(CliUtils.toString(cursor)); - } - - @Override - public void onFailure(Exception ex) { - throw ex instanceof RuntimeException ? (RuntimeException) ex : new SqlException(ex); - } - }); - } } \ No newline at end of file diff --git a/sql-clients/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/Proto.java b/sql-clients/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/Proto.java index ae3a2d6643e..bc799b545fa 100644 --- a/sql-clients/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/Proto.java +++ b/sql-clients/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/Proto.java @@ -15,6 +15,7 @@ import org.elasticsearch.xpack.sql.net.client.util.ObjectUtils; // The protocol is very similar (a subset) to the JDBC driver // // To simplify things, the protocol is NOT meant to be backwards compatible. +//NOCOMMIT the protocol kind of should be backwards compatible though.... // public interface Proto { diff --git a/sql-clients/cli/src/test/java/org/elasticsearch/xpack/sql/cli/integration/net/protocol/ProtoTests.java b/sql-clients/cli/src/test/java/org/elasticsearch/xpack/sql/cli/integration/net/protocol/ProtoTests.java index 551b41fb56a..00ffb508675 100644 --- a/sql-clients/cli/src/test/java/org/elasticsearch/xpack/sql/cli/integration/net/protocol/ProtoTests.java +++ b/sql-clients/cli/src/test/java/org/elasticsearch/xpack/sql/cli/integration/net/protocol/ProtoTests.java @@ -26,6 +26,8 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.startsWith; public class ProtoTests extends ESTestCase { + // NOCOMMIT maybe this should be moved to an integration test inside the plugin + private static Client esClient; private static CliHttpServer server; private static HttpCliClient client; diff --git a/sql-clients/jdbc-proto/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/protocol/Proto.java b/sql-clients/jdbc-proto/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/protocol/Proto.java index 1b0dfa45f7f..3b05e832c5a 100644 --- a/sql-clients/jdbc-proto/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/protocol/Proto.java +++ b/sql-clients/jdbc-proto/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/protocol/Proto.java @@ -28,6 +28,7 @@ import static java.util.Collections.emptyMap; // The proto is based around a simple, single request-response model. // Note the field order is _important_. // To simplify things, the protocol is not meant to be backwards compatible. +// NOCOMMIT the protocol kind of should be backwards compatible though.... // public interface Proto { diff --git a/sql-clients/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/integration/net/protocol/ProtoTests.java b/sql-clients/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/integration/net/protocol/ProtoTests.java index 961b43472bd..0bc5bc498ac 100644 --- a/sql-clients/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/integration/net/protocol/ProtoTests.java +++ b/sql-clients/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/integration/net/protocol/ProtoTests.java @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.startsWith; public class ProtoTests extends ESTestCase { - // NOCOMMIT investigate switching to ESRestTestCase and making an integration test. + // NOCOMMIT maybe this should be moved to an integration test inside the plugin private static Client esClient; private static JdbcHttpServer server;