public abstract class AbstractPdoTest extends Object implements DomainContextProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractPdoTest.TransactionType
The transaction handling for the test class.
|
| Constructor and Description |
|---|
AbstractPdoTest()
Creates a test with rollback and one transaction per class.
|
AbstractPdoTest(AbstractPdoTest.TransactionType txType)
Creates a test with rollback.
|
AbstractPdoTest(AbstractPdoTest.TransactionType txType,
boolean commit)
Creates a test.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterClass()
Ends the transaction if type is
AbstractPdoTest.TransactionType.CLASS. |
void |
afterMethod()
Ends the transaction if type is
AbstractPdoTest.TransactionType.METHOD. |
void |
beforeClass()
Begins the transaction if type is
AbstractPdoTest.TransactionType.CLASS. |
void |
beforeMethod()
Begins the transaction if type is
AbstractPdoTest.TransactionType.METHOD. |
protected void |
beginTransaction()
Begins a transaction.
|
void |
closeSessionsAndTerminateModificationTracker()
Terminates the modification tracker and closes the sessions.
|
protected DomainContext |
createDomainContext()
Creates the domain context.
|
protected void |
endTransaction()
Commits or rolls back a transaction.
|
DomainContext |
getDomainContext()
Gets the domain context.
|
org.tentackle.session.Session |
getSession()
Gets the session.
|
boolean |
isCommit()
Returns whether the transaction should be commit or rolled back.
|
protected org.tentackle.session.Session |
openSession()
Opens the session.
|
void |
openSessionsAndStartModificationTracker()
Opens the sessions and starts the modification tracker.
|
static Process |
runClass(Class<?> testClass,
String... args)
Runs the given class in another JVM and waits for termination.
The testclass must have a main method. |
int |
runInOtherJVM(Class<?> testClass)
Runs the given class in another JVM.
The testclass must have a main method. |
static void |
waitForProcess(Process process)
Waits for process to terminate and write stdout and stderr to the reporter log.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waiton, oppublic AbstractPdoTest(AbstractPdoTest.TransactionType txType, boolean commit)
txType - the transaction typecommit - true if commit transaction, else rollback (default for regular tests)public AbstractPdoTest(AbstractPdoTest.TransactionType txType)
txType - the transaction typepublic AbstractPdoTest()
public void openSessionsAndStartModificationTracker()
throws Exception
Exception - if failedpublic void closeSessionsAndTerminateModificationTracker()
throws Exception
Exception - if failedpublic void beforeClass()
throws Exception
AbstractPdoTest.TransactionType.CLASS.Exception - if failedpublic void afterClass()
throws Exception
AbstractPdoTest.TransactionType.CLASS.Exception - if failedpublic void beforeMethod()
throws Exception
AbstractPdoTest.TransactionType.METHOD.Exception - if failedpublic void afterMethod()
throws Exception
AbstractPdoTest.TransactionType.METHOD.Exception - if failedpublic org.tentackle.session.Session getSession()
public boolean isCommit()
public DomainContext getDomainContext()
getDomainContext in interface DomainContextProviderpublic int runInOtherJVM(Class<?> testClass) throws IOException
testClass - the test classIOException - if some IO operation failedprotected org.tentackle.session.Session openSession()
protected DomainContext createDomainContext()
protected void beginTransaction()
protected void endTransaction()
public static Process runClass(Class<?> testClass, String... args) throws IOException
testClass - the test classargs - optional argumentsIOException - if some IO operation failedpublic static void waitForProcess(Process process) throws IOException
process - the processIOException - if some IO failedTentackle - distributed, domain- and model-driven