Class jala.Test.DatabaseMgr
Object
|
+--jala.Test.DatabaseMgr
- class
jala.Test.DatabaseMgr
Instances of this class allow managing test databases
and switching a running application to an in-memory test
database to use within a unit test.
Defined in Global/jala.Test.js
|
Field Summary |
Object |
databases
Map containing all test databases |
Object |
dbSourceProperties
Map containing the original datasource
properties that were temporarily deactivated
by activating a test database |
|
Method Summary |
jala.db.RamDatabase
|
startDatabase(<String> dbSourceName, <Boolean> copyTables)
Switches the application datasource with the given name
to a newly created in-memory database.
|
void
|
stopAll()
Stops all registered test databases and and reverts the application
to its original datasource(s) as defined in db.properties file.
|
databases
Object databases
Map containing all test databases
dbSourceProperties
Object dbSourceProperties
Map containing the original datasource
properties that were temporarily deactivated
by activating a test database
jala.Test.DatabaseMgr
jala.Test.DatabaseMgr()
Returns a newly created DatabaseMgr instance
Returns:
A newly created instance of DatabaseMgr
startDatabase
jala.db.RamDatabase startDatabase(<String> dbSourceName, <Boolean> copyTables)
Switches the application datasource with the given name
to a newly created in-memory database. In addition this method
also clears the application cache and invalidates the root
object to ensure that everything is re-retrieved from the
test database.
Parameters:
dbSourceName - The name of the application database source as defined in db.properties
copyTables - If true this method also copies all tables in the source database to the test database (excluding indexes).
stopAll
void stopAll()
Stops all registered test databases and and reverts the application
to its original datasource(s) as defined in db.properties file.
In addition this method commits all pending changes within the request,
cleares the application cache and invalidates the root object
to ensure no traces of the test database are left behind.
Documentation generated by
JSDoc on Thu Mar 15 14:24:11 2007