forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests to cover codec autoswitch for stdin + tcp inputs
json->json_lines & plain->line Tests for elastic#1392 Closes elastic#1394
- Loading branch information
1 parent
0d3df38
commit bf518f7
Showing
2 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# encoding: utf-8 | ||
require "test_utils" | ||
require "socket" | ||
require "logstash/inputs/stdin" | ||
|
||
describe LogStash::Inputs::Stdin do | ||
context "codec (PR #1372)" do | ||
it "switches from plain to line" do | ||
require "logstash/codecs/plain" | ||
require "logstash/codecs/line" | ||
plugin = LogStash::Inputs::Stdin.new("codec" => LogStash::Codecs::Plain.new) | ||
plugin.register | ||
insist { plugin.codec }.is_a?(LogStash::Codecs::Line) | ||
end | ||
it "switches from json to json_lines" do | ||
require "logstash/codecs/json" | ||
require "logstash/codecs/json_lines" | ||
plugin = LogStash::Inputs::Stdin.new("codec" => LogStash::Codecs::JSON.new) | ||
plugin.register | ||
insist { plugin.codec }.is_a?(LogStash::Codecs::JSONLines) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters