public class TemporaryDatabaseExecutionListener
extends org.springframework.test.context.support.AbstractTestExecutionListener
TestExecutionListener
creates a temporary database and then
registers it as the default datasource inside DataSourceFactory
by
using DataSourceFactory.setInstance(DataSource)
.
To change the settings for the temporary database, use the
JUnitTemporaryDatabase
annotation on the test class or method.Constructor and Description |
---|
TemporaryDatabaseExecutionListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterTestClass(org.springframework.test.context.TestContext testContext) |
void |
afterTestMethod(org.springframework.test.context.TestContext testContext) |
void |
beforeTestClass(org.springframework.test.context.TestContext testContext) |
void |
beforeTestMethod(org.springframework.test.context.TestContext testContext) |
void |
prepareTestInstance(org.springframework.test.context.TestContext testContext) |
public void afterTestMethod(org.springframework.test.context.TestContext testContext) throws Exception
afterTestMethod
in interface org.springframework.test.context.TestExecutionListener
afterTestMethod
in class org.springframework.test.context.support.AbstractTestExecutionListener
Exception
public void afterTestClass(org.springframework.test.context.TestContext testContext) throws Exception
afterTestClass
in interface org.springframework.test.context.TestExecutionListener
afterTestClass
in class org.springframework.test.context.support.AbstractTestExecutionListener
Exception
public void beforeTestMethod(org.springframework.test.context.TestContext testContext) throws Exception
beforeTestMethod
in interface org.springframework.test.context.TestExecutionListener
beforeTestMethod
in class org.springframework.test.context.support.AbstractTestExecutionListener
Exception
public void beforeTestClass(org.springframework.test.context.TestContext testContext) throws Exception
beforeTestClass
in interface org.springframework.test.context.TestExecutionListener
beforeTestClass
in class org.springframework.test.context.support.AbstractTestExecutionListener
Exception
public void prepareTestInstance(org.springframework.test.context.TestContext testContext) throws Exception
prepareTestInstance
in interface org.springframework.test.context.TestExecutionListener
prepareTestInstance
in class org.springframework.test.context.support.AbstractTestExecutionListener
Exception
Copyright © 2016. All rights reserved.