mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
parent
734a443aac
commit
0467f0dbda
30 changed files with 22 additions and 68 deletions
|
@ -8,7 +8,6 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Created by andrewvc on 9/6/16.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.logstash.config.ir;
|
||||
|
||||
import org.logstash.common.Util;
|
||||
|
||||
/**
|
||||
* Created by andrewvc on 12/23/16.
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.logstash.config.ir;
|
||||
|
||||
import org.logstash.common.Util;
|
||||
import org.logstash.config.ir.Hashable;
|
||||
|
||||
/**
|
||||
* Created by andrewvc on 6/12/17.
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.config.ir.expression;
|
|||
import org.jruby.RubyInstanceConfig;
|
||||
import org.jruby.embed.AttributeName;
|
||||
import org.jruby.embed.ScriptingContainer;
|
||||
import org.logstash.config.ir.Hashable;
|
||||
import org.logstash.config.ir.BaseSourceComponent;
|
||||
import org.logstash.common.SourceWithMetadata;
|
||||
import org.logstash.config.ir.HashableWithSource;
|
||||
|
@ -45,4 +44,4 @@ public abstract class Expression extends BaseSourceComponent implements Hashable
|
|||
public String hashSource() {
|
||||
return toRubyString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ package org.logstash.instrument.metrics.counter;
|
|||
import org.logstash.instrument.metrics.AbstractMetric;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.LongAdder;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,8 +5,6 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.logstash.ackedqueue.Checkpoint;
|
||||
import org.logstash.ackedqueue.io.CheckpointIO;
|
||||
import org.logstash.ackedqueue.io.FileCheckpointIO;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
|
@ -52,4 +50,4 @@ public class FileCheckpointIOTest {
|
|||
byte[] compare = Files.readAllBytes(path);
|
||||
assertThat(contents, is(equalTo(compare)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.junit.Test;
|
|||
import org.junit.rules.TemporaryFolder;
|
||||
import org.logstash.ackedqueue.SequencedList;
|
||||
import org.logstash.ackedqueue.StringElement;
|
||||
import org.logstash.ackedqueue.io.MmapPageIO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -53,4 +52,4 @@ public class FileMmapIOTest {
|
|||
}
|
||||
assertThat(readList, is(equalTo(list)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import org.junit.Test;
|
|||
import org.logstash.ackedqueue.Queueable;
|
||||
import org.logstash.ackedqueue.SequencedList;
|
||||
import org.logstash.ackedqueue.StringElement;
|
||||
import org.logstash.ackedqueue.io.wip.MemoryPageIOStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -185,4 +184,4 @@ public class MemoryPageIOStreamTest {
|
|||
assertThat(ele.toString(), is(equalTo(values[i + 3])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.Parameterized;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Created by andrewvc on 6/12/17.
|
||||
|
@ -59,4 +58,4 @@ public class SourceWithMetadataTest {
|
|||
public void itShouldThrowWhenMissingAField() throws IncompleteSourceWithMetadataException {
|
||||
new SourceWithMetadata(parameterGroup.protocol, parameterGroup.path, parameterGroup.line, parameterGroup.column, parameterGroup.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
@ -178,4 +177,4 @@ public class RecordIOReaderTest {
|
|||
Arrays.fill(blockSize, 'e');
|
||||
return blockSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,7 @@ import org.junit.Test;
|
|||
import org.logstash.common.Util;
|
||||
import org.logstash.config.ir.graph.Graph;
|
||||
|
||||
import java.nio.channels.Pipe;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.logstash.config.ir.DSL.*;
|
||||
import static org.logstash.config.ir.PluginDefinition.Type.*;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.logstash.config.ir.imperative.IfStatement;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.logstash.config.ir.graph;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.logstash.common.IncompleteSourceWithMetadataException;
|
||||
import org.logstash.common.SourceWithMetadata;
|
||||
import org.logstash.config.ir.InvalidIRException;
|
||||
import org.logstash.config.ir.PluginDefinition;
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
|
@ -57,4 +55,4 @@ public class LongCounterTest {
|
|||
public void type() {
|
||||
assertThat(longCounter.type()).isEqualTo(MetricType.COUNTER_LONG.asString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ package org.logstash.instrument.metrics.gauge;
|
|||
import org.junit.Test;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
|
@ -34,4 +32,4 @@ public class BooleanGaugeTest {
|
|||
assertThat(gauge.getType()).isEqualTo(MetricType.GAUGE_BOOLEAN);
|
||||
assertThat(gauge.getValue()).isFalse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ import org.logstash.instrument.metrics.MetricType;
|
|||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.ThrowableAssert.catchThrowable;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
@ -54,4 +52,4 @@ public class RubyHashGaugeTest {
|
|||
assertThat(gauge.getType()).isEqualTo(MetricType.GAUGE_RUBYHASH);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,8 @@ import org.logstash.Timestamp;
|
|||
import org.logstash.ext.JrubyTimestampExtLibrary.RubyTimestamp;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
@ -50,4 +47,4 @@ public class RubyTimeStampGaugeTest {
|
|||
assertThat(gauge.getValue()).isEqualTo(rubyTimestamp.getTimestamp());
|
||||
assertThat(gauge.getType()).isEqualTo(MetricType.GAUGE_RUBYTIMESTAMP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ package org.logstash.instrument.metrics.gauge;
|
|||
import org.junit.Test;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
|
@ -30,4 +28,4 @@ public class TextGaugeTest {
|
|||
assertThat(gauge.getValue()).isEqualTo("baz");
|
||||
assertThat(gauge.getType()).isEqualTo(MetricType.GAUGE_TEXT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import org.junit.Test;
|
|||
import org.logstash.instrument.metrics.MetricType;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Collections;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.instrument.witness.configuration;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.configuration.ConfigWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -141,4 +140,4 @@ public class ConfigWitnessTest {
|
|||
"\"dead_letter_queue_enabled\":false,\"dead_letter_queue_path\":\"/var/dlq\"}}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.DeadLetterQueueWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -45,4 +44,4 @@ public class DeadLetterQueueWitnessTest {
|
|||
String json = witness.asJson();
|
||||
assertThat(json).isEqualTo("{\"dead_letter_queue\":{\"queue_size_in_bytes\":98}}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.ErrorWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -68,4 +67,4 @@ public class ErrorWitnessTest {
|
|||
json = witness.asJson();
|
||||
assertThat(json).contains("Uh oh!").contains("ErrorWitnessTest");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.EventsWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -145,4 +144,4 @@ public class EventsWitnessTest {
|
|||
assertThat(json).doesNotContain("555");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,8 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.PipelineWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.within;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link PipelineWitness}
|
||||
|
@ -130,4 +128,4 @@ public class PipelineWitnessTest {
|
|||
json = witness.asJson();
|
||||
assertThat(json).contains("\"dead_letter_queue\":{\"queue_size_in_bytes\":0}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.PipelinesWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -49,4 +48,4 @@ public class PipelinesWitnessTest {
|
|||
assertThat(json).contains("aaa").contains("bbb").contains("ccc");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.logstash.RubyUtil;
|
||||
import org.logstash.instrument.metrics.MetricType;
|
||||
import org.logstash.instrument.witness.pipeline.PluginWitness;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -167,4 +166,4 @@ public class PluginWitnessTest {
|
|||
witness.custom().gauge("a", UUID.randomUUID());
|
||||
witness.asJson();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.PluginsWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -94,4 +93,4 @@ public class PluginsWitnessTest {
|
|||
json = witness.asJson();
|
||||
assertThat(json).isEqualTo("{\"plugins\":{\"inputs\":[],\"filters\":[],\"outputs\":[]}}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.logstash.instrument.witness.pipeline;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.logstash.instrument.witness.pipeline.QueueWitness;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -172,4 +171,4 @@ public class QueueWitnessTest {
|
|||
assertThat(json).isEqualTo("{\"queue\":{\"type\":\"persisted\",\"events\":102,\"capacity\":{\"queue_size_in_bytes\":0,\"page_capacity_in_bytes\":0," +
|
||||
"\"max_queue_size_in_bytes\":0,\"max_unread_events\":0},\"data\":{\"path\":null,\"free_space_in_bytes\":0,\"storage_type\":null}}}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.logstash.Timestamp;
|
||||
import org.logstash.ext.JrubyTimestampExtLibrary;
|
||||
import org.logstash.instrument.witness.pipeline.ReloadWitness;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
|
@ -97,4 +96,4 @@ public class ReloadWitnessTest {
|
|||
assertThat(json).contains("bar");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
package org.logstash.log;
|
||||
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.spi.LoggerContext;
|
||||
import org.apache.logging.log4j.spi.LoggerContextFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
|
@ -40,4 +35,4 @@ public class LogstashLoggerContextFactoryTest {
|
|||
.isEqualTo(contextFactory.getContext("someRandomValue", null, null, false))
|
||||
.isEqualTo(contextFactory.getContext("someOtherRandomValue", ClassLoader.getSystemClassLoader(), null, false, URI.create("foo"), "name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue