Sha256: 2b93fb5801440facca78165b0773b7305fde867eeb4cc08e44b34e569a69c03f
Contents?: true
Size: 1.43 KB
Versions: 15
Compression:
Stored size: 1.43 KB
Contents
shared_context "execution_context" do let(:pipeline) { double("pipeline") } let(:pipeline_id) { :main } let(:agent) { double("agent") } let(:plugin_id) { :plugin_id } let(:plugin_type) { :plugin_type } let(:dlq_writer) { double("dlq_writer") } let(:execution_context) do ::LogStash::ExecutionContext.new(pipeline, agent, plugin_id, plugin_type, dlq_writer) end before do allow(pipeline).to receive(:pipeline_id).and_return(pipeline_id) allow(pipeline).to receive(:agent).and_return(agent) end end shared_context "api setup" do before :all do clear_data_dir settings = mock_settings config_string = "input { generator {id => 'api-generator-pipeline' count => 100 } } output { dummyoutput {} }" settings.set("config.string", config_string) settings.set("config.reload.automatic", false) @agent = make_test_agent(settings) @agent.execute pipeline_config = mock_pipeline_config(:main, "input { generator { id => '123' } } output { null {} }") pipeline_creator = LogStash::PipelineAction::Create.new(pipeline_config, @agent.metric) @pipelines = java.util.concurrent.ConcurrentHashMap.new expect(pipeline_creator.execute(@agent, @pipelines)).to be_truthy end after :all do @pipelines.each do |_, pipeline| pipeline.shutdown pipeline.thread.join end @agent.shutdown end include Rack::Test::Methods def app() described_class.new(nil, @agent) end end
Version data entries
15 entries across 15 versions & 1 rubygems