madhawk57-log 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+
12
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
13
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
14
+ require 'fluent/test'
15
+ unless ENV.has_key?('VERBOSE')
16
+ nulllogger = Object.new
17
+ nulllogger.instance_eval {|obj|
18
+ def method_missing(method, *args)
19
+ end
20
+ }
21
+ $log = nulllogger
22
+ end
23
+
24
+ require 'fluent/plugin/out_kafka'
25
+
26
+ class Test::Unit::TestCase
27
+ end
@@ -0,0 +1,61 @@
1
+ require 'helper'
2
+ require 'fluent/output'
3
+
4
+ class KafkaOutputTest < Test::Unit::TestCase
5
+ def setup
6
+ Fluent::Test.setup
7
+ end
8
+
9
+ BASE_CONFIG = %[
10
+ type kafka_buffered
11
+ ]
12
+
13
+ CONFIG = BASE_CONFIG + %[
14
+ default_topic kitagawakeiko
15
+ brokers localhost:9092
16
+ secretName testsecret
17
+ ]
18
+
19
+ def create_driver(conf = CONFIG, tag='test')
20
+ Fluent::Test::BufferedOutputTestDriver.new(Fluent::KafkaOutput, tag).configure(conf)
21
+ end
22
+
23
+ def test_configure
24
+ assert_nothing_raised(Fluent::ConfigError) {
25
+ create_driver(BASE_CONFIG)
26
+ }
27
+
28
+ assert_nothing_raised(Fluent::ConfigError) {
29
+ create_driver(CONFIG)
30
+ }
31
+
32
+ assert_nothing_raised(Fluent::ConfigError) {
33
+ create_driver(CONFIG + %[
34
+ buffer_type memory
35
+ ])
36
+ }
37
+
38
+ d = create_driver
39
+ assert_equal 'kitagawakeiko', d.instance.default_topic
40
+ assert_equal 'localhost:9092', d.instance.brokers
41
+ assert_equal 'testsecret', d.instance.secretName
42
+ assert_equal 'latest', d.instance.version
43
+ end
44
+
45
+ def test_format
46
+ d = create_driver
47
+ end
48
+
49
+ def test_mutli_worker_support
50
+ d = create_driver
51
+ assert_equal true, d.instance.multi_workers_ready?
52
+
53
+ end
54
+
55
+ def test_write
56
+ d = create_driver
57
+ time = Time.parse("2011-01-02 13:14:15 UTC").to_i
58
+ d.emit({"a"=>1}, time)
59
+ d.emit({"a"=>2}, time)
60
+ end
61
+ end
metadata ADDED
@@ -0,0 +1,168 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: madhawk57-log
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Martin Falk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fluentd
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.10.58
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.10.58
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2'
33
+ - !ruby/object:Gem::Dependency
34
+ name: ltsv
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: ruby-kafka
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.7.8
54
+ - - "<"
55
+ - !ruby/object:Gem::Version
56
+ version: '2'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 0.7.8
64
+ - - "<"
65
+ - !ruby/object:Gem::Version
66
+ version: '2'
67
+ - !ruby/object:Gem::Dependency
68
+ name: google-cloud-secret_manager
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: 0.5.0
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: 0.5.0
81
+ - !ruby/object:Gem::Dependency
82
+ name: rake
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: 0.9.2
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 0.9.2
95
+ - !ruby/object:Gem::Dependency
96
+ name: test-unit
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: 3.0.8
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: 3.0.8
109
+ description: Fluentd
110
+ email:
111
+ - martin.falk@netent.com
112
+ executables: []
113
+ extensions: []
114
+ extra_rdoc_files: []
115
+ files:
116
+ - ".gitignore"
117
+ - ".idea/$CACHE_FILE$"
118
+ - ".idea/.gitignore"
119
+ - ".idea/codeStyles/Project.xml"
120
+ - ".idea/codeStyles/codeStyleConfig.xml"
121
+ - ".idea/fluent-plugin-kafka.iml"
122
+ - ".idea/misc.xml"
123
+ - ".idea/modules.xml"
124
+ - ".idea/sbt.xml"
125
+ - ".idea/vcs.xml"
126
+ - ".travis.yml"
127
+ - ChangeLog
128
+ - Gemfile
129
+ - LICENSE
130
+ - README.md
131
+ - Rakefile
132
+ - fluent-plugin-kafka.gemspec
133
+ - lib/fluent/plugin/in_kafka.rb
134
+ - lib/fluent/plugin/in_kafka_group.rb
135
+ - lib/fluent/plugin/kafka_plugin_util.rb
136
+ - lib/fluent/plugin/kafka_producer_ext.rb
137
+ - lib/fluent/plugin/out_kafka.rb
138
+ - lib/fluent/plugin/out_kafka2.rb
139
+ - lib/fluent/plugin/out_kafka_buffered.rb
140
+ - lib/fluent/plugin/out_rdkafka.rb
141
+ - lib/fluent/plugin/out_rdkafka2.rb
142
+ - test/helper.rb
143
+ - test/plugin/test_out_kafka.rb
144
+ homepage:
145
+ licenses: []
146
+ metadata: {}
147
+ post_install_message:
148
+ rdoc_options: []
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: 2.1.0
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ requirements: []
162
+ rubygems_version: 3.1.2
163
+ signing_key:
164
+ specification_version: 4
165
+ summary: Fluentd
166
+ test_files:
167
+ - test/helper.rb
168
+ - test/plugin/test_out_kafka.rb