diff --git a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponse.java b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponse.java index c2af373a334..ba3f7360c5c 100644 --- a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponse.java +++ b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponse.java @@ -46,7 +46,7 @@ public class ErrorResponse extends Response { protected String toStringBody() { return "request=[" + requestType + "] message=[" + message - + "] cuase=[" + cause + + "] cause=[" + cause + "] stack=[" + stack + "]"; } diff --git a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponse.java b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponse.java index 2efa227d0c1..be1fef71f94 100644 --- a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponse.java +++ b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponse.java @@ -43,7 +43,7 @@ public class ExceptionResponse extends Response { protected String toStringBody() { return "request=[" + requestType + "] message=[" + message - + "] cuase=[" + cause + "]"; + + "] cause=[" + cause + "]"; } @Override diff --git a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponse.java b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponse.java index 33606dc020b..ed49bb79768 100644 --- a/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponse.java +++ b/sql/cli-proto/src/main/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponse.java @@ -59,7 +59,7 @@ public class InfoResponse extends Response { + "]/[major=[" + majorVersion + "] minor=[" + minorVersion + "] hash=[" + versionHash - + "] date=[" + versionDate + "]"; + + "] date=[" + versionDate + "]]"; } @Override diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandRequestTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandRequestTests.java index 31578ac0155..f61cca083d1 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandRequestTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandRequestTests.java @@ -19,4 +19,8 @@ public class CommandRequestTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomCommandRequest()); } + + public void testToString() { + assertEquals("CommandRequest", new CommandRequest("test").toString()); + } } diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandResponseTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandResponseTests.java index 12ccf77a6ca..4abaa6c017f 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandResponseTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/CommandResponseTests.java @@ -20,4 +20,9 @@ public class CommandResponseTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomCommandResponse()); } + + public void testToString() { + assertEquals("CommandResponse", + new CommandResponse(123, 332, "rid", "test").toString()); + } } diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponseTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponseTests.java index 2496ed204de..a53276435cd 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponseTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ErrorResponseTests.java @@ -20,4 +20,9 @@ public class ErrorResponseTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomErrorResponse()); } + + public void testToString() { + assertEquals("ErrorResponse", + new ErrorResponse(RequestType.COMMAND, "test", "test", "stack\nstack").toString()); + } } diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponseTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponseTests.java index 4fe17213a0e..aae9f6b93e9 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponseTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/ExceptionResponseTests.java @@ -20,4 +20,9 @@ public class ExceptionResponseTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomExceptionResponse()); } + + public void testToString() { + assertEquals("ExceptionResponse", + new ExceptionResponse(RequestType.COMMAND, "test", "test").toString()); + } } diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoRequestTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoRequestTests.java index c79e25ff402..d0b035b1ccf 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoRequestTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoRequestTests.java @@ -20,4 +20,9 @@ public class InfoRequestTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomInfoRequest()); } + + public void testToString() { + assertEquals("InfoRequest", + new InfoRequest("1.8.0_131", "testvendor", "testcp", "Mac OS X", "10.12.5").toString()); + } } diff --git a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponseTests.java b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponseTests.java index 4a4237ecb56..7c535b4a4ae 100644 --- a/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponseTests.java +++ b/sql/cli-proto/src/test/java/org/elasticsearch/xpack/sql/cli/net/protocol/InfoResponseTests.java @@ -20,4 +20,9 @@ public class InfoResponseTests extends ESTestCase { public void testRoundTrip() throws IOException { assertRoundTripCurrentVersion(randomInfoResponse()); } + + public void testToString() { + assertEquals("InfoResponse", + new InfoResponse("adsf", "test_cluster", (byte) 6, (byte) 0, "6.0.0", "feed", "date").toString()); + } }