Skip to content

Commit b2cb38c

Browse files
authored
EQL: Expand verification tests (#52664) (#52725)
* EQL: Expand verification tests (#52664) Expand verification tests Fix some error messaging consistency in EqlParser Related to #51873 * Adjust for 7.x compatibility
1 parent 18663b0 commit b2cb38c

File tree

19 files changed

+621
-16
lines changed

19 files changed

+621
-16
lines changed

x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ public void exitFunctionExpression(EqlBaseParser.FunctionExpressionContext conte
164164
case "arrayCount":
165165
case "arraySearch":
166166
throw new ParsingException(
167-
"unsupported function " + functionName,
167+
"Unsupported function [" + functionName + "]",
168168
null,
169169
token.getLine(),
170170
token.getCharPositionInLine());
171171

172172
default:
173173
throw new ParsingException(
174-
"unknown function " + functionName,
174+
"Unknown function [" + functionName + "]",
175175
null,
176176
token.getLine(),
177177
token.getCharPositionInLine());
@@ -182,7 +182,7 @@ public void exitFunctionExpression(EqlBaseParser.FunctionExpressionContext conte
182182
public void exitJoin(EqlBaseParser.JoinContext context) {
183183
Token token = context.JOIN().getSymbol();
184184
throw new ParsingException(
185-
"join is not supported",
185+
"Join is not supported",
186186
null,
187187
token.getLine(),
188188
token.getCharPositionInLine());
@@ -192,7 +192,7 @@ public void exitJoin(EqlBaseParser.JoinContext context) {
192192
public void exitPipe(EqlBaseParser.PipeContext context) {
193193
Token token = context.PIPE().getSymbol();
194194
throw new ParsingException(
195-
"pipes are not supported",
195+
"Pipes are not supported",
196196
null,
197197
token.getLine(),
198198
token.getCharPositionInLine());
@@ -202,7 +202,7 @@ public void exitPipe(EqlBaseParser.PipeContext context) {
202202
public void exitProcessCheck(EqlBaseParser.ProcessCheckContext context) {
203203
Token token = context.relationship;
204204
throw new ParsingException(
205-
"process relationships are not supported",
205+
"Process relationships are not supported",
206206
null,
207207
token.getLine(),
208208
token.getCharPositionInLine());
@@ -212,7 +212,7 @@ public void exitProcessCheck(EqlBaseParser.ProcessCheckContext context) {
212212
public void exitSequence(EqlBaseParser.SequenceContext context) {
213213
Token token = context.SEQUENCE().getSymbol();
214214
throw new ParsingException(
215-
"sequence is not supported",
215+
"Sequence is not supported",
216216
null,
217217
token.getLine(),
218218
token.getCharPositionInLine());
@@ -223,7 +223,7 @@ public void exitQualifiedName(EqlBaseParser.QualifiedNameContext context) {
223223
if (context.INTEGER_VALUE().size() > 0) {
224224
Token firstIndex = context.INTEGER_VALUE(0).getSymbol();
225225
throw new ParsingException(
226-
"array indexes are not supported",
226+
"Array indexes are not supported",
227227
null,
228228
firstIndex.getLine(),
229229
firstIndex.getCharPositionInLine());

x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/AbstractEqlIntegTestCase.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
1919

20-
@ESIntegTestCase.ClusterScope(scope = SUITE, numDataNodes = 0, numClientNodes = 0, maxNumDataNodes = 0)
20+
@ESIntegTestCase.ClusterScope(scope = SUITE, numDataNodes = 0, numClientNodes = 0, maxNumDataNodes = 0, transportClientRatio = 0)
2121
public abstract class AbstractEqlIntegTestCase extends ESIntegTestCase {
2222

2323
@Override
@@ -37,5 +37,10 @@ protected Settings nodeSettings(int nodeOrdinal) {
3737
protected Collection<Class<? extends Plugin>> nodePlugins() {
3838
return Collections.singletonList(LocalStateEqlXPackPlugin.class);
3939
}
40+
41+
@Override
42+
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
43+
return nodePlugins();
44+
}
4045
}
4146

0 commit comments

Comments
 (0)