public class ActionPlanDaoTest extends AbstractDaoTestCase {
- private ActionPlanDao dao;
+ ActionPlanDao dao;
@Before
public void createDao() {
public class ActionPlanStatsDaoTest extends AbstractDaoTestCase {
- private ActionPlanStatsDao dao;
+ ActionPlanStatsDao dao;
@Before
public void createDao() {
import org.sonar.api.issue.internal.FieldDiffs;
import org.sonar.api.utils.DateUtils;
import org.sonar.core.persistence.AbstractDaoTestCase;
+import org.sonar.core.persistence.MyBatis;
import java.util.Arrays;
import java.util.Collections;
SqlSession session = getMyBatis().openSession();
List<DefaultIssueComment> comments = dao.selectCommentsByIssues(session, Arrays.asList("1000"));
- session.close();
+ MyBatis.closeQuietly(session);
assertThat(comments).hasSize(2);
// chronological order
package org.sonar.core.issue.db;
import org.apache.ibatis.session.SqlSession;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.utils.DateUtils;
import org.sonar.core.persistence.AbstractDaoTestCase;
+import org.sonar.core.persistence.MyBatis;
import java.util.Date;
mapper = session.getMapper(IssueChangeMapper.class);
}
+ @After
+ public void tearDown() {
+ MyBatis.closeQuietly(session);
+ }
+
@Test
public void insert_diff() throws Exception {
IssueChangeDto dto = new IssueChangeDto();
package org.sonar.core.issue.db;
import org.apache.ibatis.session.SqlSession;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.utils.DateUtils;
import org.sonar.core.persistence.AbstractDaoTestCase;
-
-import java.util.Date;
+import org.sonar.core.persistence.MyBatis;
import static org.fest.assertions.Assertions.assertThat;
mapper = session.getMapper(IssueMapper.class);
}
+ @After
+ public void tearDown() {
+ MyBatis.closeQuietly(session);
+ }
+
@Test
public void testInsert() throws Exception {
IssueDto dto = new IssueDto();