diff --git a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 0cebf280acb..a7dbb145e40 100644 --- a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -121,7 +121,7 @@ public class ExceptionSerializationTests extends ESTestCase { final Path startPath = PathUtils.get(ElasticsearchException.class.getProtectionDomain().getCodeSource().getLocation().toURI()) .resolve("org").resolve("elasticsearch"); final Set> ignore = Sets.newHashSet( - org.elasticsearch.test.rest.parser.RestTestParseException.class, + org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException.class, CancellableThreadsTests.CustomException.class, org.elasticsearch.rest.BytesRestResponseTests.WithHeadersException.class, AbstractClientHeadersTestCase.InternalException.class); diff --git a/distribution/deb/src/test/java/org/elasticsearch/test/rest/RestIT.java b/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java similarity index 74% rename from distribution/deb/src/test/java/org/elasticsearch/test/rest/RestIT.java rename to distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java index 94629641849..a94f0faf2d2 100644 --- a/distribution/deb/src/test/java/org/elasticsearch/test/rest/RestIT.java +++ b/distribution/deb/src/test/java/org/elasticsearch/test/rest/DebClientYamlTestSuiteIT.java @@ -20,18 +20,21 @@ package org.elasticsearch.test.rest; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; /** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ -public class RestIT extends ESClientYamlSuiteTestCase { - public RestIT(RestTestCandidate testCandidate) { +public class DebClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public DebClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java b/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java new file mode 100644 index 00000000000..ca54a3becd9 --- /dev/null +++ b/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/IntegTestZipClientYamlTestSuiteIT.java @@ -0,0 +1,40 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.test.rest; + +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; + +import java.io.IOException; + +/** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ +public class IntegTestZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public IntegTestZipClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, ClientYamlTestParseException { + return createParameters(0, 1); + } +} diff --git a/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/RestIT.java b/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java similarity index 74% rename from distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/RestIT.java rename to distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java index 94629641849..a5b7f46269f 100644 --- a/distribution/integ-test-zip/src/test/java/org/elasticsearch/test/rest/RestIT.java +++ b/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RpmClientYamlTestSuiteIT.java @@ -20,18 +20,21 @@ package org.elasticsearch.test.rest; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; /** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ -public class RestIT extends ESClientYamlSuiteTestCase { - public RestIT(RestTestCandidate testCandidate) { +public class RpmClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public RpmClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RestIT.java b/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java similarity index 74% rename from distribution/rpm/src/test/java/org/elasticsearch/test/rest/RestIT.java rename to distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java index 94629641849..73d323f7d50 100644 --- a/distribution/rpm/src/test/java/org/elasticsearch/test/rest/RestIT.java +++ b/distribution/tar/src/test/java/org/elasticsearch/test/rest/TarClientYamlTestSuiteIT.java @@ -20,18 +20,21 @@ package org.elasticsearch.test.rest; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; /** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ -public class RestIT extends ESClientYamlSuiteTestCase { - public RestIT(RestTestCandidate testCandidate) { +public class TarClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public TarClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/distribution/zip/src/test/java/org/elasticsearch/test/rest/RestIT.java b/distribution/zip/src/test/java/org/elasticsearch/test/rest/RestIT.java deleted file mode 100644 index 94629641849..00000000000 --- a/distribution/zip/src/test/java/org/elasticsearch/test/rest/RestIT.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.test.rest; - -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ -public class RestIT extends ESClientYamlSuiteTestCase { - public RestIT(RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return createParameters(0, 1); - } -} diff --git a/distribution/tar/src/test/java/org/elasticsearch/test/rest/RestIT.java b/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java similarity index 74% rename from distribution/tar/src/test/java/org/elasticsearch/test/rest/RestIT.java rename to distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java index 94629641849..329c8259d0b 100644 --- a/distribution/tar/src/test/java/org/elasticsearch/test/rest/RestIT.java +++ b/distribution/zip/src/test/java/org/elasticsearch/test/rest/ZipClientYamlTestSuiteIT.java @@ -20,18 +20,21 @@ package org.elasticsearch.test.rest; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; /** Rest integration test. Runs against a cluster started by {@code gradle integTest} */ -public class RestIT extends ESClientYamlSuiteTestCase { - public RestIT(RestTestCandidate testCandidate) { +public class ZipClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public ZipClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/docs/src/test/java/org/elasticsearch/smoketest/SmokeTestDocsIT.java b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java similarity index 80% rename from docs/src/test/java/org/elasticsearch/smoketest/SmokeTestDocsIT.java rename to docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java index d8eccda61a2..688eefc98d5 100644 --- a/docs/src/test/java/org/elasticsearch/smoketest/SmokeTestDocsIT.java +++ b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java @@ -22,21 +22,21 @@ package org.elasticsearch.smoketest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; import java.util.List; -public class SmokeTestDocsIT extends ESClientYamlSuiteTestCase { +public class DocsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public SmokeTestDocsIT(@Name("yaml") RestTestCandidate testCandidate) { + public DocsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } diff --git a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixAggregationRestIT.java b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java similarity index 73% rename from modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixAggregationRestIT.java rename to modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java index 47609494a61..6fb70ad3d63 100644 --- a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixAggregationRestIT.java +++ b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/MatrixStatsClientYamlTestSuiteIT.java @@ -20,22 +20,20 @@ package org.elasticsearch.search.aggregations.matrix; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -/** - * - */ -public class MatrixAggregationRestIT extends ESClientYamlSuiteTestCase { - public MatrixAggregationRestIT(@Name("yaml")RestTestCandidate testCandidate) { +public class MatrixStatsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public MatrixStatsClientYamlTestSuiteIT(@Name("yaml")ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonRestIT.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java similarity index 73% rename from modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonRestIT.java rename to modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java index 65ee917f30e..3c71f5710fd 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonRestIT.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/IngestCommonClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.ingest.common; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class IngestCommonRestIT extends ESClientYamlSuiteTestCase { +public class IngestCommonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public IngestCommonRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public IngestCommonClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/ExpressionRestIT.java b/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java similarity index 73% rename from modules/lang-expression/src/test/java/org/elasticsearch/script/expression/ExpressionRestIT.java rename to modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java index 8ff5168a7cf..3d1071ee17c 100644 --- a/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/ExpressionRestIT.java +++ b/modules/lang-expression/src/test/java/org/elasticsearch/script/expression/LangExpressionClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.script.expression; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class ExpressionRestIT extends ESClientYamlSuiteTestCase { +public class LangExpressionClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public ExpressionRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangExpressionClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/GroovyRestIT.java b/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java similarity index 73% rename from modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/GroovyRestIT.java rename to modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java index b681e5f6857..c8e9c74827a 100644 --- a/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/GroovyRestIT.java +++ b/modules/lang-groovy/src/test/java/org/elasticsearch/script/groovy/LangGroovyClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.script.groovy; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class GroovyRestIT extends ESClientYamlSuiteTestCase { +public class LangGroovyClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public GroovyRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangGroovyClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheRestIT.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java similarity index 73% rename from modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheRestIT.java rename to modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java index 95f86dec3c7..160327dbab6 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheRestIT.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/LangMustacheClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.script.mustache; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class MustacheRestIT extends ESClientYamlSuiteTestCase { +public class LangMustacheClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public MustacheRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangMustacheClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/PainlessRestIT.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java similarity index 73% rename from modules/lang-painless/src/test/java/org/elasticsearch/painless/PainlessRestIT.java rename to modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java index 353aa13f839..ca95dafd0b8 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/PainlessRestIT.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/LangPainlessClientYamlTestSuiteIT.java @@ -21,21 +21,22 @@ package org.elasticsearch.painless; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; /** Runs yaml rest tests */ -public class PainlessRestIT extends ESClientYamlSuiteTestCase { +public class LangPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public PainlessRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangPainlessClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorRestIT.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java similarity index 73% rename from modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorRestIT.java rename to modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java index f4ec1b5215e..24e92715ede 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorRestIT.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorClientYamlTestSuiteIT.java @@ -21,19 +21,20 @@ package org.elasticsearch.percolator; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class PercolatorRestIT extends ESClientYamlSuiteTestCase { - public PercolatorRestIT(@Name("yaml") RestTestCandidate testCandidate) { +public class PercolatorClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public PercolatorClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexRestIT.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java similarity index 74% rename from modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexRestIT.java rename to modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java index c67908f631d..186bb2f0a5e 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexRestIT.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexClientYamlTestSuiteIT.java @@ -22,19 +22,19 @@ package org.elasticsearch.index.reindex; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class ReindexRestIT extends ESClientYamlSuiteTestCase { - public ReindexRestIT(@Name("yaml") RestTestCandidate testCandidate) { +public class ReindexClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public ReindexClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3RestIT.java b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java similarity index 74% rename from modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3RestIT.java rename to modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java index 9aa57bc312f..2fce8e3022d 100644 --- a/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3RestIT.java +++ b/modules/transport-netty3/src/test/java/org/elasticsearch/http/netty3/Netty3ClientYamlTestSuiteIT.java @@ -22,20 +22,20 @@ package org.elasticsearch.http.netty3; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class Netty3RestIT extends ESClientYamlSuiteTestCase { +public class Netty3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public Netty3RestIT(@Name("yaml") RestTestCandidate testCandidate) { + public Netty3ClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4RestIT.java b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java similarity index 77% rename from modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4RestIT.java rename to modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java index 71cbf70abb3..8f7483e2791 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4RestIT.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4ClientYamlTestSuiteIT.java @@ -21,25 +21,25 @@ package org.elasticsearch.http.netty4; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; - import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; + import org.apache.lucene.util.TimeUnits; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; //TODO: This is a *temporary* workaround to ensure a timeout does not mask other problems @TimeoutSuite(millis = 30 * TimeUnits.MINUTE) -public class Netty4RestIT extends ESClientYamlSuiteTestCase { +public class Netty4ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public Netty4RestIT(@Name("yaml") RestTestCandidate testCandidate) { + public Netty4ClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } diff --git a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/AnalysisICURestIT.java b/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java similarity index 74% rename from plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/AnalysisICURestIT.java rename to plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java index 17e5e1c3ca7..47224836037 100644 --- a/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/AnalysisICURestIT.java +++ b/plugins/analysis-icu/src/test/java/org/elasticsearch/index/analysis/IcuClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.analysis; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AnalysisICURestIT extends ESClientYamlSuiteTestCase { +public class IcuClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AnalysisICURestIT(@Name("yaml") RestTestCandidate testCandidate) { + public IcuClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/AnalysisSmartChineseRestIT.java b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java similarity index 73% rename from plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/AnalysisSmartChineseRestIT.java rename to plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java index 58c86acea84..e99c5c2bacf 100644 --- a/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/AnalysisSmartChineseRestIT.java +++ b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.analysis; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AnalysisSmartChineseRestIT extends ESClientYamlSuiteTestCase { +public class KuromojiClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AnalysisSmartChineseRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public KuromojiClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java new file mode 100644 index 00000000000..975b84f1574 --- /dev/null +++ b/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/PhoneticClientYamlTestSuiteIT.java @@ -0,0 +1,42 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.index.analysis; + +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; + +import java.io.IOException; + +public class PhoneticClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + + public PhoneticClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, ClientYamlTestParseException { + return ESClientYamlSuiteTestCase.createParameters(0, 1); + } +} + diff --git a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiRestIT.java b/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java similarity index 73% rename from plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiRestIT.java rename to plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java index 5697fb55bde..6415dc436eb 100644 --- a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiRestIT.java +++ b/plugins/analysis-smartcn/src/test/java/org/elasticsearch/index/analysis/SmartCNClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.analysis; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AnalysisKuromojiRestIT extends ESClientYamlSuiteTestCase { +public class SmartCNClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AnalysisKuromojiRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public SmartCNClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java deleted file mode 100644 index 54da5de8e4a..00000000000 --- a/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/AnalysisPolishRestIT.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.index.analysis; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -public class AnalysisPolishRestIT extends ESClientYamlSuiteTestCase { - - public AnalysisPolishRestIT(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); - } -} - diff --git a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticRestIT.java b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java similarity index 73% rename from plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticRestIT.java rename to plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java index 48f1c4b1716..34d264122ef 100644 --- a/plugins/analysis-phonetic/src/test/java/org/elasticsearch/index/analysis/AnalysisPhoneticRestIT.java +++ b/plugins/analysis-stempel/src/test/java/org/elasticsearch/index/analysis/StempelClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.analysis; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AnalysisPhoneticRestIT extends ESClientYamlSuiteTestCase { +public class StempelClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AnalysisPhoneticRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public StempelClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryRestIT.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java similarity index 72% rename from plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryRestIT.java rename to plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java index 5506169f79d..30276c16c89 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/AzureDiscoveryRestIT.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/discovery/azure/classic/DiscoveryAzureClassicClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.discovery.azure.classic; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AzureDiscoveryRestIT extends ESClientYamlSuiteTestCase { +public class DiscoveryAzureClassicClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AzureDiscoveryRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public DiscoveryAzureClassicClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java similarity index 73% rename from plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java rename to plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java index cc621dd5949..f5f49c14833 100644 --- a/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/DiscoveryEc2RestIT.java +++ b/plugins/discovery-ec2/src/test/java/org/elasticsearch/cloud/aws/CloudAwsClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.cloud.aws; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class DiscoveryEc2RestIT extends ESClientYamlSuiteTestCase { +public class CloudAwsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public DiscoveryEc2RestIT(@Name("yaml") RestTestCandidate testCandidate) { + public CloudAwsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGCERestIT.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java similarity index 73% rename from plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGCERestIT.java rename to plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java index dae943f7bd2..8ce17ff9fa5 100644 --- a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGCERestIT.java +++ b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/DiscoveryGceClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.discovery.gce; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class DiscoveryGCERestIT extends ESClientYamlSuiteTestCase { +public class DiscoveryGceClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public DiscoveryGCERestIT(@Name("yaml") RestTestCandidate testCandidate) { + public DiscoveryGceClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentRestIT.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java similarity index 73% rename from plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentRestIT.java rename to plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java index 671b5b0ab95..d720a4abf28 100644 --- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentRestIT.java +++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.ingest.attachment; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class IngestAttachmentRestIT extends ESClientYamlSuiteTestCase { +public class IngestAttachmentClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public IngestAttachmentRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public IngestAttachmentClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpRestIT.java b/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java similarity index 73% rename from plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpRestIT.java rename to plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java index 19cd7226d43..26838b600da 100644 --- a/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpRestIT.java +++ b/plugins/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/IngestGeoIpClientYamlTestSuiteIT.java @@ -21,22 +21,21 @@ package org.elasticsearch.ingest.geoip; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -import java.util.Collection; -public class IngestGeoIpRestIT extends ESClientYamlSuiteTestCase { +public class IngestGeoIpClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public IngestGeoIpRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public IngestGeoIpClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/UserAgentRestIT.java b/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java similarity index 73% rename from plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/UserAgentRestIT.java rename to plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java index 0ca96698e3b..b0aa115a1a2 100644 --- a/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/UserAgentRestIT.java +++ b/plugins/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/IngestUserAgentClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.ingest.useragent; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class UserAgentRestIT extends ESClientYamlSuiteTestCase { +public class IngestUserAgentClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public UserAgentRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public IngestUserAgentClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleRestIT.java b/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java similarity index 73% rename from plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleRestIT.java rename to plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java index 62be8332439..0ef413d9595 100644 --- a/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleRestIT.java +++ b/plugins/jvm-example/src/test/java/org/elasticsearch/plugin/example/JvmExampleClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.plugin.example; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class JvmExampleRestIT extends ESClientYamlSuiteTestCase { +public class JvmExampleClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public JvmExampleRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public JvmExampleClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavaScriptRestIT.java b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java similarity index 73% rename from plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavaScriptRestIT.java rename to plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java index 014c7073e71..e89372c8b36 100644 --- a/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavaScriptRestIT.java +++ b/plugins/lang-javascript/src/test/java/org/elasticsearch/script/javascript/LangJavascriptClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.script.javascript; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class LangJavaScriptRestIT extends ESClientYamlSuiteTestCase { +public class LangJavascriptClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public LangJavaScriptRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangJavascriptClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonScriptRestIT.java b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java similarity index 73% rename from plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonScriptRestIT.java rename to plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java index cbf7547a580..618ea6b20e5 100644 --- a/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonScriptRestIT.java +++ b/plugins/lang-python/src/test/java/org/elasticsearch/script/python/LangPythonClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.script.python; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class LangPythonScriptRestIT extends ESClientYamlSuiteTestCase { +public class LangPythonClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public LangPythonScriptRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public LangPythonClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsRestIT.java b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsClientYamlTestSuiteIT.java similarity index 72% rename from plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsRestIT.java rename to plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsClientYamlTestSuiteIT.java index 0958225ae18..53a5c5c2813 100644 --- a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsRestIT.java +++ b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MapperAttachmentsClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.mapper.attachments; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class MapperAttachmentsRestIT extends ESClientYamlSuiteTestCase { +public class MapperAttachmentsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public MapperAttachmentsRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public MapperAttachmentsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3RestIT.java b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java similarity index 73% rename from plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3RestIT.java rename to plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java index 37a4490d38c..204f6c07a99 100644 --- a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3RestIT.java +++ b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/MapperMurmur3ClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.mapper.murmur3; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class MapperMurmur3RestIT extends ESClientYamlSuiteTestCase { +public class MapperMurmur3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public MapperMurmur3RestIT(@Name("yaml") RestTestCandidate testCandidate) { + public MapperMurmur3ClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeRestIT.java b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java similarity index 73% rename from plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeRestIT.java rename to plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java index f5ee35c5638..44f26c4ec51 100644 --- a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeRestIT.java +++ b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/MapperSizeClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.mapper.size; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class MapperSizeRestIT extends ESClientYamlSuiteTestCase { +public class MapperSizeClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public MapperSizeRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public MapperSizeClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java similarity index 73% rename from plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java rename to plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java index 3c565d407ce..c7eeff27401 100644 --- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositoryRestIT.java +++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/RepositoryAzureClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.repositories.azure; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class AzureRepositoryRestIT extends ESClientYamlSuiteTestCase { +public class RepositoryAzureClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public AzureRepositoryRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public RepositoryAzureClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepositoryRestIT.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java similarity index 74% rename from plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepositoryRestIT.java rename to plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java index b19b8623ace..52145bf87e2 100644 --- a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepositoryRestIT.java +++ b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/RepositoryGcsClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.repositories.gcs; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class GoogleCloudStorageRepositoryRestIT extends ESClientYamlSuiteTestCase { +public class RepositoryGcsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public GoogleCloudStorageRepositoryRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public RepositoryGcsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsRepositoryRestIT.java b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java similarity index 73% rename from plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsRepositoryRestIT.java rename to plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java index 147838df9ea..1dfbb3c51b7 100644 --- a/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/HdfsRepositoryRestIT.java +++ b/plugins/repository-hdfs/src/test/java/org/elasticsearch/repositories/hdfs/RepositoryHdfsClientYamlTestSuiteIT.java @@ -22,18 +22,19 @@ import java.io.IOException; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; -public class HdfsRepositoryRestIT extends ESClientYamlSuiteTestCase { +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; - public HdfsRepositoryRestIT(@Name("yaml") RestTestCandidate testCandidate) { +public class RepositoryHdfsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + + public RepositoryHdfsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java similarity index 73% rename from plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java rename to plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java index 5dada2a2637..04c4f6fc0f1 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3RestIT.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryS3ClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.repositories.s3; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class RepositoryS3RestIT extends ESClientYamlSuiteTestCase { +public class RepositoryS3ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public RepositoryS3RestIT(@Name("yaml") RestTestCandidate testCandidate) { + public RepositoryS3ClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/SMBStoreRestIT.java b/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java similarity index 73% rename from plugins/store-smb/src/test/java/org/elasticsearch/index/store/SMBStoreRestIT.java rename to plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java index 99617b94644..72394b79693 100644 --- a/plugins/store-smb/src/test/java/org/elasticsearch/index/store/SMBStoreRestIT.java +++ b/plugins/store-smb/src/test/java/org/elasticsearch/index/store/StoreSmbClientYamlTestSuiteIT.java @@ -21,20 +21,21 @@ package org.elasticsearch.index.store; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class SMBStoreRestIT extends ESClientYamlSuiteTestCase { +public class StoreSmbClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public SMBStoreRestIT(@Name("yaml") RestTestCandidate testCandidate) { + public StoreSmbClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } } diff --git a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/MultiNodeBackwardsIT.java b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java similarity index 76% rename from qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/MultiNodeBackwardsIT.java rename to qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java index e23ca840025..e3ab68b3477 100644 --- a/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/MultiNodeBackwardsIT.java +++ b/qa/backwards-5.0/src/test/java/org/elasticsearch/backwards/Backwards50ClientYamlTestSuiteIT.java @@ -22,21 +22,21 @@ package org.elasticsearch.backwards; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import org.apache.lucene.util.TimeUnits; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; @TimeoutSuite(millis = 40 * TimeUnits.MINUTE) // some of the windows test VMs are slow as hell -public class MultiNodeBackwardsIT extends ESClientYamlSuiteTestCase { +public class Backwards50ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public MultiNodeBackwardsIT(RestTestCandidate testCandidate) { + public Backwards50ClientYamlTestSuiteIT(ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return createParameters(0, 1); } } diff --git a/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiIT.java b/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java similarity index 72% rename from qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiIT.java rename to qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java index 78d7acd8c24..c8d506424c0 100644 --- a/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiIT.java +++ b/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestDisabledClientYamlTestSuiteIT.java @@ -21,21 +21,22 @@ package org.elasticsearch.smoketest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class SmokeTestMultiIT extends ESClientYamlSuiteTestCase { +public class SmokeTestIngestDisabledClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public SmokeTestMultiIT(@Name("yaml") RestTestCandidate testCandidate) { + public SmokeTestIngestDisabledClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } -} +} diff --git a/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsIT.java b/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java similarity index 72% rename from qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsIT.java rename to qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java index 61903e62993..b3b84dfc55e 100644 --- a/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsIT.java +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/SmokeTestIngestWithAllDepsClientYamlTestSuiteIT.java @@ -21,21 +21,22 @@ package org.elasticsearch.smoketest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class SmokeTestPluginsIT extends ESClientYamlSuiteTestCase { +public class SmokeTestIngestWithAllDepsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public SmokeTestPluginsIT(@Name("yaml") RestTestCandidate testCandidate) { + public SmokeTestIngestWithAllDepsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } -} +} diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/IngestWithDependenciesIT.java b/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java similarity index 72% rename from qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/IngestWithDependenciesIT.java rename to qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java index 1ed23e7add5..456387e6c19 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/smoketest/IngestWithDependenciesIT.java +++ b/qa/smoke-test-multinode/src/test/java/org/elasticsearch/smoketest/SmokeTestMultiNodeClientYamlTestSuiteIT.java @@ -21,21 +21,22 @@ package org.elasticsearch.smoketest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class IngestWithDependenciesIT extends ESClientYamlSuiteTestCase { +public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public IngestWithDependenciesIT(@Name("yaml") RestTestCandidate testCandidate) { + public SmokeTestMultiNodeClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } - } + diff --git a/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/IngestDisabledIT.java b/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java similarity index 73% rename from qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/IngestDisabledIT.java rename to qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java index d1cb62cc54b..05021f3c2bb 100644 --- a/qa/smoke-test-ingest-disabled/src/test/java/org/elasticsearch/smoketest/IngestDisabledIT.java +++ b/qa/smoke-test-plugins/src/test/java/org/elasticsearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java @@ -21,21 +21,22 @@ package org.elasticsearch.smoketest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; import java.io.IOException; -public class IngestDisabledIT extends ESClientYamlSuiteTestCase { +public class SmokeTestPluginsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { - public IngestDisabledIT(@Name("yaml") RestTestCandidate testCandidate) { + public SmokeTestPluginsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { + public static Iterable parameters() throws IOException, ClientYamlTestParseException { return ESClientYamlSuiteTestCase.createParameters(0, 1); } - } + diff --git a/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java b/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java new file mode 100644 index 00000000000..db01ce2dfe9 --- /dev/null +++ b/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java @@ -0,0 +1,40 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.smoketest; + +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; + +import java.io.IOException; + +public class SmokeTestReindexWithPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { + public SmokeTestReindexWithPainlessClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, ClientYamlTestParseException { + return ESClientYamlSuiteTestCase.createParameters(0, 1); + } +} diff --git a/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessIT.java b/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessIT.java deleted file mode 100644 index b7061432325..00000000000 --- a/qa/smoke-test-reindex-with-painless/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessIT.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.smoketest; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -public class SmokeTestReindexWithPainlessIT extends ESClientYamlSuiteTestCase { - public SmokeTestReindexWithPainlessIT(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESClientYamlSuiteTestCase.createParameters(0, 1); - } -} diff --git a/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java b/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java index d5c14935ecd..92433649553 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java +++ b/test/framework/src/main/java/org/elasticsearch/test/junit/listeners/ReproduceInfoPrinter.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; import org.junit.internal.AssumptionViolatedException; import org.junit.runner.Description; import org.junit.runner.notification.Failure; @@ -37,9 +37,9 @@ import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_ITERATIONS; import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_PREFIX; import static com.carrotsearch.randomizedtesting.SysGlobals.SYSPROP_TESTMETHOD; import static org.elasticsearch.test.ESIntegTestCase.TESTS_CLUSTER; -import static org.elasticsearch.test.rest.ESClientYamlSuiteTestCase.REST_TESTS_BLACKLIST; -import static org.elasticsearch.test.rest.ESClientYamlSuiteTestCase.REST_TESTS_SPEC; -import static org.elasticsearch.test.rest.ESClientYamlSuiteTestCase.REST_TESTS_SUITE; +import static org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.REST_TESTS_BLACKLIST; +import static org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.REST_TESTS_SPEC; +import static org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.REST_TESTS_SUITE; /** * A {@link RunListener} that emits a command you can use to re-run a failing test with the failing random seed to diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcher.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcher.java similarity index 98% rename from test/framework/src/main/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcher.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcher.java index e5bb75955cf..f0e0802a6b2 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcher.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcher.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import java.util.regex.Pattern; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/RestTestCandidate.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestCandidate.java similarity index 67% rename from test/framework/src/main/java/org/elasticsearch/test/rest/RestTestCandidate.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestCandidate.java index 57c7e1b1305..dd650a38ebb 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/RestTestCandidate.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestCandidate.java @@ -16,23 +16,22 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; -import org.elasticsearch.test.rest.section.RestTestSuite; -import org.elasticsearch.test.rest.section.SetupSection; -import org.elasticsearch.test.rest.section.TeardownSection; -import org.elasticsearch.test.rest.section.TestSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSuite; +import org.elasticsearch.test.rest.yaml.section.SetupSection; +import org.elasticsearch.test.rest.yaml.section.TeardownSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection; /** - * Wraps {@link org.elasticsearch.test.rest.section.TestSection}s ready to be run. - * Each test section is associated to its {@link org.elasticsearch.test.rest.section.RestTestSuite}. + * Wraps {@link ClientYamlTestSection}s ready to be run. Each test section is associated to its {@link ClientYamlTestSuite}. */ -public class RestTestCandidate { +public class ClientYamlTestCandidate { - private final RestTestSuite restTestSuite; - private final TestSection testSection; + private final ClientYamlTestSuite restTestSuite; + private final ClientYamlTestSection testSection; - public RestTestCandidate(RestTestSuite restTestSuite, TestSection testSection) { + public ClientYamlTestCandidate(ClientYamlTestSuite restTestSuite, ClientYamlTestSection testSection) { this.restTestSuite = restTestSuite; this.testSection = testSection; } @@ -61,7 +60,7 @@ public class RestTestCandidate { return restTestSuite.getTeardownSection(); } - public TestSection getTestSection() { + public ClientYamlTestSection getTestSection() { return testSection; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/RestTestExecutionContext.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java similarity index 79% rename from test/framework/src/main/java/org/elasticsearch/test/rest/RestTestExecutionContext.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java index 59d45bc0a88..f99ee4be83f 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/RestTestExecutionContext.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import org.apache.http.HttpHost; import org.elasticsearch.Version; @@ -24,10 +24,10 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.test.rest.client.RestTestClient; -import org.elasticsearch.test.rest.client.RestTestResponse; -import org.elasticsearch.test.rest.client.RestTestResponseException; -import org.elasticsearch.test.rest.spec.RestSpec; +import org.elasticsearch.test.rest.yaml.client.ClientYamlTestClient; +import org.elasticsearch.test.rest.yaml.client.ClientYamlTestResponse; +import org.elasticsearch.test.rest.yaml.client.ClientYamlTestResponseException; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; import java.io.IOException; import java.util.HashMap; @@ -40,19 +40,19 @@ import java.util.Map; * Caches the last obtained test response and allows to stash part of it within variables * that can be used as input values in following requests. */ -public class RestTestExecutionContext { +public class ClientYamlTestExecutionContext { - private static final ESLogger logger = Loggers.getLogger(RestTestExecutionContext.class); + private static final ESLogger logger = Loggers.getLogger(ClientYamlTestExecutionContext.class); private final Stash stash = new Stash(); - private final RestSpec restSpec; + private final ClientYamlSuiteRestSpec restSpec; - private RestTestClient restTestClient; + private ClientYamlTestClient restTestClient; - private RestTestResponse response; + private ClientYamlTestResponse response; - public RestTestExecutionContext(RestSpec restSpec) { + public ClientYamlTestExecutionContext(ClientYamlSuiteRestSpec restSpec) { this.restSpec = restSpec; } @@ -60,7 +60,7 @@ public class RestTestExecutionContext { * Calls an elasticsearch api with the parameters and request body provided as arguments. * Saves the obtained response in the execution context. */ - public RestTestResponse callApi(String apiName, Map params, List> bodies, + public ClientYamlTestResponse callApi(String apiName, Map params, List> bodies, Map headers) throws IOException { //makes a copy of the parameters before modifying them for this specific request HashMap requestParams = new HashMap<>(params); @@ -74,7 +74,7 @@ public class RestTestExecutionContext { try { response = callApiInternal(apiName, requestParams, body, headers); return response; - } catch(RestTestResponseException e) { + } catch(ClientYamlTestResponseException e) { response = e.getRestTestResponse(); throw e; } finally { @@ -103,7 +103,7 @@ public class RestTestExecutionContext { return XContentFactory.jsonBuilder().map(body).string(); } - private RestTestResponse callApiInternal(String apiName, Map params, String body, Map headers) + private ClientYamlTestResponse callApiInternal(String apiName, Map params, String body, Map headers) throws IOException { return restTestClient.callApi(apiName, params, body, headers); } @@ -119,7 +119,7 @@ public class RestTestExecutionContext { * Creates the embedded REST client when needed. Needs to be called before each test. */ public void initClient(RestClient client, List hosts) throws IOException { - restTestClient = new RestTestClient(restSpec, client, hosts); + restTestClient = new ClientYamlTestClient(restSpec, client, hosts); } /** diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java similarity index 83% rename from test/framework/src/main/java/org/elasticsearch/test/rest/ESClientYamlSuiteTestCase.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index 2611e20d447..ae1853ccec3 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import com.carrotsearch.randomizedtesting.RandomizedTest; @@ -25,16 +25,17 @@ import org.apache.lucene.util.IOUtils; import org.elasticsearch.common.Strings; import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.test.rest.parser.RestTestSuiteParser; -import org.elasticsearch.test.rest.section.DoSection; -import org.elasticsearch.test.rest.section.ExecutableSection; -import org.elasticsearch.test.rest.section.RestTestSuite; -import org.elasticsearch.test.rest.section.SkipSection; -import org.elasticsearch.test.rest.section.TestSection; -import org.elasticsearch.test.rest.spec.RestApi; -import org.elasticsearch.test.rest.spec.RestSpec; -import org.elasticsearch.test.rest.support.FileUtils; +import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParser; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSuite; +import org.elasticsearch.test.rest.yaml.section.DoSection; +import org.elasticsearch.test.rest.yaml.section.ExecutableSection; +import org.elasticsearch.test.rest.yaml.section.SkipSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection; +import org.elasticsearch.test.rest.yaml.support.FileUtils; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -97,12 +98,12 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { private static final String PATHS_SEPARATOR = "(? blacklistPathMatchers = new ArrayList<>(); - private static RestTestExecutionContext restTestExecutionContext; - private static RestTestExecutionContext adminExecutionContext; + private static ClientYamlTestExecutionContext restTestExecutionContext; + private static ClientYamlTestExecutionContext adminExecutionContext; - private final RestTestCandidate testCandidate; + private final ClientYamlTestCandidate testCandidate; - public ESClientYamlSuiteTestCase(RestTestCandidate testCandidate) { + public ESClientYamlSuiteTestCase(ClientYamlTestCandidate testCandidate) { this.testCandidate = testCandidate; String[] blacklist = resolvePathsProperty(REST_TESTS_BLACKLIST, null); for (String entry : blacklist) { @@ -117,34 +118,34 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { super.afterIfFailed(errors); } - public static Iterable createParameters(int id, int count) throws IOException, RestTestParseException { + public static Iterable createParameters(int id, int count) throws IOException, ClientYamlTestParseException { //parse tests only if rest test group is enabled, otherwise rest tests might not even be available on file system - List restTestCandidates = collectTestCandidates(id, count); + List restTestCandidates = collectTestCandidates(id, count); List objects = new ArrayList<>(); - for (RestTestCandidate restTestCandidate : restTestCandidates) { + for (ClientYamlTestCandidate restTestCandidate : restTestCandidates) { objects.add(new Object[]{restTestCandidate}); } return objects; } - private static List collectTestCandidates(int id, int count) throws RestTestParseException, IOException { - List testCandidates = new ArrayList<>(); + private static List collectTestCandidates(int id, int count) throws ClientYamlTestParseException, IOException { + List testCandidates = new ArrayList<>(); FileSystem fileSystem = getFileSystem(); // don't make a try-with, getFileSystem returns null // ... and you can't close() the default filesystem try { String[] paths = resolvePathsProperty(REST_TESTS_SUITE, DEFAULT_TESTS_PATH); Map> yamlSuites = FileUtils.findYamlSuites(fileSystem, DEFAULT_TESTS_PATH, paths); - RestTestSuiteParser restTestSuiteParser = new RestTestSuiteParser(); + ClientYamlTestSuiteParser restTestSuiteParser = new ClientYamlTestSuiteParser(); //yaml suites are grouped by directory (effectively by api) for (String api : yamlSuites.keySet()) { List yamlFiles = new ArrayList<>(yamlSuites.get(api)); for (Path yamlFile : yamlFiles) { String key = api + yamlFile.getFileName().toString(); if (mustExecute(key, id, count)) { - RestTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile); - for (TestSection testSection : restTestSuite.getTestSections()) { - testCandidates.add(new RestTestCandidate(restTestSuite, testSection)); + ClientYamlTestSuite restTestSuite = restTestSuiteParser.parse(api, yamlFile); + for (ClientYamlTestSection testSection : restTestSuite.getTestSections()) { + testCandidates.add(new ClientYamlTestCandidate(restTestSuite, testSection)); } } } @@ -154,9 +155,9 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { } //sort the candidates so they will always be in the same order before being shuffled, for repeatability - Collections.sort(testCandidates, new Comparator() { + Collections.sort(testCandidates, new Comparator() { @Override - public int compare(RestTestCandidate o1, RestTestCandidate o2) { + public int compare(ClientYamlTestCandidate o1, ClientYamlTestCandidate o2) { return o1.getTestPath().compareTo(o2.getTestPath()); } }); @@ -209,29 +210,29 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { @BeforeClass public static void initExecutionContext() throws IOException { String[] specPaths = resolvePathsProperty(REST_TESTS_SPEC, DEFAULT_SPEC_PATH); - RestSpec restSpec = null; + ClientYamlSuiteRestSpec restSpec = null; FileSystem fileSystem = getFileSystem(); // don't make a try-with, getFileSystem returns null // ... and you can't close() the default filesystem try { - restSpec = RestSpec.parseFrom(fileSystem, DEFAULT_SPEC_PATH, specPaths); + restSpec = ClientYamlSuiteRestSpec.parseFrom(fileSystem, DEFAULT_SPEC_PATH, specPaths); } finally { IOUtils.close(fileSystem); } validateSpec(restSpec); - restTestExecutionContext = new RestTestExecutionContext(restSpec); - adminExecutionContext = new RestTestExecutionContext(restSpec); + restTestExecutionContext = new ClientYamlTestExecutionContext(restSpec); + adminExecutionContext = new ClientYamlTestExecutionContext(restSpec); } - protected RestTestExecutionContext getAdminExecutionContext() { + protected ClientYamlTestExecutionContext getAdminExecutionContext() { return adminExecutionContext; } - private static void validateSpec(RestSpec restSpec) { + private static void validateSpec(ClientYamlSuiteRestSpec restSpec) { boolean validateSpec = RandomizedTest.systemPropertyAsBoolean(REST_TESTS_VALIDATE_SPEC, true); if (validateSpec) { StringBuilder errorMessage = new StringBuilder(); - for (RestApi restApi : restSpec.getApis()) { + for (ClientYamlSuiteRestApi restApi : restSpec.getApis()) { if (restApi.getMethods().contains("GET") && restApi.isBodySupported()) { if (!restApi.getMethods().contains("POST")) { errorMessage.append("\n- ").append(restApi.getName()).append(" supports GET with a body but doesn't support POST"); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ObjectPath.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java similarity index 99% rename from test/framework/src/main/java/org/elasticsearch/test/rest/ObjectPath.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java index 8c492d279b0..6311944fdcb 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ObjectPath.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentParser; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/Stash.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java similarity index 99% rename from test/framework/src/main/java/org/elasticsearch/test/rest/Stash.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java index f687f2b39bf..dff1e59762e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/Stash.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.ESLogger; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestClient.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestClient.java similarity index 84% rename from test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestClient.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestClient.java index 2fb0374d048..c21e905ed5c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestClient.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestClient.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.client; +package org.elasticsearch.test.rest.yaml.client; import com.carrotsearch.randomizedtesting.RandomizedTest; @@ -34,8 +34,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.test.rest.spec.RestApi; -import org.elasticsearch.test.rest.spec.RestSpec; +import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestPath; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; import java.io.IOException; import java.net.URI; @@ -49,20 +51,20 @@ import java.util.Objects; import java.util.Set; /** - * REST client used to test the elasticsearch REST layer. - * Wraps a {@link RestClient} instance used to send the REST requests. - * Holds the {@link RestSpec} used to translate api calls into REST calls + * Used by {@link ESClientYamlSuiteTestCase} to execute REST requests according to the tests written in yaml suite files. Wraps a + * {@link RestClient} instance used to send the REST requests. Holds the {@link ClientYamlSuiteRestSpec} used to translate api calls into + * REST calls. */ -public class RestTestClient { - private static final ESLogger logger = Loggers.getLogger(RestTestClient.class); +public class ClientYamlTestClient { + private static final ESLogger logger = Loggers.getLogger(ClientYamlTestClient.class); //query_string params that don't need to be declared in the spec, they are supported by default private static final Set ALWAYS_ACCEPTED_QUERY_STRING_PARAMS = Sets.newHashSet("pretty", "source", "filter_path"); - private final RestSpec restSpec; + private final ClientYamlSuiteRestSpec restSpec; private final RestClient restClient; private final Version esVersion; - public RestTestClient(RestSpec restSpec, RestClient restClient, List hosts) throws IOException { + public ClientYamlTestClient(ClientYamlSuiteRestSpec restSpec, RestClient restClient, List hosts) throws IOException { assert hosts.size() > 0; this.restSpec = restSpec; this.restClient = restClient; @@ -70,7 +72,7 @@ public class RestTestClient { } private Version readAndCheckVersion(List hosts) throws IOException { - RestApi restApi = restApi("info"); + ClientYamlSuiteRestApi restApi = restApi("info"); assert restApi.getPaths().size() == 1; assert restApi.getMethods().size() == 1; @@ -80,7 +82,7 @@ public class RestTestClient { String method = restApi.getMethods().get(0); String endpoint = restApi.getPaths().get(0); Response response = restClient.performRequest(method, endpoint); - RestTestResponse restTestResponse = new RestTestResponse(response); + ClientYamlTestResponse restTestResponse = new ClientYamlTestResponse(response); Object latestVersion = restTestResponse.evaluate("version.number"); if (latestVersion == null) { throw new RuntimeException("elasticsearch version not found in the response"); @@ -103,7 +105,7 @@ public class RestTestClient { /** * Calls an api with the provided parameters and body */ - public RestTestResponse callApi(String apiName, Map params, String body, Map headers) + public ClientYamlTestResponse callApi(String apiName, Map params, String body, Map headers) throws IOException { if ("raw".equals(apiName)) { @@ -118,9 +120,9 @@ public class RestTestClient { // And everything else is a url parameter! try { Response response = restClient.performRequest(method, path, queryStringParams, entity); - return new RestTestResponse(response); + return new ClientYamlTestResponse(response); } catch(ResponseException e) { - throw new RestTestResponseException(e); + throw new ClientYamlTestResponseException(e); } } @@ -146,7 +148,7 @@ public class RestTestClient { //create doesn't exist in the spec but is supported in the clients (index with op_type=create) boolean indexCreateApi = "create".equals(apiName); String api = indexCreateApi ? "index" : apiName; - RestApi restApi = restApi(api); + ClientYamlSuiteRestApi restApi = restApi(api); //divide params between ones that go within query string and ones that go within path Map pathParts = new HashMap<>(); @@ -192,7 +194,7 @@ public class RestTestClient { } //the rest path to use is randomized out of the matching ones (if more than one) - RestPath restPath = RandomizedTest.randomFrom(restApi.getFinalPaths(pathParts)); + ClientYamlSuiteRestPath restPath = RandomizedTest.randomFrom(restApi.getFinalPaths(pathParts)); //Encode rules for path and query string parameters are different. We use URI to encode the path. //We need to encode each path part separately, as each one might contain slashes that need to be escaped, which needs to //be done manually. @@ -225,17 +227,17 @@ public class RestTestClient { logger.debug("calling api [{}]", apiName); try { Response response = restClient.performRequest(requestMethod, requestPath, queryStringParams, requestBody, requestHeaders); - return new RestTestResponse(response); + return new ClientYamlTestResponse(response); } catch(ResponseException e) { if (ignores.contains(e.getResponse().getStatusLine().getStatusCode())) { - return new RestTestResponse(e.getResponse()); + return new ClientYamlTestResponse(e.getResponse()); } - throw new RestTestResponseException(e); + throw new ClientYamlTestResponseException(e); } } - private RestApi restApi(String apiName) { - RestApi restApi = restSpec.getApi(apiName); + private ClientYamlSuiteRestApi restApi(String apiName) { + ClientYamlSuiteRestApi restApi = restSpec.getApi(apiName); if (restApi == null) { throw new IllegalArgumentException("rest api [" + apiName + "] doesn't exist in the rest spec"); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponse.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponse.java similarity index 94% rename from test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponse.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponse.java index 9149824c33c..9ccdd89592f 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponse.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponse.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.client; +package org.elasticsearch.test.rest.yaml.client; import org.apache.http.client.methods.HttpHead; import org.apache.http.util.EntityUtils; import org.elasticsearch.client.Response; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.rest.ObjectPath; -import org.elasticsearch.test.rest.Stash; +import org.elasticsearch.test.rest.yaml.ObjectPath; +import org.elasticsearch.test.rest.yaml.Stash; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -32,13 +32,13 @@ import java.nio.charset.StandardCharsets; * Response obtained from a REST call, eagerly reads the response body into a string for later optional parsing. * Supports parsing the response body when needed and returning specific values extracted from it. */ -public class RestTestResponse { +public class ClientYamlTestResponse { private final Response response; private final String body; private ObjectPath parsedResponse; - RestTestResponse(Response response) throws IOException { + ClientYamlTestResponse(Response response) throws IOException { this.response = response; if (response.getEntity() != null) { try { diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponseException.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponseException.java similarity index 80% rename from test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponseException.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponseException.java index 2fc93a91088..73719202c10 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestTestResponseException.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/client/ClientYamlTestResponseException.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.client; +package org.elasticsearch.test.rest.yaml.client; import org.elasticsearch.client.ResponseException; @@ -27,21 +27,21 @@ import java.io.IOException; * Exception obtained from a REST call in case the response code indicated an error. Eagerly reads the response body into a string * for later optional parsing. Supports parsing the response body when needed and returning specific values extracted from it. */ -public class RestTestResponseException extends IOException { +public class ClientYamlTestResponseException extends IOException { - private final RestTestResponse restTestResponse; + private final ClientYamlTestResponse restTestResponse; private final ResponseException responseException; - RestTestResponseException(ResponseException responseException) throws IOException { + ClientYamlTestResponseException(ResponseException responseException) throws IOException { super(responseException); this.responseException = responseException; - this.restTestResponse = new RestTestResponse(responseException.getResponse()); + this.restTestResponse = new ClientYamlTestResponse(responseException.getResponse()); } /** * Exposes the obtained response body */ - public RestTestResponse getRestTestResponse() { + public ClientYamlTestResponse getRestTestResponse() { return restTestResponse; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestFragmentParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestFragmentParser.java similarity index 76% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestFragmentParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestFragmentParser.java index 8d2bd8be76f..390ac1ce366 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestFragmentParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestFragmentParser.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import java.io.IOException; @@ -24,10 +24,10 @@ import java.io.IOException; * Base parser for a REST test suite fragment * @param the test fragment's type that gets parsed and returned */ -public interface RestTestFragmentParser { +public interface ClientYamlTestFragmentParser { /** - * Parses a test fragment given the current {@link RestTestSuiteParseContext} + * Parses a test fragment given the current {@link ClientYamlTestSuiteParseContext} */ - T parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException; + T parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestParseException.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestParseException.java similarity index 80% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestParseException.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestParseException.java index 3e1af2cd749..594f701c79a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestParseException.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestParseException.java @@ -16,18 +16,18 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; /** * Exception thrown whenever there is a problem parsing any of the REST test suite fragment */ -public class RestTestParseException extends Exception { +public class ClientYamlTestParseException extends Exception { - RestTestParseException(String message) { + ClientYamlTestParseException(String message) { super(message); } - RestTestParseException(String message, Throwable cause) { + ClientYamlTestParseException(String message, Throwable cause) { super(message, cause); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSectionParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSectionParser.java similarity index 74% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSectionParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSectionParser.java index e1d2011e231..b6e8ad6c0f4 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSectionParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSectionParser.java @@ -16,23 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.rest.section.TestSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection; import java.io.IOException; /** * Parser for a complete test section */ -public class RestTestSectionParser implements RestTestFragmentParser { +public class ClientYamlTestSectionParser implements ClientYamlTestFragmentParser { @Override - public TestSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public ClientYamlTestSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); parseContext.advanceToFieldName(); - TestSection testSection = new TestSection(parser.currentName()); + ClientYamlTestSection testSection = new ClientYamlTestSection(parser.currentName()); try { parser.nextToken(); testSection.setSkipSection(parseContext.parseSkipSection()); @@ -48,7 +48,7 @@ public class RestTestSectionParser implements RestTestFragmentParser> EXECUTABLE_SECTIONS_PARSERS = new HashMap<>(); + private static final Map> EXECUTABLE_SECTIONS_PARSERS = + new HashMap<>(); static { EXECUTABLE_SECTIONS_PARSERS.put("do", DO_SECTION_PARSER); EXECUTABLE_SECTIONS_PARSERS.put("set", new SetSectionParser()); @@ -62,7 +62,7 @@ public class RestTestSuiteParseContext { private final String suiteName; private final XContentParser parser; - public RestTestSuiteParseContext(String api, String suiteName, XContentParser parser) { + public ClientYamlTestSuiteParseContext(String api, String suiteName, XContentParser parser) { this.api = api; this.suiteName = suiteName; this.parser = parser; @@ -80,7 +80,7 @@ public class RestTestSuiteParseContext { return parser; } - public SetupSection parseSetupSection() throws IOException, RestTestParseException { + public SetupSection parseSetupSection() throws IOException, ClientYamlTestParseException { advanceToFieldName(); @@ -94,7 +94,7 @@ public class RestTestSuiteParseContext { return SetupSection.EMPTY; } - public TeardownSection parseTeardownSection() throws IOException, RestTestParseException { + public TeardownSection parseTeardownSection() throws IOException, ClientYamlTestParseException { advanceToFieldName(); if ("teardown".equals(parser.currentName())) { @@ -107,11 +107,11 @@ public class RestTestSuiteParseContext { return TeardownSection.EMPTY; } - public TestSection parseTestSection() throws IOException, RestTestParseException { + public ClientYamlTestSection parseTestSection() throws IOException, ClientYamlTestParseException { return TEST_SECTION_PARSER.parse(this); } - public SkipSection parseSkipSection() throws IOException, RestTestParseException { + public SkipSection parseSkipSection() throws IOException, ClientYamlTestParseException { advanceToFieldName(); @@ -124,12 +124,12 @@ public class RestTestSuiteParseContext { return SkipSection.EMPTY; } - public ExecutableSection parseExecutableSection() throws IOException, RestTestParseException { + public ExecutableSection parseExecutableSection() throws IOException, ClientYamlTestParseException { advanceToFieldName(); String section = parser.currentName(); - RestTestFragmentParser execSectionParser = EXECUTABLE_SECTIONS_PARSERS.get(section); + ClientYamlTestFragmentParser execSectionParser = EXECUTABLE_SECTIONS_PARSERS.get(section); if (execSectionParser == null) { - throw new RestTestParseException("no parser found for executable section [" + section + "]"); + throw new ClientYamlTestParseException("no parser found for executable section [" + section + "]"); } XContentLocation location = parser.getTokenLocation(); try { @@ -141,11 +141,11 @@ public class RestTestSuiteParseContext { } } - public DoSection parseDoSection() throws IOException, RestTestParseException { + public DoSection parseDoSection() throws IOException, ClientYamlTestParseException { return DO_SECTION_PARSER.parse(this); } - public void advanceToFieldName() throws IOException, RestTestParseException { + public void advanceToFieldName() throws IOException, ClientYamlTestParseException { XContentParser.Token token = parser.currentToken(); //we are in the beginning, haven't called nextToken yet if (token == null) { @@ -158,12 +158,12 @@ public class RestTestSuiteParseContext { token = parser.nextToken(); } if (token != XContentParser.Token.FIELD_NAME) { - throw new RestTestParseException("malformed test section: field name expected but found " + token + " at " + throw new ClientYamlTestParseException("malformed test section: field name expected but found " + token + " at " + parser.getTokenLocation()); } } - public String parseField() throws IOException, RestTestParseException { + public String parseField() throws IOException, ClientYamlTestParseException { parser.nextToken(); assert parser.currentToken().isValue(); String field = parser.text(); @@ -171,7 +171,7 @@ public class RestTestSuiteParseContext { return field; } - public Tuple parseTuple() throws IOException, RestTestParseException { + public Tuple parseTuple() throws IOException, ClientYamlTestParseException { parser.nextToken(); advanceToFieldName(); Map map = parser.map(); @@ -179,7 +179,7 @@ public class RestTestSuiteParseContext { parser.nextToken(); if (map.size() != 1) { - throw new RestTestParseException("expected key value pair but found " + map.size() + " "); + throw new ClientYamlTestParseException("expected key value pair but found " + map.size() + " "); } Map.Entry entry = map.entrySet().iterator().next(); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSuiteParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSuiteParser.java similarity index 72% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSuiteParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSuiteParser.java index f22f0109594..65277888471 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/RestTestSuiteParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlTestSuiteParser.java @@ -16,13 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.section.RestTestSuite; -import org.elasticsearch.test.rest.section.TeardownSection; -import org.elasticsearch.test.rest.section.TestSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSuite; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection; import java.io.IOException; import java.nio.ByteBuffer; @@ -34,9 +33,9 @@ import java.nio.file.StandardOpenOption; /** * Parser for a complete test suite (yaml file) */ -public class RestTestSuiteParser implements RestTestFragmentParser { +public class ClientYamlTestSuiteParser implements ClientYamlTestFragmentParser { - public RestTestSuite parse(String api, Path file) throws IOException, RestTestParseException { + public ClientYamlTestSuite parse(String api, Path file) throws IOException, ClientYamlTestParseException { if (!Files.isRegularFile(file)) { throw new IllegalArgumentException(file.toAbsolutePath() + " is not a file"); @@ -54,27 +53,27 @@ public class RestTestSuiteParser implements RestTestFragmentParser { +public class DoSectionParser implements ClientYamlTestFragmentParser { @Override - public DoSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public DoSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); @@ -91,7 +91,7 @@ public class DoSectionParser implements RestTestFragmentParser { } try { if (apiCallSection == null) { - throw new RestTestParseException("client call section is mandatory within a do section"); + throw new ClientYamlTestParseException("client call section is mandatory within a do section"); } if (headers.isEmpty() == false) { apiCallSection.addHeaders(headers); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanEqualToParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanEqualToParser.java similarity index 70% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanEqualToParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanEqualToParser.java index 7a4cd0f316a..1ed71075970 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanEqualToParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanEqualToParser.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.GreaterThanEqualToAssertion; +import org.elasticsearch.test.rest.yaml.section.GreaterThanEqualToAssertion; import java.io.IOException; /** * Parser for gte assert sections */ -public class GreaterThanEqualToParser implements RestTestFragmentParser { - +public class GreaterThanEqualToParser implements ClientYamlTestFragmentParser { @Override - public GreaterThanEqualToAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public GreaterThanEqualToAssertion parse(ClientYamlTestSuiteParseContext parseContext) + throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); if (! (stringObjectTuple.v2() instanceof Comparable) ) { - throw new RestTestParseException("gte section can only be used with objects that support natural ordering, found " + throw new ClientYamlTestParseException("gte section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName()); } return new GreaterThanEqualToAssertion(stringObjectTuple.v1(), stringObjectTuple.v2()); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanParser.java similarity index 72% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanParser.java index 7e1ca1ece7f..ca76d486ab4 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/GreaterThanParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/GreaterThanParser.java @@ -16,23 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.GreaterThanAssertion; +import org.elasticsearch.test.rest.yaml.section.GreaterThanAssertion; import java.io.IOException; /** * Parser for gt assert sections */ -public class GreaterThanParser implements RestTestFragmentParser { +public class GreaterThanParser implements ClientYamlTestFragmentParser { @Override - public GreaterThanAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public GreaterThanAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); if (! (stringObjectTuple.v2() instanceof Comparable) ) { - throw new RestTestParseException("gt section can only be used with objects that support natural ordering, found " + throw new ClientYamlTestParseException("gt section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName()); } return new GreaterThanAssertion(stringObjectTuple.v1(), stringObjectTuple.v2()); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsFalseParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsFalseParser.java similarity index 74% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsFalseParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsFalseParser.java index 81cade6d84b..8a41df99002 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsFalseParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsFalseParser.java @@ -16,19 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; -import org.elasticsearch.test.rest.section.IsFalseAssertion; +import org.elasticsearch.test.rest.yaml.section.IsFalseAssertion; import java.io.IOException; /** * Parser for is_false assert sections */ -public class IsFalseParser implements RestTestFragmentParser { +public class IsFalseParser implements ClientYamlTestFragmentParser { @Override - public IsFalseAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public IsFalseAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { return new IsFalseAssertion(parseContext.parseField()); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsTrueParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsTrueParser.java similarity index 74% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsTrueParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsTrueParser.java index 922629b47ef..228cc29c262 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/IsTrueParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/IsTrueParser.java @@ -16,19 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; -import org.elasticsearch.test.rest.section.IsTrueAssertion; +import org.elasticsearch.test.rest.yaml.section.IsTrueAssertion; import java.io.IOException; /** * Parser for is_true assert sections */ -public class IsTrueParser implements RestTestFragmentParser { +public class IsTrueParser implements ClientYamlTestFragmentParser { @Override - public IsTrueAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public IsTrueAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { return new IsTrueAssertion(parseContext.parseField()); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LengthParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LengthParser.java similarity index 77% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/LengthParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LengthParser.java index 414be59f4cd..8a206130cb5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LengthParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LengthParser.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.LengthAssertion; +import org.elasticsearch.test.rest.yaml.section.LengthAssertion; import java.io.IOException; /** * Parser for length assert sections */ -public class LengthParser implements RestTestFragmentParser { +public class LengthParser implements ClientYamlTestFragmentParser { @Override - public LengthAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public LengthAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); assert stringObjectTuple.v2() != null; int value; @@ -39,7 +39,7 @@ public class LengthParser implements RestTestFragmentParser { try { value = Integer.valueOf(stringObjectTuple.v2().toString()); } catch(NumberFormatException e) { - throw new RestTestParseException("length is not a valid number", e); + throw new ClientYamlTestParseException("length is not a valid number", e); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanOrEqualToParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanOrEqualToParser.java similarity index 71% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanOrEqualToParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanOrEqualToParser.java index a30979c6a3c..9fc43212548 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanOrEqualToParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanOrEqualToParser.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.LessThanOrEqualToAssertion; +import org.elasticsearch.test.rest.yaml.section.LessThanOrEqualToAssertion; import java.io.IOException; /** * Parser for lte assert section */ -public class LessThanOrEqualToParser implements RestTestFragmentParser { +public class LessThanOrEqualToParser implements ClientYamlTestFragmentParser { @Override - public LessThanOrEqualToAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public LessThanOrEqualToAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); if (! (stringObjectTuple.v2() instanceof Comparable) ) { - throw new RestTestParseException("lte section can only be used with objects that support natural ordering, found " + throw new ClientYamlTestParseException("lte section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName()); } return new LessThanOrEqualToAssertion(stringObjectTuple.v1(), stringObjectTuple.v2()); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanParser.java similarity index 72% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanParser.java index fc31f221758..f244bd68f93 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/LessThanParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/LessThanParser.java @@ -16,23 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.LessThanAssertion; +import org.elasticsearch.test.rest.yaml.section.LessThanAssertion; import java.io.IOException; /** * Parser for lt assert sections */ -public class LessThanParser implements RestTestFragmentParser { +public class LessThanParser implements ClientYamlTestFragmentParser { @Override - public LessThanAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public LessThanAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); if (! (stringObjectTuple.v2() instanceof Comparable) ) { - throw new RestTestParseException("lt section can only be used with objects that support natural ordering, found " + throw new ClientYamlTestParseException("lt section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName()); } return new LessThanAssertion(stringObjectTuple.v1(), stringObjectTuple.v2()); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/MatchParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/MatchParser.java similarity index 77% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/MatchParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/MatchParser.java index 30ee18a4e05..35f3fc160bf 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/MatchParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/MatchParser.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.test.rest.section.MatchAssertion; +import org.elasticsearch.test.rest.yaml.section.MatchAssertion; import java.io.IOException; /** * Parser for match assert sections */ -public class MatchParser implements RestTestFragmentParser { +public class MatchParser implements ClientYamlTestFragmentParser { @Override - public MatchAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public MatchAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { Tuple stringObjectTuple = parseContext.parseTuple(); return new MatchAssertion(stringObjectTuple.v1(), stringObjectTuple.v2()); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetSectionParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParser.java similarity index 79% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetSectionParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParser.java index 8afafc09f7a..2686593e10a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetSectionParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParser.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.rest.section.SetSection; +import org.elasticsearch.test.rest.yaml.section.SetSection; import java.io.IOException; /** * Parser for set sections */ -public class SetSectionParser implements RestTestFragmentParser { +public class SetSectionParser implements ClientYamlTestFragmentParser { @Override - public SetSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public SetSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); @@ -49,7 +49,7 @@ public class SetSectionParser implements RestTestFragmentParser { parser.nextToken(); if (setSection.getStash().isEmpty()) { - throw new RestTestParseException("set section must set at least a value"); + throw new ClientYamlTestParseException("set section must set at least a value"); } return setSection; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetupSectionParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParser.java similarity index 76% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetupSectionParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParser.java index 2a2e39ea744..e62b3af5251 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SetupSectionParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParser.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.rest.section.SetupSection; +import org.elasticsearch.test.rest.yaml.section.SetupSection; import java.io.IOException; /** * Parser for setup sections */ -public class SetupSectionParser implements RestTestFragmentParser { +public class SetupSectionParser implements ClientYamlTestFragmentParser { @Override - public SetupSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public SetupSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); @@ -39,7 +39,7 @@ public class SetupSectionParser implements RestTestFragmentParser while (parser.currentToken() != XContentParser.Token.END_ARRAY) { parseContext.advanceToFieldName(); if (!"do".equals(parser.currentName())) { - throw new RestTestParseException("section [" + parser.currentName() + "] not supported within setup section"); + throw new ClientYamlTestParseException("section [" + parser.currentName() + "] not supported within setup section"); } parser.nextToken(); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SkipSectionParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParser.java similarity index 77% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/SkipSectionParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParser.java index 33733821019..31451dee247 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/SkipSectionParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParser.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.rest.section.SkipSection; +import org.elasticsearch.test.rest.yaml.section.SkipSection; import java.io.IOException; import java.util.ArrayList; @@ -29,10 +29,10 @@ import java.util.List; /** * Parser for skip sections */ -public class SkipSectionParser implements RestTestFragmentParser { +public class SkipSectionParser implements ClientYamlTestFragmentParser { @Override - public SkipSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public SkipSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); @@ -54,7 +54,7 @@ public class SkipSectionParser implements RestTestFragmentParser { features.add(parser.text()); } else { - throw new RestTestParseException("field " + currentFieldName + " not supported within skip section"); + throw new ClientYamlTestParseException("field " + currentFieldName + " not supported within skip section"); } } else if (token == XContentParser.Token.START_ARRAY) { if ("features".equals(currentFieldName)) { @@ -68,13 +68,13 @@ public class SkipSectionParser implements RestTestFragmentParser { parser.nextToken(); if (!Strings.hasLength(version) && features.isEmpty()) { - throw new RestTestParseException("version or features is mandatory within skip section"); + throw new ClientYamlTestParseException("version or features is mandatory within skip section"); } if (Strings.hasLength(version) && !features.isEmpty()) { - throw new RestTestParseException("version or features are mutually exclusive"); + throw new ClientYamlTestParseException("version or features are mutually exclusive"); } if (Strings.hasLength(version) && !Strings.hasLength(reason)) { - throw new RestTestParseException("reason is mandatory within skip version section"); + throw new ClientYamlTestParseException("reason is mandatory within skip version section"); } return new SkipSection(version, features, reason); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/TeardownSectionParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParser.java similarity index 76% rename from test/framework/src/main/java/org/elasticsearch/test/rest/parser/TeardownSectionParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParser.java index 428a21e2e06..ed1b42c3a9c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/parser/TeardownSectionParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParser.java @@ -17,20 +17,20 @@ * under the License. */ -package org.elasticsearch.test.rest.parser; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.rest.section.TeardownSection; +import org.elasticsearch.test.rest.yaml.section.TeardownSection; import java.io.IOException; /** * Parser for teardown section */ -public class TeardownSectionParser implements RestTestFragmentParser { +public class TeardownSectionParser implements ClientYamlTestFragmentParser { @Override - public TeardownSection parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException { + public TeardownSection parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException { XContentParser parser = parseContext.parser(); TeardownSection teardownSection = new TeardownSection(); @@ -39,7 +39,7 @@ public class TeardownSectionParser implements RestTestFragmentParser paths = new ArrayList<>(); private List pathParts = new ArrayList<>(); private List params = new ArrayList<>(); - private BODY body = BODY.NOT_SUPPORTED; + private Body body = Body.NOT_SUPPORTED; - public enum BODY { + public enum Body { NOT_SUPPORTED, OPTIONAL, REQUIRED } - RestApi(String location, String name) { + ClientYamlSuiteRestApi(String location, String name) { this.location = location; this.name = name; } @@ -116,34 +115,34 @@ public class RestApi { } void setBodyOptional() { - this.body = BODY.OPTIONAL; + this.body = Body.OPTIONAL; } void setBodyRequired() { - this.body = BODY.REQUIRED; + this.body = Body.REQUIRED; } public boolean isBodySupported() { - return body != BODY.NOT_SUPPORTED; + return body != Body.NOT_SUPPORTED; } public boolean isBodyRequired() { - return body == BODY.REQUIRED; + return body == Body.REQUIRED; } /** * Finds the best matching rest path given the current parameters and replaces * placeholders with their corresponding values received as arguments */ - public RestPath[] getFinalPaths(Map pathParams) { - List matchingRestPaths = findMatchingRestPaths(pathParams.keySet()); + public ClientYamlSuiteRestPath[] getFinalPaths(Map pathParams) { + List matchingRestPaths = findMatchingRestPaths(pathParams.keySet()); if (matchingRestPaths == null || matchingRestPaths.isEmpty()) { throw new IllegalArgumentException("unable to find matching rest path for api [" + name + "] and path params " + pathParams); } - RestPath[] restPaths = new RestPath[matchingRestPaths.size()]; + ClientYamlSuiteRestPath[] restPaths = new ClientYamlSuiteRestPath[matchingRestPaths.size()]; for (int i = 0; i < matchingRestPaths.size(); i++) { - RestPath restPath = matchingRestPaths.get(i); + ClientYamlSuiteRestPath restPath = matchingRestPaths.get(i); restPaths[i] = restPath.replacePlaceholders(pathParams); } return restPaths; @@ -155,11 +154,11 @@ public class RestApi { * The best path is the one that has exactly the same number of placeholders to replace * (e.g. /{index}/{type}/{id} when the path params are exactly index, type and id). */ - private List findMatchingRestPaths(Set restParams) { + private List findMatchingRestPaths(Set restParams) { - List matchingRestPaths = new ArrayList<>(); - RestPath[] restPaths = buildRestPaths(); - for (RestPath restPath : restPaths) { + List matchingRestPaths = new ArrayList<>(); + ClientYamlSuiteRestPath[] restPaths = buildRestPaths(); + for (ClientYamlSuiteRestPath restPath : restPaths) { if (restPath.matches(restParams)) { matchingRestPaths.add(restPath); } @@ -167,10 +166,10 @@ public class RestApi { return matchingRestPaths; } - private RestPath[] buildRestPaths() { - RestPath[] restPaths = new RestPath[paths.size()]; + private ClientYamlSuiteRestPath[] buildRestPaths() { + ClientYamlSuiteRestPath[] restPaths = new ClientYamlSuiteRestPath[paths.size()]; for (int i = 0; i < restPaths.length; i++) { - restPaths[i] = new RestPath(paths.get(i)); + restPaths[i] = new ClientYamlSuiteRestPath(paths.get(i)); } return restPaths; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestApiParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java similarity index 94% rename from test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestApiParser.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java index 95fe132471a..178fb9c5f34 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestApiParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java @@ -16,24 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.spec; +package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.xcontent.XContentParser; import java.io.IOException; /** - * Parser for a REST api spec (single json file) + * Parser for a {@link ClientYamlSuiteRestApi}. */ -public class RestApiParser { +public class ClientYamlSuiteRestApiParser { - public RestApi parse(String location, XContentParser parser) throws IOException { + public ClientYamlSuiteRestApi parse(String location, XContentParser parser) throws IOException { while ( parser.nextToken() != XContentParser.Token.FIELD_NAME ) { //move to first field name } - RestApi restApi = new RestApi(location, parser.currentName()); + ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApi(location, parser.currentName()); int level = -1; while (parser.nextToken() != XContentParser.Token.END_OBJECT || level >= 0) { diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestPath.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java similarity index 90% rename from test/framework/src/main/java/org/elasticsearch/test/rest/client/RestPath.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java index ed1ce728c0b..f54994138e0 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/client/RestPath.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestPath.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.client; +package org.elasticsearch.test.rest.yaml.restspec; import java.util.ArrayList; import java.util.Collections; @@ -25,11 +25,11 @@ import java.util.List; import java.util.Map; import java.util.Set; -public class RestPath { +public class ClientYamlSuiteRestPath { private final List parts; private final List placeholders; - public RestPath(List parts) { + public ClientYamlSuiteRestPath(List parts) { List pathParts = new ArrayList<>(parts.size()); for (String part : parts) { pathParts.add(new PathPart(part, false)); @@ -38,7 +38,7 @@ public class RestPath { this.placeholders = Collections.emptyList(); } - public RestPath(String path) { + public ClientYamlSuiteRestPath(String path) { String[] pathParts = path.split("/"); List placeholders = new ArrayList<>(); List parts = new ArrayList<>(); @@ -73,7 +73,7 @@ public class RestPath { return placeholders.size() == params.size() && placeholders.containsAll(params); } - public RestPath replacePlaceholders(Map params) { + public ClientYamlSuiteRestPath replacePlaceholders(Map params) { List finalPathParts = new ArrayList<>(parts.size()); for (PathPart pathPart : parts) { if (pathPart.isPlaceholder) { @@ -86,7 +86,7 @@ public class RestPath { finalPathParts.add(pathPart.pathPart); } } - return new RestPath(finalPathParts); + return new ClientYamlSuiteRestPath(finalPathParts); } private static class PathPart { diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestSpec.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java similarity index 72% rename from test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestSpec.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java index c6ea48fd6ef..d0cfc839fcc 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/spec/RestSpec.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.spec; +package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.rest.support.FileUtils; +import org.elasticsearch.test.rest.yaml.support.FileUtils; import java.io.IOException; import java.io.InputStream; @@ -32,41 +32,41 @@ import java.util.HashMap; import java.util.Map; /** - * Holds the elasticsearch REST spec + * Holds the specification used to turn {@code do} actions in the YAML suite into REST api calls. */ -public class RestSpec { - Map restApiMap = new HashMap<>(); +public class ClientYamlSuiteRestSpec { + Map restApiMap = new HashMap<>(); - private RestSpec() { + private ClientYamlSuiteRestSpec() { } - void addApi(RestApi restApi) { - RestApi previous = restApiMap.putIfAbsent(restApi.getName(), restApi); + void addApi(ClientYamlSuiteRestApi restApi) { + ClientYamlSuiteRestApi previous = restApiMap.putIfAbsent(restApi.getName(), restApi); if (previous != null) { throw new IllegalArgumentException("cannot register api [" + restApi.getName() + "] found in [" + restApi.getLocation() + "]. " + "api with same name was already found in [" + previous.getLocation() + "]"); } } - public RestApi getApi(String api) { + public ClientYamlSuiteRestApi getApi(String api) { return restApiMap.get(api); } - public Collection getApis() { + public Collection getApis() { return restApiMap.values(); } /** * Parses the complete set of REST spec available under the provided directories */ - public static RestSpec parseFrom(FileSystem fileSystem, String optionalPathPrefix, String... paths) throws IOException { - RestSpec restSpec = new RestSpec(); - RestApiParser restApiParser = new RestApiParser(); + public static ClientYamlSuiteRestSpec parseFrom(FileSystem fileSystem, String optionalPathPrefix, String... paths) throws IOException { + ClientYamlSuiteRestSpec restSpec = new ClientYamlSuiteRestSpec(); + ClientYamlSuiteRestApiParser restApiParser = new ClientYamlSuiteRestApiParser(); for (String path : paths) { for (Path jsonFile : FileUtils.findJsonSpec(fileSystem, optionalPathPrefix, path)) { try (InputStream stream = Files.newInputStream(jsonFile)) { try (XContentParser parser = JsonXContent.jsonXContent.createParser(stream)) { - RestApi restApi = restApiParser.parse(jsonFile.toString(), parser); + ClientYamlSuiteRestApi restApi = restApiParser.parse(jsonFile.toString(), parser); String filename = jsonFile.getFileName().toString(); String expectedApiName = filename.substring(0, filename.lastIndexOf('.')); if (restApi.getName().equals(expectedApiName) == false) { diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/ApiCallSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ApiCallSection.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/ApiCallSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ApiCallSection.java index 030469148ed..5d097f872b4 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/ApiCallSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ApiCallSection.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import java.util.ArrayList; import java.util.Collections; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/Assertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java similarity index 86% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/Assertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java index fbba9de163b..97ef2546074 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/Assertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.test.rest.RestTestExecutionContext; +import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; import java.util.Map; @@ -44,7 +44,7 @@ public abstract class Assertion implements ExecutableSection { return expectedValue; } - protected final Object resolveExpectedValue(RestTestExecutionContext executionContext) throws IOException { + protected final Object resolveExpectedValue(ClientYamlTestExecutionContext executionContext) throws IOException { if (expectedValue instanceof Map) { @SuppressWarnings("unchecked") Map map = (Map) expectedValue; @@ -57,7 +57,7 @@ public abstract class Assertion implements ExecutableSection { return expectedValue; } - protected final Object getActualValue(RestTestExecutionContext executionContext) throws IOException { + protected final Object getActualValue(ClientYamlTestExecutionContext executionContext) throws IOException { if (executionContext.stash().containsStashedValue(field)) { return executionContext.stash().getValue(field); } @@ -65,7 +65,7 @@ public abstract class Assertion implements ExecutableSection { } @Override - public final void execute(RestTestExecutionContext executionContext) throws IOException { + public final void execute(ClientYamlTestExecutionContext executionContext) throws IOException { doAssert(getActualValue(executionContext), resolveExpectedValue(executionContext)); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/TestSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java similarity index 87% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/TestSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java index 3f44e5ce767..4df126cba19 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/TestSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import java.util.ArrayList; import java.util.List; @@ -24,12 +24,12 @@ import java.util.List; /** * Represents a test section, which is composed of a skip section and multiple executable sections. */ -public class TestSection implements Comparable { +public class ClientYamlTestSection implements Comparable { private final String name; private SkipSection skipSection; private final List executableSections; - public TestSection(String name) { + public ClientYamlTestSection(String name) { this.name = name; this.executableSections = new ArrayList<>(); } @@ -59,7 +59,7 @@ public class TestSection implements Comparable { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - TestSection that = (TestSection) o; + ClientYamlTestSection that = (ClientYamlTestSection) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; @@ -72,7 +72,7 @@ public class TestSection implements Comparable { } @Override - public int compareTo(TestSection o) { + public int compareTo(ClientYamlTestSection o) { return name.compareTo(o.getName()); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/RestTestSuite.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java similarity index 81% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/RestTestSuite.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java index 5c093be3fa0..af3e1be0528 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/RestTestSuite.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import java.util.ArrayList; import java.util.List; @@ -27,7 +27,7 @@ import java.util.TreeSet; * Holds a REST test suite loaded from a specific yaml file. * Supports a setup section and multiple test sections. */ -public class RestTestSuite { +public class ClientYamlTestSuite { private final String api; private final String name; @@ -35,9 +35,9 @@ public class RestTestSuite { private SetupSection setupSection; private TeardownSection teardownSection; - private Set testSections = new TreeSet<>(); + private Set testSections = new TreeSet<>(); - public RestTestSuite(String api, String name) { + public ClientYamlTestSuite(String api, String name) { this.api = api; this.name = name; } @@ -71,14 +71,14 @@ public class RestTestSuite { } /** - * Adds a {@link org.elasticsearch.test.rest.section.TestSection} to the REST suite + * Adds a {@link org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection} to the REST suite * @return true if the test section was not already present, false otherwise */ - public boolean addTestSection(TestSection testSection) { + public boolean addTestSection(ClientYamlTestSection testSection) { return this.testSections.add(testSection); } - public List getTestSections() { + public List getTestSections() { return new ArrayList<>(testSections); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/DoSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java similarity index 88% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/DoSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index 20b4f66f06c..78461130783 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/DoSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -16,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.test.rest.RestTestExecutionContext; -import org.elasticsearch.test.rest.client.RestTestResponse; -import org.elasticsearch.test.rest.client.RestTestResponseException; +import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; +import org.elasticsearch.test.rest.yaml.client.ClientYamlTestResponse; +import org.elasticsearch.test.rest.yaml.client.ClientYamlTestResponseException; import java.io.IOException; import java.util.HashMap; @@ -79,7 +79,7 @@ public class DoSection implements ExecutableSection { } @Override - public void execute(RestTestExecutionContext executionContext) throws IOException { + public void execute(ClientYamlTestExecutionContext executionContext) throws IOException { if ("param".equals(catchParam)) { //client should throw validation error before sending request @@ -89,7 +89,7 @@ public class DoSection implements ExecutableSection { } try { - RestTestResponse restTestResponse = executionContext.callApi(apiCallSection.getApi(), apiCallSection.getParams(), + ClientYamlTestResponse restTestResponse = executionContext.callApi(apiCallSection.getApi(), apiCallSection.getParams(), apiCallSection.getBodies(), apiCallSection.getHeaders()); if (Strings.hasLength(catchParam)) { String catchStatusCode; @@ -102,8 +102,8 @@ public class DoSection implements ExecutableSection { } fail(formatStatusCodeMessage(restTestResponse, catchStatusCode)); } - } catch(RestTestResponseException e) { - RestTestResponse restTestResponse = e.getRestTestResponse(); + } catch(ClientYamlTestResponseException e) { + ClientYamlTestResponse restTestResponse = e.getRestTestResponse(); if (!Strings.hasLength(catchParam)) { fail(formatStatusCodeMessage(restTestResponse, "2xx")); } else if (catches.containsKey(catchParam)) { @@ -124,13 +124,13 @@ public class DoSection implements ExecutableSection { } } - private void assertStatusCode(RestTestResponse restTestResponse) { + private void assertStatusCode(ClientYamlTestResponse restTestResponse) { Tuple> stringMatcherTuple = catches.get(catchParam); assertThat(formatStatusCodeMessage(restTestResponse, stringMatcherTuple.v1()), restTestResponse.getStatusCode(), stringMatcherTuple.v2()); } - private String formatStatusCodeMessage(RestTestResponse restTestResponse, String expected) { + private String formatStatusCodeMessage(ClientYamlTestResponse restTestResponse, String expected) { String api = apiCallSection.getApi(); if ("raw".equals(api)) { api += "[method=" + apiCallSection.getParams().get("method") + " path=" + apiCallSection.getParams().get("path") + "]"; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/ExecutableSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java similarity index 83% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/ExecutableSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java index 669d82cdd78..dbf8f4c1a4a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/ExecutableSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.test.rest.RestTestExecutionContext; +import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; @@ -30,5 +30,5 @@ public interface ExecutableSection { /** * Executes the section passing in the execution context */ - void execute(RestTestExecutionContext executionContext) throws IOException; + void execute(ClientYamlTestExecutionContext executionContext) throws IOException; } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java index 63f69696653..9f2aa72ceda 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanEqualToAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanEqualToAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java index 297eecf2d2a..5c1ff6c9008 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/GreaterThanEqualToAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/IsFalseAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/IsFalseAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java index 3d5e21e5146..3c7bc9f3ce9 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/IsFalseAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/IsTrueAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/IsTrueAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java index 1a899c3cc2b..2a6b9431ad5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/IsTrueAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LengthAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java similarity index 98% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/LengthAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java index eb28ba01a94..396e6464774 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LengthAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java index 153a7824569..0493da1f016 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanOrEqualToAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanOrEqualToAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java index 1eb3a9fc2b2..f46a357bfe0 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/LessThanOrEqualToAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/MatchAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java similarity index 99% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/MatchAssertion.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java index 3a96d4532a0..c0ec9ffca0b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/MatchAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.logging.ESLogger; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SetSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java similarity index 87% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/SetSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java index 940664b4ee9..6372b7c9a0d 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SetSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.test.rest.RestTestExecutionContext; +import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; import java.util.HashMap; @@ -43,7 +43,7 @@ public class SetSection implements ExecutableSection { } @Override - public void execute(RestTestExecutionContext executionContext) throws IOException { + public void execute(ClientYamlTestExecutionContext executionContext) throws IOException { for (Map.Entry entry : stash.entrySet()) { Object actualValue = executionContext.response(entry.getKey()); executionContext.stash().stashValue(entry.getValue(), actualValue); diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SetupSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/SetupSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java index 45c66fbad4f..c2bcaa3ecd1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SetupSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import java.util.ArrayList; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SkipSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/SkipSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java index 179d0a1e868..c9b6ead4aa8 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/SkipSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.Version; import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.rest.support.Features; +import org.elasticsearch.test.rest.yaml.support.Features; import java.util.ArrayList; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/section/TeardownSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java similarity index 96% rename from test/framework/src/main/java/org/elasticsearch/test/rest/section/TeardownSection.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java index b3709472be5..1e49f8b5037 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/section/TeardownSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.section; +package org.elasticsearch.test.rest.yaml.section; import java.util.ArrayList; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/support/Features.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/Features.java similarity index 97% rename from test/framework/src/main/java/org/elasticsearch/test/rest/support/Features.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/Features.java index 98bce54082f..8d7a5a58e16 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/support/Features.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/Features.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.support; +package org.elasticsearch.test.rest.yaml.support; import org.elasticsearch.test.ESIntegTestCase; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/support/FileUtils.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/FileUtils.java similarity index 99% rename from test/framework/src/main/java/org/elasticsearch/test/rest/support/FileUtils.java rename to test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/FileUtils.java index b32308f8cd8..783f0f9dcc1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/support/FileUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/support/FileUtils.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.support; +package org.elasticsearch.test.rest.yaml.support; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.PathUtils; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcherTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java similarity index 97% rename from test/framework/src/test/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcherTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java index 9414a2219cf..a58a70111c2 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/BlacklistedPathPatternMatcherTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java @@ -16,10 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest; +package org.elasticsearch.test.rest.yaml; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.test.rest.yaml.BlacklistedPathPatternMatcher; public class BlacklistedPathPatternMatcherTests extends ESTestCase { diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/ObjectPathTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java similarity index 98% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/ObjectPathTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java index 1d99a73c767..5559fd3f385 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/ObjectPathTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.ObjectPath; -import org.elasticsearch.test.rest.Stash; +import org.elasticsearch.test.rest.yaml.ObjectPath; +import org.elasticsearch.test.rest.yaml.Stash; import java.io.IOException; import java.util.HashMap; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/StashTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/StashTests.java similarity index 94% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/StashTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/StashTests.java index 7d0c0598f09..a8d32a316ac 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/StashTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/StashTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.Stash; +import org.elasticsearch.test.rest.yaml.Stash; import java.io.IOException; import java.util.HashMap; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/AbstractParserTestCase.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AbstractParserTestCase.java similarity index 96% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/AbstractParserTestCase.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AbstractParserTestCase.java index 2a925dd2586..7d32389ddba 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/AbstractParserTestCase.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AbstractParserTestCase.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/AssertionParsersTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AssertionParsersTests.java similarity index 78% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/AssertionParsersTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AssertionParsersTests.java index 68b84b99639..4e382fb7b09 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/AssertionParsersTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/AssertionParsersTests.java @@ -16,22 +16,22 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.GreaterThanParser; -import org.elasticsearch.test.rest.parser.IsFalseParser; -import org.elasticsearch.test.rest.parser.IsTrueParser; -import org.elasticsearch.test.rest.parser.LengthParser; -import org.elasticsearch.test.rest.parser.LessThanParser; -import org.elasticsearch.test.rest.parser.MatchParser; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.section.GreaterThanAssertion; -import org.elasticsearch.test.rest.section.IsFalseAssertion; -import org.elasticsearch.test.rest.section.IsTrueAssertion; -import org.elasticsearch.test.rest.section.LengthAssertion; -import org.elasticsearch.test.rest.section.LessThanAssertion; -import org.elasticsearch.test.rest.section.MatchAssertion; +import org.elasticsearch.test.rest.yaml.parser.GreaterThanParser; +import org.elasticsearch.test.rest.yaml.parser.IsFalseParser; +import org.elasticsearch.test.rest.yaml.parser.IsTrueParser; +import org.elasticsearch.test.rest.yaml.parser.LengthParser; +import org.elasticsearch.test.rest.yaml.parser.LessThanParser; +import org.elasticsearch.test.rest.yaml.parser.MatchParser; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.section.GreaterThanAssertion; +import org.elasticsearch.test.rest.yaml.section.IsFalseAssertion; +import org.elasticsearch.test.rest.yaml.section.IsTrueAssertion; +import org.elasticsearch.test.rest.yaml.section.LengthAssertion; +import org.elasticsearch.test.rest.yaml.section.LessThanAssertion; +import org.elasticsearch.test.rest.yaml.section.MatchAssertion; import java.util.List; import java.util.Map; @@ -47,7 +47,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); IsTrueParser isTrueParser = new IsTrueParser(); - IsTrueAssertion trueAssertion = isTrueParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + IsTrueAssertion trueAssertion = isTrueParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(trueAssertion, notNullValue()); assertThat(trueAssertion.getField(), equalTo("get.fields._timestamp")); @@ -59,7 +59,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); IsFalseParser isFalseParser = new IsFalseParser(); - IsFalseAssertion falseAssertion = isFalseParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + IsFalseAssertion falseAssertion = isFalseParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(falseAssertion, notNullValue()); assertThat(falseAssertion.getField(), equalTo("docs.1._source")); @@ -71,7 +71,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); GreaterThanParser greaterThanParser = new GreaterThanParser(); - GreaterThanAssertion greaterThanAssertion = greaterThanParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + GreaterThanAssertion greaterThanAssertion = greaterThanParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(greaterThanAssertion, notNullValue()); assertThat(greaterThanAssertion.getField(), equalTo("field")); assertThat(greaterThanAssertion.getExpectedValue(), instanceOf(Integer.class)); @@ -84,7 +84,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); LessThanParser lessThanParser = new LessThanParser(); - LessThanAssertion lessThanAssertion = lessThanParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + LessThanAssertion lessThanAssertion = lessThanParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(lessThanAssertion, notNullValue()); assertThat(lessThanAssertion.getField(), equalTo("field")); assertThat(lessThanAssertion.getExpectedValue(), instanceOf(Integer.class)); @@ -97,7 +97,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); LengthParser lengthParser = new LengthParser(); - LengthAssertion lengthAssertion = lengthParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + LengthAssertion lengthAssertion = lengthParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(lengthAssertion, notNullValue()); assertThat(lengthAssertion.getField(), equalTo("_id")); assertThat(lengthAssertion.getExpectedValue(), instanceOf(Integer.class)); @@ -110,7 +110,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); MatchParser matchParser = new MatchParser(); - MatchAssertion matchAssertion = matchParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + MatchAssertion matchAssertion = matchParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(matchAssertion, notNullValue()); assertThat(matchAssertion.getField(), equalTo("field")); @@ -124,7 +124,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); MatchParser matchParser = new MatchParser(); - MatchAssertion matchAssertion = matchParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + MatchAssertion matchAssertion = matchParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(matchAssertion, notNullValue()); assertThat(matchAssertion.getField(), equalTo("foo")); @@ -138,7 +138,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); MatchParser matchParser = new MatchParser(); - MatchAssertion matchAssertion = matchParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + MatchAssertion matchAssertion = matchParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(matchAssertion, notNullValue()); assertThat(matchAssertion.getField(), equalTo("matches")); @@ -156,7 +156,7 @@ public class AssertionParsersTests extends AbstractParserTestCase { ); MatchParser matchParser = new MatchParser(); - MatchAssertion matchAssertion = matchParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + MatchAssertion matchAssertion = matchParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(matchAssertion, notNullValue()); assertThat(matchAssertion.getField(), equalTo("_source")); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestTestParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlSuiteTestParserTests.java similarity index 94% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/RestTestParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlSuiteTestParserTests.java index 6b5cc3defb7..3b7313ec221 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestTestParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/ClientYamlSuiteTestParserTests.java @@ -16,19 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.yaml.YamlXContent; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.parser.RestTestSuiteParser; -import org.elasticsearch.test.rest.section.DoSection; -import org.elasticsearch.test.rest.section.IsTrueAssertion; -import org.elasticsearch.test.rest.section.MatchAssertion; -import org.elasticsearch.test.rest.section.RestTestSuite; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParser; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSuite; +import org.elasticsearch.test.rest.yaml.section.DoSection; +import org.elasticsearch.test.rest.yaml.section.IsTrueAssertion; +import org.elasticsearch.test.rest.yaml.section.MatchAssertion; import org.junit.After; import java.util.Map; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class RestTestParserTests extends ESTestCase { +public class ClientYamlSuiteTestParserTests extends ESTestCase { private XContentParser parser; @Override @@ -103,8 +103,8 @@ public class RestTestParserTests extends ESTestCase { " - match: {test_type.properties.text.analyzer: whitespace}\n" ); - RestTestSuiteParser testParser = new RestTestSuiteParser(); - RestTestSuite restTestSuite = testParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSuiteParser testParser = new ClientYamlTestSuiteParser(); + ClientYamlTestSuite restTestSuite = testParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(restTestSuite, notNullValue()); assertThat(restTestSuite.getName(), equalTo("suite")); @@ -207,8 +207,8 @@ public class RestTestParserTests extends ESTestCase { " - match: { _source: { foo: bar }}" ); - RestTestSuiteParser testParser = new RestTestSuiteParser(); - RestTestSuite restTestSuite = testParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSuiteParser testParser = new ClientYamlTestSuiteParser(); + ClientYamlTestSuite restTestSuite = testParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(restTestSuite, notNullValue()); assertThat(restTestSuite.getName(), equalTo("suite")); @@ -320,8 +320,8 @@ public class RestTestParserTests extends ESTestCase { " params: { bar: 'xxx' }\n" ); - RestTestSuiteParser testParser = new RestTestSuiteParser(); - RestTestSuite restTestSuite = testParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSuiteParser testParser = new ClientYamlTestSuiteParser(); + ClientYamlTestSuite restTestSuite = testParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(restTestSuite, notNullValue()); assertThat(restTestSuite.getName(), equalTo("suite")); @@ -394,11 +394,11 @@ public class RestTestParserTests extends ESTestCase { "\n" ); - RestTestSuiteParser testParser = new RestTestSuiteParser(); + ClientYamlTestSuiteParser testParser = new ClientYamlTestSuiteParser(); try { - testParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + testParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), containsString("duplicate test section")); } } diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/DoSectionParserTests.java similarity index 89% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/DoSectionParserTests.java index 655d3071d63..5d79432155f 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/DoSectionParserTests.java @@ -16,16 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.DoSectionParser; -import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.section.ApiCallSection; -import org.elasticsearch.test.rest.section.DoSection; +import org.elasticsearch.test.rest.yaml.parser.DoSectionParser; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.section.ApiCallSection; +import org.elasticsearch.test.rest.yaml.section.DoSection; import org.hamcrest.MatcherAssert; import java.io.IOException; @@ -46,7 +46,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -64,7 +64,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -84,7 +84,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -116,7 +116,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -142,7 +142,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -166,7 +166,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { String body = "{ \"_source\": [ \"include.field1\", \"include.field2\" ], \"query\": { \"match_all\": {} }}"; DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -202,7 +202,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { bodies[3] = "{ \"f1\":\"v2\", \"f2\": 47 }"; DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -235,7 +235,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { bodies[1] = "{ \"f1\":\"v1\", \"f2\": 42 }"; DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -264,7 +264,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { "]}"; DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -285,7 +285,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection, notNullValue()); @@ -311,7 +311,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { String body = "{ \"size\": 100, \"query\": { \"match_all\": {} } }"; DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); ApiCallSection apiCallSection = doSection.getApiCallSection(); assertThat(apiCallSection.getApi(), equalTo("index")); @@ -332,7 +332,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(doSection.getCatch(), equalTo("missing")); assertThat(doSection.getApiCallSection(), notNullValue()); @@ -352,7 +352,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(doSection.getApiCallSection(), notNullValue()); assertThat(doSection.getApiCallSection().getApi(), equalTo("indices.get_warmer")); @@ -371,9 +371,9 @@ public class DoSectionParserTests extends AbstractParserTestCase { DoSectionParser doSectionParser = new DoSectionParser(); try { - doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), is("client call section is mandatory within a do section")); } } @@ -387,7 +387,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { ); DoSectionParser doSectionParser = new DoSectionParser(); - DoSection doSection = doSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + DoSection doSection = doSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(doSection.getCatch(), nullValue()); assertThat(doSection.getApiCallSection(), notNullValue()); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SetSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParserTests.java similarity index 78% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/SetSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParserTests.java index c2b66375664..386cdd6deb4 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SetSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetSectionParserTests.java @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.parser.SetSectionParser; -import org.elasticsearch.test.rest.section.SetSection; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.parser.SetSectionParser; +import org.elasticsearch.test.rest.yaml.section.SetSection; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -36,7 +36,7 @@ public class SetSectionParserTests extends AbstractParserTestCase { SetSectionParser setSectionParser = new SetSectionParser(); - SetSection setSection = setSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SetSection setSection = setSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(setSection, notNullValue()); assertThat(setSection.getStash(), notNullValue()); @@ -51,7 +51,7 @@ public class SetSectionParserTests extends AbstractParserTestCase { SetSectionParser setSectionParser = new SetSectionParser(); - SetSection setSection = setSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SetSection setSection = setSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(setSection, notNullValue()); assertThat(setSection.getStash(), notNullValue()); @@ -68,9 +68,9 @@ public class SetSectionParserTests extends AbstractParserTestCase { SetSectionParser setSectionParser = new SetSectionParser(); try { - setSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + setSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), is("set section must set at least a value")); } } diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SetupSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParserTests.java similarity index 92% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/SetupSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParserTests.java index b3fe1f0f23b..fa7c34eecde 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SetupSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SetupSectionParserTests.java @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.parser.SetupSectionParser; -import org.elasticsearch.test.rest.section.SetupSection; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.parser.SetupSectionParser; +import org.elasticsearch.test.rest.yaml.section.SetupSection; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; @@ -45,7 +45,7 @@ public class SetupSectionParserTests extends AbstractParserTestCase { ); SetupSectionParser setupSectionParser = new SetupSectionParser(); - SetupSection setupSection = setupSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SetupSection setupSection = setupSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(setupSection, notNullValue()); assertThat(setupSection.getSkipSection().isEmpty(), equalTo(true)); @@ -74,7 +74,7 @@ public class SetupSectionParserTests extends AbstractParserTestCase { ); SetupSectionParser setupSectionParser = new SetupSectionParser(); - SetupSection setupSection = setupSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SetupSection setupSection = setupSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(setupSection, notNullValue()); assertThat(setupSection.getSkipSection().isEmpty(), equalTo(false)); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SkipSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParserTests.java similarity index 80% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/SkipSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParserTests.java index 39b0f284b5e..f5d46cdd3d6 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/SkipSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/SkipSectionParserTests.java @@ -16,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.yaml.YamlXContent; import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.parser.SkipSectionParser; -import org.elasticsearch.test.rest.section.SkipSection; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestParseException; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.parser.SkipSectionParser; +import org.elasticsearch.test.rest.yaml.section.SkipSection; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -40,7 +40,7 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); - SkipSection skipSection = skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SkipSection skipSection = skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(skipSection, notNullValue()); assertThat(skipSection.getLowerVersion(), equalTo(VersionUtils.getFirstVersion())); @@ -57,7 +57,7 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); - SkipSection skipSection = skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SkipSection skipSection = skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(skipSection, notNullValue()); assertThat(skipSection.getLowerVersion(), equalTo(VersionUtils.getFirstVersion())); @@ -73,7 +73,7 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); - SkipSection skipSection = skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SkipSection skipSection = skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(skipSection, notNullValue()); assertThat(skipSection.isVersionCheck(), equalTo(false)); @@ -89,7 +89,7 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); - SkipSection skipSection = skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + SkipSection skipSection = skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(skipSection, notNullValue()); assertThat(skipSection.isVersionCheck(), equalTo(false)); @@ -110,9 +110,9 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); try { - skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), is("version or features are mutually exclusive")); } } @@ -124,9 +124,9 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); try { - skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), is("reason is mandatory within skip version section")); } } @@ -138,9 +138,9 @@ public class SkipSectionParserTests extends AbstractParserTestCase { SkipSectionParser skipSectionParser = new SkipSectionParser(); try { - skipSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + skipSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); fail("Expected RestTestParseException"); - } catch (RestTestParseException e) { + } catch (ClientYamlTestParseException e) { assertThat(e.getMessage(), is("version or features is mandatory within skip section")); } } diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/TeardownSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParserTests.java similarity index 90% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/TeardownSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParserTests.java index eeccea5f5e5..4ad47e35e48 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/TeardownSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TeardownSectionParserTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.parser.TeardownSectionParser; -import org.elasticsearch.test.rest.section.TeardownSection; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.parser.TeardownSectionParser; +import org.elasticsearch.test.rest.yaml.section.TeardownSection; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; @@ -50,7 +50,7 @@ public class TeardownSectionParserTests extends AbstractParserTestCase { ); TeardownSectionParser teardownSectionParser = new TeardownSectionParser(); - TeardownSection section = teardownSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + TeardownSection section = teardownSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(section, notNullValue()); assertThat(section.getSkipSection().isEmpty(), equalTo(true)); @@ -79,7 +79,7 @@ public class TeardownSectionParserTests extends AbstractParserTestCase { ); TeardownSectionParser teardownSectionParser = new TeardownSectionParser(); - TeardownSection section = teardownSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + TeardownSection section = teardownSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(section, notNullValue()); assertThat(section.getSkipSection().isEmpty(), equalTo(false)); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/TestSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TestSectionParserTests.java similarity index 85% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/TestSectionParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TestSectionParserTests.java index d034ae56a71..aa23cabe07b 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/TestSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/parser/TestSectionParserTests.java @@ -16,22 +16,22 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.parser; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.parser.RestTestSectionParser; -import org.elasticsearch.test.rest.parser.RestTestSuiteParseContext; -import org.elasticsearch.test.rest.section.DoSection; -import org.elasticsearch.test.rest.section.GreaterThanAssertion; -import org.elasticsearch.test.rest.section.IsFalseAssertion; -import org.elasticsearch.test.rest.section.IsTrueAssertion; -import org.elasticsearch.test.rest.section.LengthAssertion; -import org.elasticsearch.test.rest.section.LessThanAssertion; -import org.elasticsearch.test.rest.section.MatchAssertion; -import org.elasticsearch.test.rest.section.SetSection; -import org.elasticsearch.test.rest.section.SkipSection; -import org.elasticsearch.test.rest.section.TestSection; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSectionParser; +import org.elasticsearch.test.rest.yaml.parser.ClientYamlTestSuiteParseContext; +import org.elasticsearch.test.rest.yaml.section.DoSection; +import org.elasticsearch.test.rest.yaml.section.GreaterThanAssertion; +import org.elasticsearch.test.rest.yaml.section.IsFalseAssertion; +import org.elasticsearch.test.rest.yaml.section.IsTrueAssertion; +import org.elasticsearch.test.rest.yaml.section.LengthAssertion; +import org.elasticsearch.test.rest.yaml.section.LessThanAssertion; +import org.elasticsearch.test.rest.yaml.section.MatchAssertion; +import org.elasticsearch.test.rest.yaml.section.SetSection; +import org.elasticsearch.test.rest.yaml.section.SkipSection; +import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection; import java.util.Map; @@ -51,8 +51,8 @@ public class TestSectionParserTests extends AbstractParserTestCase { " name: test_warmer" ); - RestTestSectionParser testSectionParser = new RestTestSectionParser(); - TestSection testSection = testSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSectionParser testSectionParser = new ClientYamlTestSectionParser(); + ClientYamlTestSection testSection = testSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(testSection, notNullValue()); assertThat(testSection.getName(), equalTo("First test section")); @@ -80,9 +80,9 @@ public class TestSectionParserTests extends AbstractParserTestCase { " - set: {_scroll_id: scroll_id}"; - RestTestSectionParser testSectionParser = new RestTestSectionParser(); + ClientYamlTestSectionParser testSectionParser = new ClientYamlTestSectionParser(); parser = YamlXContent.yamlXContent.createParser(yaml); - TestSection testSection = testSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSection testSection = testSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(testSection, notNullValue()); assertThat(testSection.getName(), equalTo("First test section")); @@ -119,8 +119,8 @@ public class TestSectionParserTests extends AbstractParserTestCase { " id: 中文" ); - RestTestSectionParser testSectionParser = new RestTestSectionParser(); - TestSection testSection = testSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSectionParser testSectionParser = new ClientYamlTestSectionParser(); + ClientYamlTestSection testSection = testSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(testSection, notNullValue()); assertThat(testSection.getName(), equalTo("Basic")); @@ -172,8 +172,8 @@ public class TestSectionParserTests extends AbstractParserTestCase { " - lt: { size: 10 }" ); - RestTestSectionParser testSectionParser = new RestTestSectionParser(); - TestSection testSection = testSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSectionParser testSectionParser = new ClientYamlTestSectionParser(); + ClientYamlTestSection testSection = testSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(testSection, notNullValue()); assertThat(testSection.getName(), equalTo("Basic")); @@ -242,8 +242,8 @@ public class TestSectionParserTests extends AbstractParserTestCase { " \n" + " - is_true: nodes\n" + " - is_true: cluster_name\n"); - RestTestSectionParser testSectionParser = new RestTestSectionParser(); - TestSection testSection = testSectionParser.parse(new RestTestSuiteParseContext("api", "suite", parser)); + ClientYamlTestSectionParser testSectionParser = new ClientYamlTestSectionParser(); + ClientYamlTestSection testSection = testSectionParser.parse(new ClientYamlTestSuiteParseContext("api", "suite", parser)); assertThat(testSection, notNullValue()); assertThat(testSection.getName(), equalTo("node_info test")); assertThat(testSection.getExecutableSections().size(), equalTo(3)); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserFailingTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java similarity index 89% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserFailingTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java index 0cd8ee31398..f2219816462 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserFailingTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java @@ -16,21 +16,22 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.spec.RestApiParser; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApiParser; import java.io.IOException; import static org.hamcrest.Matchers.containsString; /** - * These tests are not part of {@link RestApiParserTests} because the tested failures don't allow to consume the whole yaml stream + * These tests are not part of {@link ClientYamlSuiteRestApiParserTests} because the tested failures don't allow to consume the whole yaml + * stream */ -public class RestApiParserFailingTests extends ESTestCase { +public class ClientYamlSuiteRestApiParserFailingTests extends ESTestCase { public void testBrokenSpecShouldThrowUsefulExceptionWhenParsingFailsOnParams() throws Exception { parseAndExpectFailure(BROKEN_SPEC_PARAMS, "Expected params field in rest api definition to contain an object"); } @@ -42,7 +43,7 @@ public class RestApiParserFailingTests extends ESTestCase { private void parseAndExpectFailure(String brokenJson, String expectedErrorMessage) throws Exception { XContentParser parser = JsonXContent.jsonXContent.createParser(brokenJson); try { - new RestApiParser().parse("location", parser); + new ClientYamlSuiteRestApiParser().parse("location", parser); fail("Expected to fail parsing but did not happen"); } catch (IOException e) { assertThat(e.getMessage(), containsString(expectedErrorMessage)); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java similarity index 93% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java index d884b327f71..342f2bb4ed2 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/RestApiParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java @@ -16,20 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.rest.spec.RestApi; -import org.elasticsearch.test.rest.spec.RestApiParser; +import org.elasticsearch.test.rest.yaml.parser.AbstractParserTestCase; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; +import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApiParser; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; -public class RestApiParserTests extends AbstractParserTestCase { +public class ClientYamlSuiteRestApiParserTests extends AbstractParserTestCase { public void testParseRestSpecIndexApi() throws Exception { parser = JsonXContent.jsonXContent.createParser(REST_SPEC_INDEX_API); - RestApi restApi = new RestApiParser().parse("location", parser); + ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("location", parser); assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("index")); @@ -51,7 +52,7 @@ public class RestApiParserTests extends AbstractParserTestCase { public void testParseRestSpecGetTemplateApi() throws Exception { parser = JsonXContent.jsonXContent.createParser(REST_SPEC_GET_TEMPLATE_API); - RestApi restApi = new RestApiParser().parse("location", parser); + ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("location", parser); assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("indices.get_template")); assertThat(restApi.getMethods().size(), equalTo(1)); @@ -68,7 +69,7 @@ public class RestApiParserTests extends AbstractParserTestCase { public void testParseRestSpecCountApi() throws Exception { parser = JsonXContent.jsonXContent.createParser(REST_SPEC_COUNT_API); - RestApi restApi = new RestApiParser().parse("location", parser); + ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApiParser().parse("location", parser); assertThat(restApi, notNullValue()); assertThat(restApi.getName(), equalTo("count")); assertThat(restApi.getMethods().size(), equalTo(2)); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/support/FileUtilsTests.java similarity index 98% rename from test/framework/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java rename to test/framework/src/test/java/org/elasticsearch/test/rest/yaml/support/FileUtilsTests.java index db41c42e16a..c02ca5d85d0 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/support/FileUtilsTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.test.rest.test; +package org.elasticsearch.test.rest.yaml.support; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.support.FileUtils; +import org.elasticsearch.test.rest.yaml.support.FileUtils; import java.nio.file.Files; import java.nio.file.Path;