diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-14 23:33:48 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-01-15 18:25:32 +0100 |
commit | 487c103cd245967f6962ef1a84197769abfe0957 (patch) | |
tree | faf78f691085ea6e367873214ecbad78658b8d23 /sonar-core | |
parent | 0e4b58bb419fee422eb1bb873031af4b1ce9ba70 (diff) | |
download | sonarqube-487c103cd245967f6962ef1a84197769abfe0957.tar.gz sonarqube-487c103cd245967f6962ef1a84197769abfe0957.zip |
SONAR-4908 enable extension point RuleDefinitions
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java | 9 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java index 940dcf0c55b..ee0571450d3 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleDao.java @@ -46,13 +46,8 @@ public class RuleDao implements BatchComponent, ServerComponent { } } - public List<RuleDto> selectNonManual() { - SqlSession session = mybatis.openSession(); - try { - return getMapper(session).selectNonManual(); - } finally { - MyBatis.closeQuietly(session); - } + public List<RuleDto> selectNonManual(SqlSession session) { + return getMapper(session).selectNonManual(); } public RuleDto selectById(Integer id, SqlSession session) { diff --git a/sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java b/sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java index 43e0b9ce660..997f4a91f3f 100644 --- a/sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/rule/RuleDaoTest.java @@ -83,7 +83,7 @@ public class RuleDaoTest extends AbstractDaoTestCase { @Test public void testSelectNonManual() throws Exception { setupData("selectNonManual"); - List<RuleDto> ruleDtos = dao.selectNonManual(); + List<RuleDto> ruleDtos = dao.selectNonManual(getMyBatis().openSession()); assertThat(ruleDtos.size()).isEqualTo(1); RuleDto ruleDto = ruleDtos.get(0); |