Changeset 4602
- Timestamp:
- 07/10/06 19:27:04 (2 years ago)
- Files:
-
- trunk/activerecord/test/connections/native_db2/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_firebird/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_frontbase/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_mysql/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_openbase/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_oracle/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_postgresql/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_sqlite/connection.rb (modified) (3 diffs)
- trunk/activerecord/test/connections/native_sqlite3/connection.rb (modified) (3 diffs)
- trunk/activerecord/test/connections/native_sqlserver_odbc/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_sqlserver/connection.rb (modified) (1 diff)
- trunk/activerecord/test/connections/native_sybase/connection.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/test/connections/native_db2/connection.rb
r3182 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'arunit' 8 db2 = 'arunit2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'db2', 10 :host => 'localhost', 11 :username => 'arunit', 12 :password => 'arunit', 13 :database => 'arunit' 14 }, 15 'arunit2' => { 16 :adapter => 'db2', 17 :host => 'localhost', 18 :username => 'arunit', 19 :password => 'arunit', 20 :database => 'arunit2' 21 } 22 } 9 23 10 ActiveRecord::Base.establish_connection( 11 :adapter => "db2", 12 :host => "localhost", 13 :username => "arunit", 14 :password => "arunit", 15 :database => db1 16 ) 17 18 Course.establish_connection( 19 :adapter => "db2", 20 :host => "localhost", 21 :username => "arunit2", 22 :password => "arunit2", 23 :database => db2 24 ) 24 ActiveRecord::Base.establish_connection 'arunit' 25 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_firebird/connection.rb
r4424 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'firebird', 10 :host => 'localhost', 11 :username => 'rails', 12 :password => 'rails', 13 :database => 'activerecord_unittest', 14 :charset => 'UTF8' 15 }, 16 'arunit2' => { 17 :adapter => 'firebird', 18 :host => 'localhost', 19 :username => 'rails', 20 :password => 'rails', 21 :database => 'activerecord_unittest2' 22 } 23 } 9 24 10 ActiveRecord::Base.establish_connection( 11 :adapter => "firebird", 12 :host => "localhost", 13 :username => "rails", 14 :password => "rails", 15 :database => db1, 16 :charset => "UTF8" 17 ) 18 19 Course.establish_connection( 20 :adapter => "firebird", 21 :host => "localhost", 22 :username => "rails", 23 :password => "rails", 24 :database => db2 25 ) 25 ActiveRecord::Base.establish_connection 'arunit' 26 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_frontbase/connection.rb
r4291 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'frontbase', 10 :host => 'localhost', 11 :username => 'rails', 12 :password => '', 13 :database => 'activerecord_unittest', 14 :session_name => "unittest-#{$$}" 15 }, 16 'arunit2' => { 17 :adapter => 'frontbase', 18 :host => 'localhost', 19 :username => 'rails', 20 :password => '', 21 :database => 'activerecord_unittest2', 22 :session_name => "unittest-#{$$}" 23 } 24 } 9 25 10 ActiveRecord::Base.establish_connection( 11 :adapter => "frontbase", 12 :host => "localhost", 13 :username => "rails", 14 :password => "", 15 :database => db1, 16 :session_name => "unittest-#{$$}" 17 ) 18 19 Course.establish_connection( 20 :adapter => "frontbase", 21 :host => "localhost", 22 :username => "rails", 23 :password => "", 24 :database => db2, 25 :session_name => "unittest-#{$$}" 26 ) 26 ActiveRecord::Base.establish_connection 'arunit' 27 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_mysql/connection.rb
r3654 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'mysql', 10 :username => 'rails', 11 :encoding => 'utf8', 12 :database => 'activerecord_unittest', 13 }, 14 'arunit2' => { 15 :adapter => 'mysql', 16 :username => 'rails', 17 :database => 'activerecord_unittest2' 18 } 19 } 9 20 10 ActiveRecord::Base.establish_connection( 11 :adapter => "mysql", 12 :username => "rails", 13 :encoding => "utf8", 14 :database => db1 15 ) 16 17 Course.establish_connection( 18 :adapter => "mysql", 19 :username => "rails", 20 :database => db2 21 ) 21 ActiveRecord::Base.establish_connection 'arunit' 22 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_openbase/connection.rb
r3932 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'openbase', 10 :username => 'admin', 11 :database => 'activerecord_unittest', 12 }, 13 'arunit2' => { 14 :adapter => 'openbase', 15 :username => 'admin', 16 :database => 'activerecord_unittest2' 17 } 18 } 9 19 10 ActiveRecord::Base.establish_connection( 11 :adapter => "openbase", 12 :username => "admin", 13 :password => "", 14 :database => db1 15 ) 16 17 Course.establish_connection( 18 :adapter => "openbase", 19 :username => "admin", 20 :password => "", 21 :database => db2 22 ) 20 ActiveRecord::Base.establish_connection 'arunit' 21 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_oracle/connection.rb
r4152 r4602 9 9 db = ENV['ARUNIT_DB'] || 'activerecord_unittest' 10 10 11 ActiveRecord::Base.establish_connection( 12 :adapter => 'oracle', 13 :username => 'arunit', 14 :password => 'arunit', 15 :database => db 16 ) 11 ActiveRecord::Base.configurations = { 12 'arunit' => { 13 :adapter => 'oracle', 14 :username => 'arunit', 15 :password => 'arunit', 16 :database => db, 17 }, 18 'arunit2' => { 19 :adapter => 'oracle', 20 :username => 'arunit2', 21 :password => 'arunit2', 22 :database => db 23 } 24 } 17 25 18 Course.establish_connection( 19 :adapter => 'oracle', 20 :username => 'arunit2', 21 :password => 'arunit2', 22 :database => db 23 ) 26 ActiveRecord::Base.establish_connection 'arunit' 27 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_postgresql/connection.rb
r3182 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'postgresql', 10 :username => 'postgres', 11 :database => 'activerecord_unittest', 12 :min_messages => 'warning' 13 }, 14 'arunit2' => { 15 :adapter => 'postgresql', 16 :username => 'postgres', 17 :database => 'activerecord_unittest2', 18 :min_messages => 'warning' 19 } 20 } 9 21 10 ActiveRecord::Base.establish_connection( 11 :adapter => "postgresql", 12 :username => "postgres", 13 :password => "postgres", 14 :database => db1, 15 :min_messages => "warning" 16 ) 17 18 Course.establish_connection( 19 :adapter => "postgresql", 20 :username => "postgres", 21 :password => "postgres", 22 :database => db2, 23 :min_messages => "warning" 24 ) 22 ActiveRecord::Base.establish_connection 'arunit' 23 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_sqlite/connection.rb
r3466 r4602 12 12 13 13 def make_connection(clazz, db_file, db_definitions_file) 14 ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite', :database => db_file } } 14 15 unless File.exist?(db_file) 15 16 puts "SQLite database not found at #{db_file}. Rebuilding it." … … 17 18 puts "Executing '#{sqlite_command}'" 18 19 raise SqliteError.new("Seems that there is no sqlite executable available") unless system(sqlite_command) 19 clazz.establish_connection( 20 :adapter => "sqlite", 21 :database => db_file) 20 clazz.establish_connection(clazz.name) 22 21 script = File.read("#{BASE_DIR}/db_definitions/#{db_definitions_file}") 23 22 # SQLite-Ruby has problems with semi-colon separated commands, so split and execute one at a time … … 27 26 end 28 27 else 29 clazz.establish_connection( 30 :adapter => "sqlite", 31 :database => db_file) 28 clazz.establish_connection(clazz.name) 32 29 end 33 30 end trunk/activerecord/test/connections/native_sqlite3/connection.rb
r3466 r4602 12 12 13 13 def make_connection(clazz, db_file, db_definitions_file) 14 ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite3', :database => db_file } } 14 15 unless File.exist?(db_file) 15 16 puts "SQLite3 database not found at #{db_file}. Rebuilding it." … … 17 18 puts "Executing '#{sqlite_command}'" 18 19 raise SqliteError.new("Seems that there is no sqlite3 executable available") unless system(sqlite_command) 19 clazz.establish_connection( 20 :adapter => "sqlite3", 21 :database => db_file) 20 clazz.establish_connection(clazz.name) 22 21 script = File.read("#{BASE_DIR}/db_definitions/#{db_definitions_file}") 23 22 # SQLite-Ruby has problems with semi-colon separated commands, so split and execute one at a time … … 27 26 end 28 27 else 29 clazz.establish_connection( 30 :adapter => "sqlite3", 31 :database => db_file) 28 clazz.establish_connection(clazz.name) 32 29 end 33 30 end trunk/activerecord/test/connections/native_sqlserver_odbc/connection.rb
r3182 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 dsn1 = 'activerecord_unittest' 8 dsn2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'sqlserver', 10 :mode => 'ODBC', 11 :host => 'localhost', 12 :username => 'sa', 13 :dsn => 'activerecord_unittest' 14 }, 15 'arunit2' => { 16 :adapter => 'sqlserver', 17 :mode => 'ODBC', 18 :host => 'localhost', 19 :username => 'sa', 20 :dsn => 'activerecord_unittest2' 21 } 22 } 9 23 10 ActiveRecord::Base.establish_connection( 11 :adapter => "sqlserver", 12 :mode => "ODBC", 13 :host => "localhost", 14 :username => "sa", 15 :password => "", 16 :dsn => dsn1 17 ) 18 19 Course.establish_connection( 20 :adapter => "sqlserver", 21 :mode => "ODBC", 22 :host => "localhost", 23 :username => "sa", 24 :password => "", 25 :dsn => dsn2 26 ) 24 ActiveRecord::Base.establish_connection 'arunit' 25 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_sqlserver/connection.rb
r3182 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'sqlserver', 10 :host => 'localhost', 11 :username => 'sa', 12 :database => 'activerecord_unittest' 13 }, 14 'arunit2' => { 15 :adapter => 'sqlserver', 16 :host => 'localhost', 17 :username => 'sa', 18 :database => 'activerecord_unittest2' 19 } 20 } 9 21 10 ActiveRecord::Base.establish_connection( 11 :adapter => "sqlserver", 12 :host => "localhost", 13 :username => "sa", 14 :password => "", 15 :database => db1 16 ) 17 18 Course.establish_connection( 19 :adapter => "sqlserver", 20 :host => "localhost", 21 :username => "sa", 22 :password => "", 23 :database => db2 24 ) 22 ActiveRecord::Base.establish_connection 'arunit' 23 Course.establish_connection 'arunit2' trunk/activerecord/test/connections/native_sybase/connection.rb
r3734 r4602 5 5 ActiveRecord::Base.logger = Logger.new("debug.log") 6 6 7 db1 = 'activerecord_unittest' 8 db2 = 'activerecord_unittest2' 7 ActiveRecord::Base.configurations = { 8 'arunit' => { 9 :adapter => 'sybase', 10 :host => 'database_ASE', 11 :username => 'sa', 12 :database => 'activerecord_unittest' 13 }, 14 'arunit2' => { 15 :adapter => 'sybase', 16 :host => 'database_ASE', 17 :username => 'sa', 18 :database => 'activerecord_unittest2' 19 } 20 } 9 21 10 ActiveRecord::Base.establish_connection( 11 :adapter => "sybase", 12 :host => "database_ASE", 13 :username => "sa", 14 :password => "", 15 :database => db1 16 ) 17 18 Course.establish_connection( 19 :adapter => "sybase", 20 :host => "database_ASE", 21 :username => "sa", 22 :password => "", 23 :database => db2 24 ) 22 ActiveRecord::Base.establish_connection 'arunit' 23 Course.establish_connection 'arunit2'