Hello,
I'm new on Java programming and also on nonSQL database... hope you can give me some support.
I have a group of testcases where every time that a test is executed the database has to be connected again, which lets my tests very slow.
Example:
public class AllTests {
. public static Test suite() throws IOException {
TestSuite suite = new TestSuite();
suite.addTestSuite(NumberTest.class); suite.addTestSuite(LetterTest.class); suite.addTestSuite(ImageTest.class); ... } }
In the example above, NumberTest.class, LetterTest.class and ImageTest.class are tests made for some interfaces that use the same document from the database. However, each one of them finish (NumberTest and LetterTest), I have to connect to the database again.
I'm not "closing" it in any place, only opening.
So, why is this being closed every time that a new test is executed?
Is there any way to keep the db connection opened during all the tests and close it only in the end?
Any idea or tip will be helpful.
Thanks,
Karina.