logstash-core-event-java 5.0.0.alpha6.snapshot1-java → 5.0.0.alpha6.snapshot2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99f144b8a21a12f11307862e00a528ab09395584
4
- data.tar.gz: 461b0b304e322816d0541a973a6a3ea1439d1824
3
+ metadata.gz: d1387a75d98e940027af5034b31b876f82799643
4
+ data.tar.gz: 60c8731f4dc1680a2555f4b541dc583a8d347f85
5
5
  SHA512:
6
- metadata.gz: ec6c2046f05bdd9baf3268c8b963930fb09c42df23e9cd5b5c38278b5cfb9055954422ba5720789cd5a67ae43a32d6224989bc6362f542f73785f033cfca575b
7
- data.tar.gz: 90977b55ed0abf0120a19a15cb478ec54ca39bd0126163aa623ab63595bbd7b8a19bab10e596439d7ac16c00f7b94f8599b25eefae31fbc4ca810dcbbba5455b
6
+ metadata.gz: 35600341c26ba7092837511656281532185c0583ddaad4bdd2c548175b45ef7800f74dcbb191014b0a492f49ca37a092730a841cd937fe2e86c0eb34cc87e927
7
+ data.tar.gz: dfa30f2561e5559271e30a8873178a1401723c9689dcc4753bca51a0c50047fc3b7b93101d2fc14ea99eb95637ab963a6baff5a9d01ddb047c3372de9bd273e7
@@ -3,21 +3,32 @@
3
3
  require "logstash/namespace"
4
4
  require "logstash/json"
5
5
  require "logstash/string_interpolation"
6
- require "cabin"
7
6
 
8
7
  # transcient pipeline events for normal in-flow signaling as opposed to
9
8
  # flow altering exceptions. for now having base classes is adequate and
10
9
  # in the future it might be necessary to refactor using like a BaseEvent
11
10
  # class to have a common interface for all pileline events to support
12
11
  # eventual queueing persistence for example, TBD.
13
- class LogStash::ShutdownEvent; end
14
- class LogStash::FlushEvent; end
15
-
16
12
  module LogStash
17
- FLUSH = LogStash::FlushEvent.new
13
+ class SignalEvent
14
+ def flush?; raise "abstract method"; end;
15
+ def shutdown?; raise "abstract method"; end;
16
+ end
17
+
18
+ class ShutdownEvent < SignalEvent
19
+ def flush?; false; end;
20
+ def shutdown?; true; end;
21
+ end
22
+
23
+ class FlushEvent < SignalEvent
24
+ def flush?; true; end;
25
+ def shutdown?; false; end;
26
+ end
27
+
28
+ FLUSH = FlushEvent.new
18
29
 
19
30
  # LogStash::SHUTDOWN is used by plugins
20
- SHUTDOWN = LogStash::ShutdownEvent.new
31
+ SHUTDOWN = ShutdownEvent.new
21
32
  end
22
33
 
23
34
  # for backward compatibility, require "logstash/event" is used a lots of places so let's bootstrap the
@@ -5,4 +5,4 @@
5
5
  # Note to authors: this should not include dashes because 'gem' barfs if
6
6
  # you include a dash in the version string.
7
7
 
8
- LOGSTASH_CORE_EVENT_JAVA_VERSION = "5.0.0.alpha6.snapshot1"
8
+ LOGSTASH_CORE_EVENT_JAVA_VERSION = "5.0.0.alpha6.snapshot2"
data/spec/event_spec.rb CHANGED
@@ -194,62 +194,27 @@ describe LogStash::Event do
194
194
  end
195
195
 
196
196
 
197
- # noop logger used to test the injectable logger in Event
198
- # this implementation is not complete because only the warn
199
- # method is used in Event.
200
- module DummyLogger
201
- def self.warn(message)
202
- # do nothing
203
- end
204
- end
197
+ # TODO(talevy): migrate tests to Java. no reason to test logging logic in ruby when it is being
198
+ # done in java land.
205
199
 
206
- context "logger" do
200
+ # context "logger" do
207
201
 
208
- let(:logger) { double("Logger") }
209
- after(:each) { LogStash::Event.logger = LogStash::Event::DEFAULT_LOGGER }
202
+ # let(:logger) { double("Logger") }
210
203
 
211
- # the following 2 specs are using both a real module (DummyLogger)
212
- # and a mock. both tests are needed to make sure the implementation
213
- # supports both types of objects.
204
+ # before(:each) do
205
+ # allow(LogStash::Event).to receive(:logger).and_return(logger)
206
+ # end
214
207
 
215
- it "should set logger using a module" do
216
- LogStash::Event.logger = DummyLogger
217
- expect(DummyLogger).to receive(:warn).once
218
- LogStash::Event.new(TIMESTAMP => "invalid timestamp")
219
- end
208
+ # it "should set logger using a module" do
209
+ # expect(logger).to receive(:warn).once
210
+ # LogStash::Event.new(TIMESTAMP => "invalid timestamp")
211
+ # end
220
212
 
221
- it "should set logger using a mock" do
222
- LogStash::Event.logger = logger
223
- expect(logger).to receive(:warn).once
224
- LogStash::Event.new(TIMESTAMP => "invalid timestamp")
225
- end
226
-
227
- it "should unset logger" do
228
- # first set
229
- LogStash::Event.logger = logger
230
- expect(logger).to receive(:warn).once
231
- LogStash::Event.new(TIMESTAMP => "invalid timestamp")
232
-
233
- # then unset
234
- LogStash::Event.logger = LogStash::Event::DEFAULT_LOGGER
235
- expect(logger).to receive(:warn).never
236
- # this will produce a log line in stdout by the Java Event
237
- LogStash::Event.new(TIMESTAMP => "ignore this log")
238
- end
239
-
240
-
241
- it "should warn on parsing error" do
242
- LogStash::Event.logger = logger
243
- expect(logger).to receive(:warn).once.with(/^Error parsing/)
244
- LogStash::Event.new(TIMESTAMP => "invalid timestamp")
245
- end
246
-
247
- it "should warn on invalid timestamp object" do
248
- LogStash::Event.logger = logger
249
- expect(logger).to receive(:warn).once.with(/^Unrecognized/)
250
- LogStash::Event.new(TIMESTAMP => Array.new)
251
- end
252
- end
213
+ # it "should warn on invalid timestamp object" do
214
+ # expect(logger).to receive(:warn).once.with(/^Unrecognized/)
215
+ # LogStash::Event.new(TIMESTAMP => Array.new)
216
+ # end
217
+ # end
253
218
 
254
219
  context "to_hash" do
255
220
  let (:source_hash) { {"a" => 1, "b" => [1, 2, 3, {"h" => 1, "i" => "baz"}], "c" => {"d" => "foo", "e" => "bar", "f" => [4, 5, "six"]}} }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core-event-java
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.alpha6.snapshot1
4
+ version: 5.0.0.alpha6.snapshot2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement