Rename client yaml test infrastructure
This makes it obvious that these tests are for running the client yaml suites. Now that there are other ways of running tests using the REST client against a running cluster we can't go on calling the shared client yaml tests "REST tests". They are rest tests, but they aren't **the** rest tests.
This commit is contained in:
parent
0553ba9151
commit
9270e8b22b
|
@ -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<? extends Class<?>> 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);
|
||||
|
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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<Object[]> parameters() throws IOException, ClientYamlTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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<Object[]> parameters() throws IOException, RestTestParseException {
|
||||
return ESClientYamlSuiteTestCase.createParameters(0, 1);
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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<String, String> params, List<Map<String, Object>> bodies,
|
||||
public ClientYamlTestResponse callApi(String apiName, Map<String, String> params, List<Map<String, Object>> bodies,
|
||||
Map<String, String> headers) throws IOException {
|
||||
//makes a copy of the parameters before modifying them for this specific request
|
||||
HashMap<String, String> 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<String, String> params, String body, Map<String, String> headers)
|
||||
private ClientYamlTestResponse callApiInternal(String apiName, Map<String, String> params, String body, Map<String, String> 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<HttpHost> hosts) throws IOException {
|
||||
restTestClient = new RestTestClient(restSpec, client, hosts);
|
||||
restTestClient = new ClientYamlTestClient(restSpec, client, hosts);
|
||||
}
|
||||
|
||||
/**
|
|
@ -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 = "(?<!\\\\),";
|
||||
|
||||
private final List<BlacklistedPathPatternMatcher> 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<Object[]> createParameters(int id, int count) throws IOException, RestTestParseException {
|
||||
public static Iterable<Object[]> 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<RestTestCandidate> restTestCandidates = collectTestCandidates(id, count);
|
||||
List<ClientYamlTestCandidate> restTestCandidates = collectTestCandidates(id, count);
|
||||
List<Object[]> objects = new ArrayList<>();
|
||||
for (RestTestCandidate restTestCandidate : restTestCandidates) {
|
||||
for (ClientYamlTestCandidate restTestCandidate : restTestCandidates) {
|
||||
objects.add(new Object[]{restTestCandidate});
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
private static List<RestTestCandidate> collectTestCandidates(int id, int count) throws RestTestParseException, IOException {
|
||||
List<RestTestCandidate> testCandidates = new ArrayList<>();
|
||||
private static List<ClientYamlTestCandidate> collectTestCandidates(int id, int count) throws ClientYamlTestParseException, IOException {
|
||||
List<ClientYamlTestCandidate> 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<String, Set<Path>> 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<Path> 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<RestTestCandidate>() {
|
||||
Collections.sort(testCandidates, new Comparator<ClientYamlTestCandidate>() {
|
||||
@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");
|
|
@ -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;
|
|
@ -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;
|
|
@ -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<String> 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<HttpHost> hosts) throws IOException {
|
||||
public ClientYamlTestClient(ClientYamlSuiteRestSpec restSpec, RestClient restClient, List<HttpHost> hosts) throws IOException {
|
||||
assert hosts.size() > 0;
|
||||
this.restSpec = restSpec;
|
||||
this.restClient = restClient;
|
||||
|
@ -70,7 +72,7 @@ public class RestTestClient {
|
|||
}
|
||||
|
||||
private Version readAndCheckVersion(List<HttpHost> 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<String, String> params, String body, Map<String, String> headers)
|
||||
public ClientYamlTestResponse callApi(String apiName, Map<String, String> params, String body, Map<String, String> 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<String, String> 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");
|
||||
}
|
|
@ -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 {
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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 <T> the test fragment's type that gets parsed and returned
|
||||
*/
|
||||
public interface RestTestFragmentParser<T> {
|
||||
public interface ClientYamlTestFragmentParser<T> {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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<TestSection> {
|
||||
public class ClientYamlTestSectionParser implements ClientYamlTestFragmentParser<ClientYamlTestSection> {
|
||||
|
||||
@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<TestSection
|
|||
|
||||
return testSection;
|
||||
} catch (Exception e) {
|
||||
throw new RestTestParseException("Error parsing test named [" + testSection.getName() + "]", e);
|
||||
throw new ClientYamlTestParseException("Error parsing test named [" + testSection.getName() + "]", e);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,18 +16,17 @@
|
|||
* 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.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentParser.Token;
|
||||
import org.elasticsearch.test.rest.section.DoSection;
|
||||
import org.elasticsearch.test.rest.section.ExecutableSection;
|
||||
import org.elasticsearch.test.rest.section.SetupSection;
|
||||
import org.elasticsearch.test.rest.section.SkipSection;
|
||||
import org.elasticsearch.test.rest.section.TeardownSection;
|
||||
import org.elasticsearch.test.rest.section.TestSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.DoSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.ExecutableSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.SetupSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.SkipSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.TeardownSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.ClientYamlTestSection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
@ -37,14 +36,15 @@ import java.util.Map;
|
|||
* Context shared across the whole tests parse phase.
|
||||
* Provides shared parse methods and holds information needed to parse the test sections (e.g. es version)
|
||||
*/
|
||||
public class RestTestSuiteParseContext {
|
||||
public class ClientYamlTestSuiteParseContext {
|
||||
|
||||
private static final SetupSectionParser SETUP_SECTION_PARSER = new SetupSectionParser();
|
||||
private static final TeardownSectionParser TEARDOWN_SECTION_PARSER = new TeardownSectionParser();
|
||||
private static final RestTestSectionParser TEST_SECTION_PARSER = new RestTestSectionParser();
|
||||
private static final ClientYamlTestSectionParser TEST_SECTION_PARSER = new ClientYamlTestSectionParser();
|
||||
private static final SkipSectionParser SKIP_SECTION_PARSER = new SkipSectionParser();
|
||||
private static final DoSectionParser DO_SECTION_PARSER = new DoSectionParser();
|
||||
private static final Map<String, RestTestFragmentParser<? extends ExecutableSection>> EXECUTABLE_SECTIONS_PARSERS = new HashMap<>();
|
||||
private static final Map<String, ClientYamlTestFragmentParser<? extends ExecutableSection>> 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<? extends ExecutableSection> execSectionParser = EXECUTABLE_SECTIONS_PARSERS.get(section);
|
||||
ClientYamlTestFragmentParser<? extends ExecutableSection> 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<String, Object> parseTuple() throws IOException, RestTestParseException {
|
||||
public Tuple<String, Object> parseTuple() throws IOException, ClientYamlTestParseException {
|
||||
parser.nextToken();
|
||||
advanceToFieldName();
|
||||
Map<String,Object> 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<String, Object> entry = map.entrySet().iterator().next();
|
|
@ -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<RestTestSuite> {
|
||||
public class ClientYamlTestSuiteParser implements ClientYamlTestFragmentParser<ClientYamlTestSuite> {
|
||||
|
||||
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<RestTestSuite
|
|||
ByteBuffer bb = ByteBuffer.wrap(new byte[1]);
|
||||
channel.read(bb, channel.size() - 1);
|
||||
if (bb.get(0) != 10) {
|
||||
throw new RestTestParseException("test suite [" + api + "/" + filename + "] doesn't end with line feed (\\n)");
|
||||
throw new ClientYamlTestParseException("test suite [" + api + "/" + filename + "] doesn't end with line feed (\\n)");
|
||||
}
|
||||
}
|
||||
|
||||
try (XContentParser parser = YamlXContent.yamlXContent.createParser(Files.newInputStream(file))) {
|
||||
RestTestSuiteParseContext testParseContext = new RestTestSuiteParseContext(api, filename, parser);
|
||||
ClientYamlTestSuiteParseContext testParseContext = new ClientYamlTestSuiteParseContext(api, filename, parser);
|
||||
return parse(testParseContext);
|
||||
} catch(Exception e) {
|
||||
throw new RestTestParseException("Error parsing " + api + "/" + filename, e);
|
||||
throw new ClientYamlTestParseException("Error parsing " + api + "/" + filename, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestTestSuite parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public ClientYamlTestSuite parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
XContentParser parser = parseContext.parser();
|
||||
|
||||
parser.nextToken();
|
||||
assert parser.currentToken() == XContentParser.Token.START_OBJECT : "expected token to be START_OBJECT but was "
|
||||
+ parser.currentToken();
|
||||
|
||||
RestTestSuite restTestSuite = new RestTestSuite(parseContext.getApi(), parseContext.getSuiteName());
|
||||
ClientYamlTestSuite restTestSuite = new ClientYamlTestSuite(parseContext.getApi(), parseContext.getSuiteName());
|
||||
|
||||
restTestSuite.setSetupSection(parseContext.parseSetupSection());
|
||||
restTestSuite.setTeardownSection(parseContext.parseTeardownSection());
|
||||
|
@ -89,9 +88,9 @@ public class RestTestSuiteParser implements RestTestFragmentParser<RestTestSuite
|
|||
}
|
||||
}
|
||||
|
||||
TestSection testSection = parseContext.parseTestSection();
|
||||
ClientYamlTestSection testSection = parseContext.parseTestSection();
|
||||
if (!restTestSuite.addTestSection(testSection)) {
|
||||
throw new RestTestParseException("duplicate test section [" + testSection.getName() + "] found in ["
|
||||
throw new ClientYamlTestParseException("duplicate test section [" + testSection.getName() + "] found in ["
|
||||
+ restTestSuite.getPath() + "]");
|
||||
}
|
||||
}
|
|
@ -16,13 +16,13 @@
|
|||
* 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.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.test.rest.section.ApiCallSection;
|
||||
import org.elasticsearch.test.rest.section.DoSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.ApiCallSection;
|
||||
import org.elasticsearch.test.rest.yaml.section.DoSection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
@ -31,10 +31,10 @@ import java.util.Map;
|
|||
/**
|
||||
* Parser for do sections
|
||||
*/
|
||||
public class DoSectionParser implements RestTestFragmentParser<DoSection> {
|
||||
public class DoSectionParser implements ClientYamlTestFragmentParser<DoSection> {
|
||||
|
||||
@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<DoSection> {
|
|||
}
|
||||
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);
|
|
@ -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<GreaterThanEqualToAssertion> {
|
||||
|
||||
public class GreaterThanEqualToParser implements ClientYamlTestFragmentParser<GreaterThanEqualToAssertion> {
|
||||
@Override
|
||||
public GreaterThanEqualToAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public GreaterThanEqualToAssertion parse(ClientYamlTestSuiteParseContext parseContext)
|
||||
throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> 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());
|
|
@ -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<GreaterThanAssertion> {
|
||||
public class GreaterThanParser implements ClientYamlTestFragmentParser<GreaterThanAssertion> {
|
||||
|
||||
@Override
|
||||
public GreaterThanAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public GreaterThanAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> 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());
|
|
@ -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<IsFalseAssertion> {
|
||||
public class IsFalseParser implements ClientYamlTestFragmentParser<IsFalseAssertion> {
|
||||
|
||||
@Override
|
||||
public IsFalseAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public IsFalseAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
return new IsFalseAssertion(parseContext.parseField());
|
||||
}
|
||||
}
|
|
@ -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<IsTrueAssertion> {
|
||||
public class IsTrueParser implements ClientYamlTestFragmentParser<IsTrueAssertion> {
|
||||
|
||||
@Override
|
||||
public IsTrueAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public IsTrueAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
return new IsTrueAssertion(parseContext.parseField());
|
||||
}
|
||||
}
|
|
@ -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<LengthAssertion> {
|
||||
public class LengthParser implements ClientYamlTestFragmentParser<LengthAssertion> {
|
||||
|
||||
@Override
|
||||
public LengthAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public LengthAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> stringObjectTuple = parseContext.parseTuple();
|
||||
assert stringObjectTuple.v2() != null;
|
||||
int value;
|
||||
|
@ -39,7 +39,7 @@ public class LengthParser implements RestTestFragmentParser<LengthAssertion> {
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<LessThanOrEqualToAssertion> {
|
||||
public class LessThanOrEqualToParser implements ClientYamlTestFragmentParser<LessThanOrEqualToAssertion> {
|
||||
|
||||
@Override
|
||||
public LessThanOrEqualToAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public LessThanOrEqualToAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> 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());
|
|
@ -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<LessThanAssertion> {
|
||||
public class LessThanParser implements ClientYamlTestFragmentParser<LessThanAssertion> {
|
||||
|
||||
@Override
|
||||
public LessThanAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public LessThanAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> 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());
|
|
@ -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<MatchAssertion> {
|
||||
public class MatchParser implements ClientYamlTestFragmentParser<MatchAssertion> {
|
||||
|
||||
@Override
|
||||
public MatchAssertion parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
|
||||
public MatchAssertion parse(ClientYamlTestSuiteParseContext parseContext) throws IOException, ClientYamlTestParseException {
|
||||
Tuple<String,Object> stringObjectTuple = parseContext.parseTuple();
|
||||
return new MatchAssertion(stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
|
@ -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<SetSection> {
|
||||
public class SetSectionParser implements ClientYamlTestFragmentParser<SetSection> {
|
||||
|
||||
@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<SetSection> {
|
|||
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;
|
|
@ -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<SetupSection> {
|
||||
public class SetupSectionParser implements ClientYamlTestFragmentParser<SetupSection> {
|
||||
|
||||
@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<SetupSection>
|
|||
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();
|
|
@ -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<SkipSection> {
|
||||
public class SkipSectionParser implements ClientYamlTestFragmentParser<SkipSection> {
|
||||
|
||||
@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<SkipSection> {
|
|||
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<SkipSection> {
|
|||
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);
|
|
@ -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<TeardownSection> {
|
||||
public class TeardownSectionParser implements ClientYamlTestFragmentParser<TeardownSection> {
|
||||
|
||||
@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<TeardownSec
|
|||
while (parser.currentToken() != XContentParser.Token.END_ARRAY) {
|
||||
parseContext.advanceToFieldName();
|
||||
if (!"do".equals(parser.currentName())) {
|
||||
throw new RestTestParseException("section [" + parser.currentName() + "] not supported within teardown section");
|
||||
throw new ClientYamlTestParseException("section [" + parser.currentName() + "] not supported within teardown section");
|
||||
}
|
||||
|
||||
parser.nextToken();
|
|
@ -16,11 +16,10 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.elasticsearch.test.rest.spec;
|
||||
package org.elasticsearch.test.rest.yaml.restspec;
|
||||
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpPut;
|
||||
import org.elasticsearch.test.rest.client.RestPath;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -28,9 +27,9 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Represents an elasticsearch REST endpoint (api)
|
||||
* Specification of an Elasticsearch endpoint used by the YAML specs to generate REST requests.
|
||||
*/
|
||||
public class RestApi {
|
||||
public class ClientYamlSuiteRestApi {
|
||||
|
||||
private final String location;
|
||||
private final String name;
|
||||
|
@ -38,13 +37,13 @@ public class RestApi {
|
|||
private List<String> paths = new ArrayList<>();
|
||||
private List<String> pathParts = new ArrayList<>();
|
||||
private List<String> 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<String, String> pathParams) {
|
||||
List<RestPath> matchingRestPaths = findMatchingRestPaths(pathParams.keySet());
|
||||
public ClientYamlSuiteRestPath[] getFinalPaths(Map<String, String> pathParams) {
|
||||
List<ClientYamlSuiteRestPath> 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<RestPath> findMatchingRestPaths(Set<String> restParams) {
|
||||
private List<ClientYamlSuiteRestPath> findMatchingRestPaths(Set<String> restParams) {
|
||||
|
||||
List<RestPath> matchingRestPaths = new ArrayList<>();
|
||||
RestPath[] restPaths = buildRestPaths();
|
||||
for (RestPath restPath : restPaths) {
|
||||
List<ClientYamlSuiteRestPath> 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;
|
||||
}
|
|
@ -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) {
|
|
@ -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<PathPart> parts;
|
||||
private final List<String> placeholders;
|
||||
|
||||
public RestPath(List<String> parts) {
|
||||
public ClientYamlSuiteRestPath(List<String> parts) {
|
||||
List<PathPart> 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<String> placeholders = new ArrayList<>();
|
||||
List<PathPart> parts = new ArrayList<>();
|
||||
|
@ -73,7 +73,7 @@ public class RestPath {
|
|||
return placeholders.size() == params.size() && placeholders.containsAll(params);
|
||||
}
|
||||
|
||||
public RestPath replacePlaceholders(Map<String,String> params) {
|
||||
public ClientYamlSuiteRestPath replacePlaceholders(Map<String,String> params) {
|
||||
List<String> 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 {
|
|
@ -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<String, RestApi> restApiMap = new HashMap<>();
|
||||
public class ClientYamlSuiteRestSpec {
|
||||
Map<String, ClientYamlSuiteRestApi> 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<RestApi> getApis() {
|
||||
public Collection<ClientYamlSuiteRestApi> 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) {
|
|
@ -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;
|
|
@ -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<String, Object> map = (Map<String, Object>) 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));
|
||||
}
|
||||
|
|
@ -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<TestSection> {
|
||||
public class ClientYamlTestSection implements Comparable<ClientYamlTestSection> {
|
||||
private final String name;
|
||||
private SkipSection skipSection;
|
||||
private final List<ExecutableSection> 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<TestSection> {
|
|||
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<TestSection> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TestSection o) {
|
||||
public int compareTo(ClientYamlTestSection o) {
|
||||
return name.compareTo(o.getName());
|
||||
}
|
||||
}
|
|
@ -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<TestSection> testSections = new TreeSet<>();
|
||||
private Set<ClientYamlTestSection> 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<TestSection> getTestSections() {
|
||||
public List<ClientYamlTestSection> getTestSections() {
|
||||
return new ArrayList<>(testSections);
|
||||
}
|
||||
}
|
|
@ -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<String, org.hamcrest.Matcher<Integer>> 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") + "]";
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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<String, String> entry : stash.entrySet()) {
|
||||
Object actualValue = executionContext.response(entry.getKey());
|
||||
executionContext.stash().stashValue(entry.getValue(), actualValue);
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
||||
|
|
@ -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;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue