]> source.dussan.org Git - sonarqube.git/commitdiff
start-mac.sh and stop-mac.sh are renamed start/stop.sh as they support linux
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 6 May 2014 07:14:47 +0000 (09:14 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 6 May 2014 07:32:42 +0000 (09:32 +0200)
sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java
sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
start-mac.sh [deleted file]
start.sh [new file with mode: 0755]
stop-mac.sh [deleted file]
stop.sh [new file with mode: 0755]

index 6cf13c12131886337628e894a0b9050e0c9e2e3a..6c0ef81c719ec7441270f16a1972dc01188438ce 100644 (file)
@@ -30,7 +30,6 @@ import com.google.common.collect.Multimap;
 import com.google.common.collect.Sets;
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.ibatis.session.SqlSession;
 import org.picocontainer.Startable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,7 +44,7 @@ import org.sonar.check.Cardinality;
 import org.sonar.core.persistence.DbSession;
 import org.sonar.core.persistence.MyBatis;
 import org.sonar.core.qualityprofile.db.ActiveRuleDao;
-import org.sonar.core.rule.RuleDao;
+import org.sonar.server.rule2.RuleDao;
 import org.sonar.core.rule.RuleDto;
 import org.sonar.core.rule.RuleParamDto;
 import org.sonar.core.rule.RuleRuleTagDto;
@@ -142,7 +141,7 @@ public class RegisterRules implements Startable {
     // nothing
   }
 
-  private void selectRulesFromDb(Buffer buffer, SqlSession sqlSession) {
+  private void selectRulesFromDb(Buffer buffer, DbSession sqlSession) {
     for (RuleDto ruleDto : ruleDao.selectNonManual(sqlSession)) {
       buffer.add(ruleDto);
       buffer.markUnprocessed(ruleDto);
@@ -322,7 +321,7 @@ public class RegisterRules implements Startable {
     return changed;
   }
 
-  private void mergeParams(Buffer buffer, SqlSession sqlSession, RulesDefinition.Rule ruleDef, RuleDto dto) {
+  private void mergeParams(Buffer buffer, DbSession sqlSession, RulesDefinition.Rule ruleDef, RuleDto dto) {
     Collection<RuleParamDto> paramDtos = buffer.paramsForRuleId(dto.getId());
     Set<String> persistedParamKeys = Sets.newHashSet();
     for (RuleParamDto paramDto : paramDtos) {
@@ -370,7 +369,7 @@ public class RegisterRules implements Startable {
     return changed;
   }
 
-  private void mergeTags(Buffer buffer, SqlSession sqlSession, RulesDefinition.Rule ruleDef, RuleDto dto) {
+  private void mergeTags(Buffer buffer, DbSession sqlSession, RulesDefinition.Rule ruleDef, RuleDto dto) {
     Set<String> existingSystemTags = Sets.newHashSet();
 
     Collection<RuleRuleTagDto> tagDtos = ImmutableList.copyOf(buffer.tagsForRuleId(dto.getId()));
@@ -412,7 +411,7 @@ public class RegisterRules implements Startable {
     }
   }
 
-  private long getOrCreateReferenceTagId(Buffer buffer, String tag, SqlSession sqlSession) {
+  private long getOrCreateReferenceTagId(Buffer buffer, String tag, DbSession sqlSession) {
     // End-user tag is converted to system tag
     long tagId = 0L;
     if (buffer.referenceTagExists(tag)) {
@@ -494,7 +493,7 @@ public class RegisterRules implements Startable {
     }
   }
 
-  private void index(Buffer buffer, SqlSession sqlSession) {
+  private void index(Buffer buffer, DbSession sqlSession) {
     String[] ids = ruleRegistry.reindex(buffer.rulesById.values(), sqlSession);
     ruleRegistry.removeDeletedRules(ids);
     esRuleTags.putAllTags(buffer.referenceTagsByTagValue.values());
index dc73ed3c678fba503b5956a77e3add6babdc053f..9de7e55d24a6709491d9045856ede481b2f3e923 100644 (file)
@@ -38,7 +38,7 @@ import org.sonar.core.cluster.WorkQueue;
 import org.sonar.core.persistence.AbstractDaoTestCase;
 import org.sonar.core.persistence.MyBatis;
 import org.sonar.core.qualityprofile.db.ActiveRuleDao;
-import org.sonar.core.rule.RuleDao;
+import org.sonar.server.rule2.RuleDao;
 import org.sonar.core.rule.RuleDto;
 import org.sonar.core.rule.RuleTagDao;
 import org.sonar.core.rule.RuleTagDto;
@@ -296,7 +296,7 @@ public class RegisterRulesTest extends AbstractDaoTestCase {
     // There is already one rule in DB
     assertThat(ruleDao.selectAll()).hasSize(BigRepository.SIZE + 1);
     assertThat(ruleDao.selectParameters()).hasSize(BigRepository.SIZE * 20);
-    assertThat(ruleDao.selectTags(getMyBatis().openSession())).hasSize(BigRepository.SIZE * 3);
+    assertThat(ruleDao.selectTags(getMyBatis().openSession(false))).hasSize(BigRepository.SIZE * 3);
   }
 
   @Test
diff --git a/start-mac.sh b/start-mac.sh
deleted file mode 100755 (executable)
index 2b4f1d3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if [[ "$OSTYPE" == "darwin"* ]]; then
-  OS='macosx-universal-64'
-else
-  OS='linux-x86-64'
-fi
-
-if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
-  echo 'Sources are not built'
-  ./build.sh
-fi
-
-cd sonar-application/target/
-if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
-  unzip sonarqube-*.zip
-fi
-cd sonarqube-*
-bin/$OS/sonar.sh restart
-sleep 1
-tail -100f logs/sonar.log
diff --git a/start.sh b/start.sh
new file mode 100755 (executable)
index 0000000..2b4f1d3
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [[ "$OSTYPE" == "darwin"* ]]; then
+  OS='macosx-universal-64'
+else
+  OS='linux-x86-64'
+fi
+
+if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
+  echo 'Sources are not built'
+  ./build.sh
+fi
+
+cd sonar-application/target/
+if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
+  unzip sonarqube-*.zip
+fi
+cd sonarqube-*
+bin/$OS/sonar.sh restart
+sleep 1
+tail -100f logs/sonar.log
diff --git a/stop-mac.sh b/stop-mac.sh
deleted file mode 100755 (executable)
index cb1fdb4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-# Shortcut to stop server. It must be already built.
-
-sh sonar-application/target/sonarqube-*/bin/macosx-universal-64/sonar.sh stop
diff --git a/stop.sh b/stop.sh
new file mode 100755 (executable)
index 0000000..cb1fdb4
--- /dev/null
+++ b/stop.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Shortcut to stop server. It must be already built.
+
+sh sonar-application/target/sonarqube-*/bin/macosx-universal-64/sonar.sh stop