Code example for AbstractTransactionalTestNGSpringContextTests

0
import static org.testng.Assert.*; 
 
@ContextConfiguration(locations = {"classpath:/org/jtalks/jcommune/model/entity/applicationContext-dao.xml"}) 
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) 
@Transactional 
public class CodeReviewCommentHibernateDaoTest extends AbstractTransactionalTestNGSpringContextTests { 
 
    @Autowired 
    private SessionFactory sessionFactory; 
    @Autowired 
    private Crud<CodeReviewComment> codeReviewCommentDao; 
    private Session session; 
 
    @BeforeMethod 
    public void setUp() throws Exception { 
        session = sessionFactory.getCurrentSession(); 
        PersistedObjectsFactory.setSession(session); 
    } 
     
    /*===== Common methods =====*/