Package org.javalite.activeweb
Class DBIntegrationSpec
java.lang.Object
org.javalite.activeweb.SpecHelper
org.javalite.activeweb.RequestSpecHelper
org.javalite.activeweb.IntegrationSpec
org.javalite.activeweb.DBIntegrationSpec
- All Implemented Interfaces:
JSpecSupport
Use this as a super class for integration tests that requires a DB connection
to the test DB.
- Author:
- Igor Polevoy
-
Nested Class Summary
Nested classes/interfaces inherited from class org.javalite.activeweb.SpecHelper
SpecHelper.DynamicBuilder, SpecHelper.ModuleBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
static void
void
boolean
rollback()
Current state of 'rollback' flag.void
setRollback(boolean rollback)
Set to true in order to rollback a transaction at the end of the test (default is true).Methods inherited from class org.javalite.activeweb.IntegrationSpec
addFilter, addFilter, controller, resetFilters, setTemplateLocation
Methods inherited from class org.javalite.activeweb.RequestSpecHelper
assigns, atStart00, bytesContent, contentType, cookie, cookieValue, count, getCookies, header, headerNames, headers, layout, redirected, redirectValue, responseContent, responseJSONList, responseJSONMap, statusCode, template, text, val, val, valBoolean, valDouble, valFloat, valInteger, valLong, vals, valString
Methods inherited from class org.javalite.activeweb.SpecHelper
afterEnd, atStart, createInjector, flash, flash, flashExists, injector, registerTag, session, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setInjector
-
Constructor Details
-
DBIntegrationSpec
public DBIntegrationSpec()
-
-
Method Details
-
setRollback
public void setRollback(boolean rollback)Set to true in order to rollback a transaction at the end of the test (default is true). This method will set theautocommit = !rollback
on all connections found on this thread.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.
- Parameters:
rollback
- true to rollback transactions at the end of the test, false to not rollback.
-
rollback
public boolean rollback()Current state of 'rollback' flag.- Returns:
- Current state of 'rollback' flag.
-
initDBConfig
@BeforeAll public static void initDBConfig() -
openTestConnections
@BeforeEach public final void openTestConnections() -
closeTestConnections
@AfterEach public void closeTestConnections() -
clearConnectionConfigs
@AfterAll public static void clearConnectionConfigs()
-