Class: PLSQLUnitTest::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/plsql_unit_test/setup.rb

Class Method Summary collapse

Class Method Details

.connect(user, password, service, host, port) ⇒ Object

Establishes a database connection using the SimpleOracleJDBC::Interface class. This interface is then passed to both Test::Unit::TestCase and DataFactory::Base using their set_database_interface methods.

After calling this method, the class instance variable @@db_interface will be available in all sub-classes of Test::Unit::TestCase and can be used for database interactions.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/plsql_unit_test/setup.rb', line 11

def self.connect(user, password, service, host, port)
  interface = SimpleOracleJDBC::Interface.create(user,
                                                 password,
                                                 service,
                                                 host,
                                                 port
                                                 )

  Test::Unit::TestCase.set_database_interface(interface)
  DataFactory::Base.set_database_interface interface
end