From deb6391c10a0192c6265682524cd41018ecda9ae Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Tue, 21 Jul 2015 21:42:13 +0200 Subject: [PATCH] Marvel: Add integration test Closes elastic/elasticsearch#314 Original commit: elastic/x-pack-elasticsearch@9c5d3ab8626b477cae83316253520fc1a8f70c9e --- marvel/pom.xml | 4 +-- .../rest-api-spec/test/marvel/10_basic.yaml | 16 +++++++++++ .../elasticsearch/marvel/MarvelRestIT.java | 27 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 marvel/rest-api-spec/test/marvel/10_basic.yaml create mode 100644 marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java diff --git a/marvel/pom.xml b/marvel/pom.xml index 5d8f863e614..4235c0b4bd3 100644 --- a/marvel/pom.xml +++ b/marvel/pom.xml @@ -17,8 +17,8 @@ dev-tools/integration-tests.xml - - true + marvel + false diff --git a/marvel/rest-api-spec/test/marvel/10_basic.yaml b/marvel/rest-api-spec/test/marvel/10_basic.yaml new file mode 100644 index 00000000000..d9508cca6cd --- /dev/null +++ b/marvel/rest-api-spec/test/marvel/10_basic.yaml @@ -0,0 +1,16 @@ +# Integration tests for Marvel plugin +# +"Marvel loaded": + - do: + cluster.state: {} + + # Get master node id + - set: { master_node: master } + + - do: + nodes.info: {} + + - match: { nodes.$master.plugins.0.name: license } + - match: { nodes.$master.plugins.0.jvm: true } + - match: { nodes.$master.plugins.1.name: marvel } + - match: { nodes.$master.plugins.1.jvm: true } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java b/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java new file mode 100644 index 00000000000..e039c7e48b5 --- /dev/null +++ b/marvel/src/test/java/org/elasticsearch/marvel/MarvelRestIT.java @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +package org.elasticsearch.marvel; + +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.RestTestCandidate; +import org.elasticsearch.test.rest.parser.RestTestParseException; + +import java.io.IOException; + +public class MarvelRestIT extends ElasticsearchRestTestCase { + + public MarvelRestIT(@Name("yaml") RestTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, RestTestParseException { + return ElasticsearchRestTestCase.createParameters(0, 1); + } +} +