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.