use of org.elasticsearch.common.xcontent.XContentLocation in project elasticsearch by elastic.
the class GreaterThanEqualToAssertion method parse.
public static GreaterThanEqualToAssertion parse(XContentParser parser) throws IOException {
XContentLocation location = parser.getTokenLocation();
Tuple<String, Object> stringObjectTuple = ParserUtils.parseTuple(parser);
if (!(stringObjectTuple.v2() instanceof Comparable)) {
throw new IllegalArgumentException("gte section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName());
}
return new GreaterThanEqualToAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
}
use of org.elasticsearch.common.xcontent.XContentLocation in project elasticsearch by elastic.
the class ClientYamlTestSectionTests method testAddingDoWithoutWarningWithoutSkip.
public void testAddingDoWithoutWarningWithoutSkip() {
int lineNumber = between(1, 10000);
ClientYamlTestSection section = new ClientYamlTestSection(new XContentLocation(0, 0), "test");
section.setSkipSection(SkipSection.EMPTY);
DoSection doSection = new DoSection(new XContentLocation(lineNumber, 0));
section.addExecutableSection(doSection);
}
use of org.elasticsearch.common.xcontent.XContentLocation in project elasticsearch by elastic.
the class ClientYamlTestSectionTests method testAddingDoWithWarningWithSkip.
public void testAddingDoWithWarningWithSkip() {
int lineNumber = between(1, 10000);
ClientYamlTestSection section = new ClientYamlTestSection(new XContentLocation(0, 0), "test");
section.setSkipSection(new SkipSection(null, singletonList("warnings"), null));
DoSection doSection = new DoSection(new XContentLocation(lineNumber, 0));
doSection.setExpectedWarningHeaders(singletonList("foo"));
section.addExecutableSection(doSection);
}
Aggregations