Skip to content

Commit

Permalink
Delete test about loading postgres jdbc driver for java 7
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseChavez committed Jul 31, 2024
1 parent 840e1ed commit 2d3aa77
Showing 1 changed file with 7 additions and 30 deletions.
37 changes: 7 additions & 30 deletions test/db/postgresql/jdbc_postgres_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module Jdbc
class PostgresTest < Test::Unit::TestCase

SKIP_TESTS = false
SYSTEM_ENV = ENV_JAVA.dup

setup do
Expand All @@ -16,37 +14,16 @@ class PostgresTest < Test::Unit::TestCase

test('some') { assert Jdbc::Postgres }

test 'returns jdbc version 4.1 on java 7' do
ENV_JAVA[ 'java.specification.version' ] = '1.7'
assert_equal 7, Jdbc::Postgres.send(:jre_version)
end unless SKIP_TESTS

test 'returns jdbc version default (4.2) on java 8/9' do
ENV_JAVA[ 'java.specification.version' ] = '1.8'
assert_nil Jdbc::Postgres.send(:jre_version)
test 'returns jdbc version default (4.2) on java 8' do
ENV_JAVA['java.specification.version'] = '1.8'

ENV_JAVA[ 'java.specification.version' ] = '9'
assert_nil Jdbc::Postgres.send(:jre_version)
end unless SKIP_TESTS

context 'load-driver' do

ROOT_DIR = File.expand_path('../../..', File.dirname(__FILE__))

@@driver_dir = File.join(ROOT_DIR, 'jdbc-postgres/lib')
end

test 'on java 7' do
ENV_JAVA[ 'java.specification.version' ] = '1.7'
Jdbc::Postgres.expects(:load).with do |driver_jar|
assert_match(/.jre7.jar$/, driver_jar)
full_path = File.join(@@driver_dir, driver_jar)
assert File.exist?(full_path), "#{driver_jar.inspect} not found in: #{@@driver_dir.inspect}"
true
end
Jdbc::Postgres.load_driver
end
test 'returns jdbc version 4.2 on java 11' do
ENV_JAVA['java.specification.version'] = '11'

assert_nil Jdbc::Postgres.send(:jre_version)
end

end if defined? JRUBY_VERSION
end
end

0 comments on commit 2d3aa77

Please sign in to comment.