Skip to content

Commit

Permalink
Format AbstractFilteringTestCase (backport of #77217) (#77254)
Browse files Browse the repository at this point in the history
`AbstractFilteringTestCase` had a ton of carefully formatted
`XContentBuilder` calls that would have been totally unreadable after
the formatter worked its magic. So I formatted a bunch of them by hand
and extracted the rest to json files.
  • Loading branch information
nik9000 authored Sep 3, 2021
1 parent d7f992b commit 814bdf8
Show file tree
Hide file tree
Showing 25 changed files with 1,336 additions and 1,405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ subprojects {
if (project.path == ':server') {
target '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',
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ protected final void testFilter(Builder expected, Builder actual, Set<String> in

protected abstract XContentType getXContentType();

@Override
protected boolean removesEmptyArrays() {
return true;
}

private XContentBuilder createBuilder() throws IOException {
return XContentBuilder.builder(getXContentType().xContent());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"title" : "My awesome book",
"pages" : 456,
"price" : 27.99,
"timestamp" : 1428582942867,
"default" : null,
"tags" : [
"elasticsearch",
"java"
],
"authors" : [
{
"name" : "John Doe",
"lastname" : "John",
"firstname" : "Doe"
},
{
"name" : "William Smith",
"lastname" : "William",
"firstname" : "Smith"
}
],
"properties" : {
"weight" : 0.8,
"language" : {
"en" : {
"lang" : "English",
"available" : true,
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"name" : "address #1",
"street" : "Hampton St",
"city" : "London"
},
{
"name" : "address #2",
"street" : "Queen St",
"city" : "Stornoway"
}
]
},
{
"name" : "Sussex Books House"
}
]
},
"fr" : {
"lang" : "French",
"available" : false,
"distributors" : [
{
"name" : "La Maison du Livre",
"addresses" : [
{
"name" : "address #1",
"street" : "Rue Mouffetard",
"city" : "Paris"
}
]
},
{
"name" : "Thetra"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"authors" : [
{
"name" : "John Doe",
"lastname" : "John",
"firstname" : "Doe"
},
{
"name" : "William Smith",
"lastname" : "William",
"firstname" : "Smith"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors" : [
{
"lastname" : "John"
},
{
"lastname" : "William"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"authors" : [
{
"name" : "John Doe"
},
{
"name" : "William Smith"
}
],
"properties" : {
"language" : {
"en" : {
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"name" : "address #1"
},
{
"name" : "address #2"
}
]
},
{
"name" : "Sussex Books House"
}
]
},
"fr" : {
"distributors" : [
{
"name" : "La Maison du Livre",
"addresses" : [
{
"name" : "address #1"
}
]
},
{
"name" : "Thetra"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"price" : 27.99,
"properties" : {
"weight" : 0.8,
"language" : {
"en" : {
"lang" : "English",
"available" : true,
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"name" : "address #1",
"street" : "Hampton St",
"city" : "London"
},
{
"name" : "address #2",
"street" : "Queen St",
"city" : "Stornoway"
}
]
},
{
"name" : "Sussex Books House"
}
]
},
"fr" : {
"lang" : "French",
"available" : false,
"distributors" : [
{
"name" : "La Maison du Livre",
"addresses" : [
{
"name" : "address #1",
"street" : "Rue Mouffetard",
"city" : "Paris"
}
]
},
{
"name" : "Thetra"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"properties" : {
"language" : {
"en" : {
"distributors" : [
{
"name" : "The Book Shop"
},
{
"name" : "Sussex Books House"
}
]
},
"fr" : {
"distributors" : [
{
"name" : "La Maison du Livre"
},
{
"name" : "Thetra"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"properties" : {
"language" : {
"en" : {
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"name" : "address #1"
},
{
"name" : "address #2"
}
]
},
{
"name" : "Sussex Books House"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"properties" : {
"language" : {
"en" : {
"lang" : "English",
"available" : true,
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"city" : "London"
},
{
"city" : "Stornoway"
}
]
},
{
"name" : "Sussex Books House"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"properties" : {
"language" : {
"en" : {
"distributors" : [
{
"name" : "The Book Shop",
"addresses" : [
{
"name" : "address #1"
},
{
"name" : "address #2"
}
]
},
{
"name" : "Sussex Books House"
}
]
},
"fr" : {
"distributors" : [
{
"name" : "La Maison du Livre",
"addresses" : [
{
"name" : "address #1"
}
]
},
{
"name" : "Thetra"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"properties" : {
"weight" : 0.8,
"language" : {
"en" : {
"lang" : "English",
"available" : true
},
"fr" : {
"lang" : "French",
"available" : false
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"tags" : [
"elasticsearch",
"java"
],
"authors" : [
{
"lastname" : "John",
"firstname" : "Doe"
},
{
"lastname" : "William",
"firstname" : "Smith"
}
]
}
Loading

0 comments on commit 814bdf8

Please sign in to comment.