Fix compilation issue following removal of Streams.copyToStringFromClasspath() from core
Original commit: elastic/x-pack-elasticsearch@d7d0dfd640
This commit is contained in:
parent
d3c0468a6c
commit
a7645ed4f0
|
@ -5,9 +5,9 @@
|
|||
*/
|
||||
package org.elasticsearch.marvel.agent;
|
||||
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.marvel.agent.support.AgentUtils;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.hamcrest.MatcherAssert;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
|
@ -28,7 +28,7 @@ public class AgentUtilsTests extends ESTestCase {
|
|||
|
||||
@Test
|
||||
public void testVersionIsExtractableFromIndexTemplate() throws IOException {
|
||||
byte[] template = Streams.copyToBytesFromClasspath("/marvel_index_template.json");
|
||||
byte[] template = StreamsUtils.copyToBytesFromClasspath("/marvel_index_template.json");
|
||||
MatcherAssert.assertThat(AgentUtils.parseIndexVersionFromTemplate(template), Matchers.greaterThan(0));
|
||||
}
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ import org.elasticsearch.cluster.ClusterService;
|
|||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMarvelDoc;
|
||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ClusterStateRendererTests extends ESSingleNodeTestCase {
|
||||
|
@ -44,7 +44,7 @@ public class ClusterStateRendererTests extends ESSingleNodeTestCase {
|
|||
String result = RendererTestUtils.renderAsJSON(marvelDoc, renderer);
|
||||
|
||||
logger.debug("--> loading sample document from file {}", SAMPLE_FILE);
|
||||
String expected = Streams.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
String expected = StreamsUtils.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
|
||||
String nodeId = clusterState.getNodes().getLocalNodeId();
|
||||
logger.debug("--> replace the local node id in sample document with {}", nodeId);
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
package org.elasticsearch.marvel.agent.renderer.cluster;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMarvelDoc;
|
||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ClusterStatsRendererTests extends ESSingleNodeTestCase {
|
||||
|
@ -32,7 +32,7 @@ public class ClusterStatsRendererTests extends ESSingleNodeTestCase {
|
|||
String result = RendererTestUtils.renderAsJSON(marvelDoc, renderer);
|
||||
|
||||
logger.debug("--> loading sample document from file {}", SAMPLE_FILE);
|
||||
String expected = Streams.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
String expected = StreamsUtils.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
|
||||
logger.debug("--> comparing both documents, they must have the same structure");
|
||||
RendererTestUtils.assertJSONStructure(result, expected);
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.elasticsearch.Version;
|
|||
import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
|
||||
import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.common.transport.DummyTransportAddress;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.indices.recovery.RecoveryState;
|
||||
|
@ -17,6 +16,7 @@ import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMarvelDoc;
|
|||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -60,7 +60,7 @@ public class IndexRecoveryRendererTests extends ESTestCase {
|
|||
String result = RendererTestUtils.renderAsJSON(marvelDoc, renderer);
|
||||
|
||||
logger.debug("--> loading sample document from file {}", SAMPLE_FILE);
|
||||
String expected = Streams.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
String expected = StreamsUtils.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
|
||||
logger.debug("--> comparing both documents, they must be identical");
|
||||
RendererTestUtils.assertJSONStructureAndValues(result, expected);
|
||||
|
|
|
@ -8,7 +8,6 @@ package org.elasticsearch.marvel.agent.renderer.indices;
|
|||
import org.elasticsearch.action.admin.indices.stats.CommonStats;
|
||||
import org.elasticsearch.action.admin.indices.stats.IndexStats;
|
||||
import org.elasticsearch.action.admin.indices.stats.ShardStats;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.index.indexing.IndexingStats;
|
||||
import org.elasticsearch.index.shard.DocsStats;
|
||||
import org.elasticsearch.index.store.StoreStats;
|
||||
|
@ -16,6 +15,7 @@ import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
|||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IndexStatsRendererTests extends ESTestCase {
|
||||
|
@ -52,7 +52,7 @@ public class IndexStatsRendererTests extends ESTestCase {
|
|||
String result = RendererTestUtils.renderAsJSON(marvelDoc, renderer);
|
||||
|
||||
logger.debug("--> loading sample document from file {}", SAMPLE_FILE);
|
||||
String expected = Streams.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
String expected = StreamsUtils.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
|
||||
logger.debug("--> comparing both documents, they must be identical");
|
||||
RendererTestUtils.assertJSONStructureAndValues(result, expected);
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
package org.elasticsearch.marvel.agent.renderer.node;
|
||||
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||
import org.elasticsearch.common.io.Streams;
|
||||
import org.elasticsearch.marvel.agent.collector.node.NodeStatsMarvelDoc;
|
||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||
import org.elasticsearch.node.service.NodeService;
|
||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||
import org.elasticsearch.test.StreamsUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
public class NodeStatsRendererTests extends ESSingleNodeTestCase {
|
||||
|
@ -35,7 +35,7 @@ public class NodeStatsRendererTests extends ESSingleNodeTestCase {
|
|||
String result = RendererTestUtils.renderAsJSON(marvelDoc, renderer);
|
||||
|
||||
logger.debug("--> loading sample document from file {}", SAMPLE_FILE);
|
||||
String expected = Streams.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
String expected = StreamsUtils.copyToStringFromClasspath(SAMPLE_FILE);
|
||||
|
||||
logger.debug("--> comparing both documents, they must have the same structure");
|
||||
RendererTestUtils.assertJSONStructure(result, expected);
|
||||
|
|
Loading…
Reference in New Issue