0
내가 이런 시험이 있습니다TestNG에서 롤백을 중지하는 방법?
@ContextConfiguration(locations = { "file:war/WEB-INF/application-context.xml" })
public class ServiceImplTest extends AbstractTestNGSpringContextTests
{
@Autowired
private Service service;
@Rollback(false)
@Test
public void testCreate()
{
.....
//save an entity to table_A
service.save(a);
}
}
table_A가 정리됩니다; 이 청소 작업을 중지하는 방법?
각 테스트 후 테이블의 모든 이전 데이터 항목이 사라 지므로 테스트에 의해 삽입 된 항목 만 남기 때문에 처음에는 신경 쓰지 않지만 깨끗한 것 같습니다. –