public class DBSpec extends DbConfiguration implements JSpecSupport
database.properties
file. Test connection transactions work in the following manner:
false
Constructor and Description |
---|
DBSpec() |
Modifier and Type | Method and Description |
---|---|
void |
closeTestConnections() |
void |
loadConfigAndOpenConnections() |
protected void |
openTestConnections() |
boolean |
rollback()
Current state of 'rollback' flag.
|
void |
setLoadConfigFile(boolean loadConfigFile) |
void |
setRollback(boolean rollback)
Set to true in order to rollback a transaction at the end of the test.
|
void |
suppressDb(boolean suppressDb)
Call this method from a constructor of your spec in cases you do not need DB connections.
|
boolean |
suppressedDb() |
addConnectionWrapper, clearConnectionWrappers, clearConnectionWrappers, getConnectionSpecWrappers, getConnectionSpecWrappers, getTestConnectionWrappers, loadConfiguration, resetConnectionWrappers
public boolean suppressedDb()
public void setLoadConfigFile(boolean loadConfigFile)
public void suppressDb(boolean suppressDb)
public boolean rollback()
public void setRollback(boolean rollback)
WARNING: if you set this value to false inside your test, the framework will not clean any remaining data you insert into your test database. Basically, this is a "manual mode" where you are responsible for cleaning after yourself.
rollback
- true to rollback transactions at the end of the test, false to not rollback.public final void loadConfigAndOpenConnections()
protected void openTestConnections()
public final void closeTestConnections()
Copyright © 2016 JavaLite. All rights reserved.