diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java index 96d54a6f841b7..7dc830c3c885c 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java @@ -89,12 +89,15 @@ private Object[] getTargets(String projectPath) { return new String[] { "src/*/java/org/elasticsearch/action/admin/cluster/repositories/**/*.java", "src/*/java/org/elasticsearch/action/admin/cluster/snapshots/**/*.java", - "src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java", "src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java", "src/*/java/org/elasticsearch/index/snapshots/**/*.java", "src/*/java/org/elasticsearch/repositories/**/*.java", "src/*/java/org/elasticsearch/search/aggregations/**/*.java", "src/*/java/org/elasticsearch/snapshots/**/*.java" }; + } else if (projectPath.equals(":test:framework")) { + return new String[] { + "src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java", + }; } else { // Normally this isn"t necessary, but we have Java sources in // non-standard places @@ -194,7 +197,6 @@ private Object[] getTargets(String projectPath) { ":test:fixtures:geoip-fixture", ":test:fixtures:krb5kdc-fixture", ":test:fixtures:old-elasticsearch", - ":test:framework", ":test:logger-usage", ":x-pack:docs", ":x-pack:license-tools", diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/AbstractXContentFilteringTestCase.java similarity index 98% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/AbstractXContentFilteringTestCase.java index 8f3125ecdea03..cc2fd8ffe99bb 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/AbstractXContentFilteringTestCase.java @@ -6,10 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; +import org.elasticsearch.common.xcontent.support.AbstractFilteringTestCase; import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xcontent.XContent; @@ -17,8 +18,6 @@ import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.AbstractFilteringTestCase; -import org.elasticsearch.xcontent.support.filtering.FilterPath; import java.io.IOException; import java.util.Arrays; @@ -142,6 +141,8 @@ static void assertXContentBuilderAsBytes(final XContentBuilder expected, final X assertThat(jsonParser.numberType(), equalTo(testParser.numberType())); assertThat(jsonParser.numberValue(), equalTo(testParser.numberValue())); break; + default: + break; } } } catch (Exception e) { diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/CborXContentFilteringTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/CborXContentFilteringTests.java index ce4c5d005c759..5b2dce8e10106 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/CborXContentFilteringTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java index 3d73c8717e7ef..ad669a3e61b5d 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.filter.FilteringGeneratorDelegate; + import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xcontent.support.filtering.FilterPathBasedFilter; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathTests.java similarity index 99% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathTests.java index 2046772e0afcf..c8a65e90a4c3a 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/FilterPathTests.java @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xcontent.support.filtering.FilterPath; import java.util.Arrays; import java.util.LinkedHashSet; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/JsonXContentFilteringTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/JsonXContentFilteringTests.java index fffdbb2ad8818..5a27954754d43 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/JsonXContentFilteringTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/SmileFilteringGeneratorTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/SmileFilteringGeneratorTests.java index 7c54668d17192..13efcc0738949 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/SmileFilteringGeneratorTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/YamlFilteringGeneratorTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/YamlFilteringGeneratorTests.java index 00769671707a2..ada8b696c5d64 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/support/filtering/YamlFilteringGeneratorTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java index 7ce475c753496..6533af3fe3222 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java @@ -316,12 +316,7 @@ public void testPrefixedNamesFilteringTest() { public void testNestedFiltering() { Map map = new HashMap<>(); map.put("field", "value"); - map.put("array", Arrays.asList(1, new HashMap() { - { - put("nested", 2); - put("nested_2", 3); - } - })); + map.put("array", Arrays.asList(1, map("nested", 2, "nested_2", 3))); Map filteredMap = XContentMapValues.filter(map, new String[] { "array.nested" }, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(1)); @@ -336,12 +331,7 @@ public void testNestedFiltering() { map.clear(); map.put("field", "value"); - map.put("obj", new HashMap() { - { - put("field", "value"); - put("field2", "value2"); - } - }); + map.put("obj", map("field", "value", "field2", "value2")); filteredMap = XContentMapValues.filter(map, new String[] { "obj.field" }, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(1)); assertThat(((Map) filteredMap.get("obj")).size(), equalTo(1)); @@ -359,18 +349,8 @@ public void testNestedFiltering() { public void testCompleteObjectFiltering() { Map map = new HashMap<>(); map.put("field", "value"); - map.put("obj", new HashMap() { - { - put("field", "value"); - put("field2", "value2"); - } - }); - map.put("array", Arrays.asList(1, new HashMap() { - { - put("field", "value"); - put("field2", "value2"); - } - })); + map.put("obj", map("field", "value", "field2", "value2")); + map.put("array", Arrays.asList(1, map("field", "value", "field2", "value2"))); Map filteredMap = XContentMapValues.filter(map, new String[] { "obj" }, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(1)); @@ -401,18 +381,8 @@ public void testCompleteObjectFiltering() { public void testFilterIncludesUsingStarPrefix() { Map map = new HashMap<>(); map.put("field", "value"); - map.put("obj", new HashMap() { - { - put("field", "value"); - put("field2", "value2"); - } - }); - map.put("n_obj", new HashMap() { - { - put("n_field", "value"); - put("n_field2", "value2"); - } - }); + map.put("obj", map("field", "value", "field2", "value2")); + map.put("n_obj", map("n_field", "value", "n_field2", "value2")); Map filteredMap = XContentMapValues.filter(map, new String[] { "*.field2" }, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(1)); @@ -546,6 +516,11 @@ public void testDotsInFieldNames() { assertEquals(expected, filtered); } + /** + * Tests that we can extract paths containing non-ascii characters. + * See {@link AbstractFilteringTestCase#testFilterSupplementaryCharactersInPaths()} + * for a similar test but for XContent. + */ public void testSupplementaryCharactersInPaths() { Map map = new HashMap<>(); map.put("搜索", 2); @@ -555,6 +530,11 @@ public void testSupplementaryCharactersInPaths() { assertEquals(Collections.singletonMap("指数", 3), XContentMapValues.filter(map, new String[0], new String[] { "搜索" })); } + /** + * Tests that we can extract paths which share a prefix with other paths. + * See {@link AbstractFilteringTestCase#testFilterSharedPrefixes()} + * for a similar test but for XContent. + */ public void testSharedPrefixes() { Map map = new HashMap<>(); map.put("foobar", 2); @@ -633,6 +613,11 @@ public void testEmptyObjectsSubFieldsInclusion() { } } + /** + * Tests that we can extract paths which have another path as a prefix. + * See {@link AbstractFilteringTestCase#testFilterPrefix()} + * for a similar test but for XContent. + */ public void testPrefix() { Map map = new HashMap<>(); map.put("photos", Arrays.asList(new String[] { "foo", "bar" })); diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java b/test/framework/src/main/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java similarity index 92% rename from server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java rename to test/framework/src/main/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java index fbb5a8c84372b..c5bb14133042e 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.core.PathUtils; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.xcontent.FilterXContentParser; @@ -21,15 +20,18 @@ import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.XContentType; +import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.util.Set; import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static java.util.stream.Collectors.toSet; +import static org.hamcrest.Matchers.notNullValue; /** * Tests for {@link XContent} filtering. @@ -46,17 +48,16 @@ protected interface Builder extends CheckedFunction { - try ( - XContentParser parser = XContentType.JSON.xContent() - .createParser( - NamedXContentRegistry.EMPTY, - DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - AbstractFilteringTestCase.class.getResourceAsStream(file) - ) - ) { - // copyCurrentStructure does not property handle filters when it is passed a json parser. So we hide it. - return builder.copyCurrentStructure(new FilterXContentParser(parser) { - }); + try (InputStream stream = AbstractFilteringTestCase.class.getResourceAsStream(file)) { + assertThat("Couldn't find [" + file + "]", stream, notNullValue()); + try ( + XContentParser parser = XContentType.JSON.xContent() + .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, stream) + ) { + // copyCurrentStructure does not property handle filters when it is passed a json parser. So we hide it. + return builder.copyCurrentStructure(new FilterXContentParser(parser) { + }); + } } }; } @@ -397,7 +398,7 @@ public void testBasics() throws Exception { } /** - * Generalization of {@link XContentMapValuesTests#testSupplementaryCharactersInPaths()} + * Tests that we can extract paths containing non-ascii characters. */ public void testFilterSupplementaryCharactersInPaths() throws IOException { Builder sample = builder -> builder.startObject().field("搜索", 2).field("指数", 3).endObject(); @@ -410,7 +411,7 @@ public void testFilterSupplementaryCharactersInPaths() throws IOException { } /** - * Generalization of {@link XContentMapValuesTests#testSharedPrefixes()} + * Tests that we can extract paths which share a prefix with other paths. */ public void testFilterSharedPrefixes() throws IOException { Builder sample = builder -> builder.startObject().field("foobar", 2).field("foobaz", 3).endObject(); @@ -423,7 +424,7 @@ public void testFilterSharedPrefixes() throws IOException { } /** - * Generalization of {@link XContentMapValuesTests#testPrefix()} + * Tests that we can extract paths which have another path as a prefix. */ public void testFilterPrefix() throws IOException { Builder sample = builder -> builder.startObject().array("photos", "foo", "bar").field("photosCount", 2).endObject(); @@ -447,10 +448,12 @@ public void testManyFilters() throws IOException, URISyntaxException { .endObject() .endObject() .endObject(); - Set manyFilters = Files.readAllLines( - PathUtils.get(AbstractFilteringTestCase.class.getResource("many_filters.txt").toURI()), - StandardCharsets.UTF_8 - ).stream().filter(s -> false == s.startsWith("#")).collect(toSet()); - testFilter(deep, deep, manyFilters, emptySet()); + try (InputStream stream = AbstractFilteringTestCase.class.getResourceAsStream("many_filters.txt")) { + assertThat("Couldn't find [many_filters.txt]", stream, notNullValue()); + Set manyFilters = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)).lines() + .filter(s -> false == s.startsWith("#")) + .collect(toSet()); + testFilter(deep, deep, manyFilters, emptySet()); + } } } diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/many_filters.txt b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/many_filters.txt similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/many_filters.txt rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/many_filters.txt diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_authors.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_authors.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_authors.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_authors.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_authors_lastname.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_authors_lastname.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_authors_lastname.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_authors_lastname.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_pr.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_pr.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_pr.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_pr.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_distributors_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_distributors_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_distributors_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_distributors_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_no_distributors_name_no_street.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_no_distributors_name_no_street.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_no_distributors_name_no_street.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_en_no_distributors_name_no_street.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_no_distributors.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_no_distributors.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_no_distributors.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_properties_no_distributors.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_tags_authors_no_name.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_tags_authors_no_name.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_just_tags_authors_no_name.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_just_tags_authors_no_name.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_authors.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_authors.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_authors.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_authors.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_authors_lastname.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_authors_lastname.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_authors_lastname.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_authors_lastname.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_pr.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_pr.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_pr.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_pr.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_distributors_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_distributors_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_distributors_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_distributors_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_en_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_en_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_en_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_en_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_names.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_names.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_names.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_properties_names.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_tags.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_tags.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_tags.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_tags.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_title.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_title.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_title.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_title.json diff --git a/server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_title_pages.json b/test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_title_pages.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/common/xcontent/support/sample_no_title_pages.json rename to test/framework/src/main/resources/org/elasticsearch/common/xcontent/support/sample_no_title_pages.json