diff --git a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java index 249101cfc54a3..5d6cc8113717d 100644 --- a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java +++ b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java @@ -74,7 +74,7 @@ public static Iterable parameters() throws Exception { entries.add(new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("compare_analyzers"), CompareAnalyzers::parse)); NamedXContentRegistry executableSectionRegistry = new NamedXContentRegistry(entries); - return ESClientYamlSuiteTestCase.createParameters(executableSectionRegistry); + return ESClientYamlSuiteTestCase.createParameters(executableSectionRegistry, TESTS_PATH); } @Override diff --git a/qa/rest-compat-tests/build.gradle b/qa/rest-compat-tests/build.gradle index ce160b6127582..56f48f7d128fc 100644 --- a/qa/rest-compat-tests/build.gradle +++ b/qa/rest-compat-tests/build.gradle @@ -20,3 +20,5 @@ integTest.dependsOn(copyRestTestsResources) dependencies { compile project(':test:framework') } + +test.enabled = false diff --git a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java index e465224c22e26..461f6fcd370b0 100644 --- a/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java +++ b/qa/rest-compat-tests/src/main/java/org/elasticsearch/rest/compat/AbstractCompatRestTest.java @@ -1,3 +1,21 @@ +/* + * 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.rest.compat; import com.carrotsearch.randomizedtesting.annotations.Name; diff --git a/qa/rest-compat-tests/src/test/java/org/elasticsearch/rest/compat/CompatRestIT.java b/qa/rest-compat-tests/src/test/java/org/elasticsearch/rest/compat/CompatRestIT.java index 7c94c62f3200d..0aa4201778aa8 100644 --- a/qa/rest-compat-tests/src/test/java/org/elasticsearch/rest/compat/CompatRestIT.java +++ b/qa/rest-compat-tests/src/test/java/org/elasticsearch/rest/compat/CompatRestIT.java @@ -1,3 +1,21 @@ +/* + * 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.rest.compat; import com.carrotsearch.randomizedtesting.annotations.Name; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index e919c00cf4d0a..2b90dcb26887a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -88,7 +88,7 @@ public abstract class ESClientYamlSuiteTestCase extends ESRestTestCase { */ private static final String REST_TESTS_VALIDATE_SPEC = "tests.rest.validate_spec"; - private static final String TESTS_PATH = "/rest-api-spec/test"; + protected static final String TESTS_PATH = "/rest-api-spec/test"; private static final String SPEC_PATH = "/rest-api-spec/api"; /** diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCaseTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCaseTests.java index ae64dbc893d81..69a6de0e3783b 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCaseTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCaseTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.test.ESTestCase; +import static org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.TESTS_PATH; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.Matchers.greaterThan; @@ -32,29 +33,29 @@ public class ESClientYamlSuiteTestCaseTests extends ESTestCase { public void testLoadAllYamlSuites() throws Exception { - Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites(""); + Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, ""); assertEquals(2, yamlSuites.size()); } public void testLoadSingleYamlSuite() throws Exception { - Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites("suite1/10_basic"); + Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, "suite1/10_basic"); assertSingleFile(yamlSuites, "suite1", "10_basic.yml"); //extension .yaml is optional - yamlSuites = ESClientYamlSuiteTestCase.loadSuites("suite1/10_basic"); + yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, "suite1/10_basic"); assertSingleFile(yamlSuites, "suite1", "10_basic.yml"); } public void testLoadMultipleYamlSuites() throws Exception { //single directory - Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites("suite1"); + Map> yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, "suite1"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(1)); assertThat(yamlSuites.containsKey("suite1"), equalTo(true)); assertThat(yamlSuites.get("suite1").size(), greaterThan(1)); //multiple directories - yamlSuites = ESClientYamlSuiteTestCase.loadSuites("suite1", "suite2"); + yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, "suite1", "suite2"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("suite1"), equalTo(true)); @@ -63,7 +64,7 @@ public void testLoadMultipleYamlSuites() throws Exception { assertEquals(2, yamlSuites.get("suite2").size()); //multiple paths, which can be both directories or yaml test suites (with optional file extension) - yamlSuites = ESClientYamlSuiteTestCase.loadSuites("suite2/10_basic", "suite1"); + yamlSuites = ESClientYamlSuiteTestCase.loadSuites(TESTS_PATH, "suite2/10_basic", "suite1"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("suite2"), equalTo(true));