]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1711 temporarily log warnings instead of throwing an exception when saving...
authorsimonbrandhof <simon.brandhof@gmail.com>
Mon, 27 Sep 2010 14:52:10 +0000 (14:52 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Mon, 27 Sep 2010 14:52:10 +0000 (14:52 +0000)
sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java
sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java

index e6c2c21cd7b72ad70dc327ec4b43a2cfd85ec350..14b6f015d4a61b4f5ab75ab9fa15ed0a30723a03 100644 (file)
@@ -177,8 +177,8 @@ public class DefaultSonarIndex extends SonarIndex {
       return bucket;
     }
 
-    if (mustExist && lock.isLocked() && !ResourceUtils.isLibrary(resource)) {
-      throw new SonarException("The following resource has not been registered before saving violation/measure/event: " + resource);
+    if (mustExist && lock.isLocked() && !ResourceUtils.isLibrary(resource)) { 
+      LOG.warn("The following resource has not been registered before saving violation/measure/event: " + resource);
     }
 
     prepareResource(resource);
index c818de86ad5984636038d49dbdf4d317f7360706..4e2387319d088b389e777db95cad15d24807deac 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.batch.indexer;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.Measure;
@@ -60,6 +61,7 @@ public class DefaultSonarIndexTest extends AbstractDbUnitTestCase {
   }
 
   @Test(expected = SonarException.class)
+  @Ignore("Temporarily log warnings instead of throwing an exception")
   public void failIfLockedAndAddingMeasureOnUnknownResource() {
     DefaultResourceCreationLock lock = new DefaultResourceCreationLock();
     lock.lock();