Addressing tests.
This commit is contained in:
parent
707c005979
commit
e6e9ac3b04
30
spec/outputs/jdbc_derby_spec.rb
Normal file
30
spec/outputs/jdbc_derby_spec.rb
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
require_relative '../jdbc_spec_helper'
|
||||||
|
|
||||||
|
describe "logstash-output-jdbc: derby", if: ENV['JDBC_DERBY_JAR'] do
|
||||||
|
|
||||||
|
include_context "rspec setup"
|
||||||
|
include_context "when initializing"
|
||||||
|
include_context "when outputting messages"
|
||||||
|
|
||||||
|
let(:jdbc_jar_env) do
|
||||||
|
'JDBC_DERBY_JAR'
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:jdbc_drop_table) do
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:jdbc_create_table) do
|
||||||
|
"CREATE table #{jdbc_test_table} (created_at timestamp, message varchar(512))"
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:jdbc_settings) do
|
||||||
|
{
|
||||||
|
"driver_class" => "org.apache.derby.jdbc.EmbeddedDriver",
|
||||||
|
"connection_string" => "jdbc:derby:memory:testdb;create=true",
|
||||||
|
"driver_jar_path" => ENV[jdbc_jar_env],
|
||||||
|
"statement" => [ "insert into logstash_output_jdbc_test (created_at, message) values(?, ?)", "@timestamp", "message" ]
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -2,6 +2,7 @@ require_relative "../jdbc_spec_helper"
|
||||||
|
|
||||||
describe "logstash-output-jdbc: mysql", if: ENV['JDBC_MYSQL_JAR'] do
|
describe "logstash-output-jdbc: mysql", if: ENV['JDBC_MYSQL_JAR'] do
|
||||||
|
|
||||||
|
include_context "rspec setup"
|
||||||
include_context "when initializing"
|
include_context "when initializing"
|
||||||
include_context "when outputting messages"
|
include_context "when outputting messages"
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,6 @@
|
||||||
require_relative '../jdbc_spec_helper'
|
require_relative "../jdbc_spec_helper"
|
||||||
|
|
||||||
describe LogStash::Outputs::Jdbc do
|
describe LogStash::Outputs::Jdbc do
|
||||||
|
|
||||||
include_context "rspec setup"
|
|
||||||
include_context "when initializing"
|
|
||||||
include_context "when outputting messages"
|
|
||||||
|
|
||||||
let(:jdbc_jar_env) do
|
|
||||||
'JDBC_DERBY_JAR'
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:jdbc_drop_table) do
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:jdbc_create_table) do
|
|
||||||
"CREATE table #{jdbc_test_table} (created_at timestamp, message varchar(512))"
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:jdbc_settings) do
|
|
||||||
{
|
|
||||||
"driver_class" => "org.apache.derby.jdbc.EmbeddedDriver",
|
|
||||||
"connection_string" => "jdbc:derby:memory:testdb;create=true",
|
|
||||||
"driver_jar_path" => ENV[jdbc_jar_env],
|
|
||||||
"statement" => [ "insert into logstash_output_jdbc_test (created_at, message) values(?, ?)", "@timestamp", "message" ]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when initializing' do
|
context 'when initializing' do
|
||||||
|
|
||||||
it 'shouldn\'t register without a config' do
|
it 'shouldn\'t register without a config' do
|
||||||
|
@ -36,5 +10,4 @@ describe LogStash::Outputs::Jdbc do
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,7 @@ describe "logstash-output-jdbc: sqlite", if: ENV['JDBC_SQLITE_JAR'] do
|
||||||
File.delete(JDBC_SQLITE_FILE) if File.exists? JDBC_SQLITE_FILE
|
File.delete(JDBC_SQLITE_FILE) if File.exists? JDBC_SQLITE_FILE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
include_context "rspec setup"
|
||||||
include_context "when initializing"
|
include_context "when initializing"
|
||||||
include_context "when outputting messages"
|
include_context "when outputting messages"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user