Skip to content

Commit

Permalink
Tests: allow oci connection via eazyconnect url
Browse files Browse the repository at this point in the history
  • Loading branch information
javornikolov committed Oct 5, 2014
1 parent 944f5bf commit a746afe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@
# specify which database version is used (will be verified in one test)
DATABASE_VERSION = ENV['DATABASE_VERSION'] || '10.2.0.4'

def get_eazy_connect_url(svc_separator = "")
"#{DATABASE_HOST}:#{DATABASE_PORT}#{svc_separator}#{DATABASE_SERVICE_NAME}"
end

def get_connection(user_number = 0)
database_user, database_password = DATABASE_USERS_AND_PASSWORDS[user_number]
unless defined?(JRUBY_VERSION)
url = (ENV['DATABASE_USE_TNS'] == 'NO') ? get_eazy_connect_url("/") : DATABASE_NAME
try_to_connect(OCIError) do
OCI8.new(database_user, database_password, DATABASE_NAME)
OCI8.new(database_user, database_password, url)
end
else
try_to_connect(NativeException) do
Expand Down

0 comments on commit a746afe

Please sign in to comment.