-
Oct 21st, 2009, 12:51 PM
#1
@BeforeClass @AfterClass in the Spring TestingFramework?
Dear All,
I would like to open a database connection once before my test suite runs, and once at the end of the run.
The problem is that the database connection is configured via spring, so
@Autowired
private Connection connection;
@BeforeClass
public void static openConnection()
{
connection.open();
}
doesn't compile; if I use @Before then it runs before every test method. How can I do it using a TestExecutionListener, which does not have an after-class hook?
Thanks so much in advance.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules