This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

TestNG tests with STS & Maven

Jan 14th, 2012, 06:34 AM

Hi,

I am using testNG, Spring JPA Data Repository and Derby for my integration tests. I need to close and re-open the application context for each test class. So I have used @DirtiesContext on each of my test classes. After making this change my tests are it is working fine in STS. But when I do maven install this is not working fine, debug is saying that the application context is getting closed and re-oped but the tests are failing because the application context chache is not getting cleared and no new application context is getting created.

So by saying "when I do Maven install" you mean you are trying to execute stuff from the command line and that fails for some reason? I am just asking because when using the project within STS you should not need to execute any Maven stuff from command line in parallel to having the project open in STS, you should be able to so everything from within STS.

If your problem is related to the Maven command line execution only, I would recommend to ask the question in the general Spring (testing) forum.