aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelFinder.java (renamed from sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelProvider.java)10
-rw-r--r--sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelFinderTest.java (renamed from sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelProviderTest.java)16
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/noDefinitionsToRegister-result.xml (renamed from sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/noDefinitionsToRegister-result.xml)0
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/registerOnlyNewDefinitions-result.xml (renamed from sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/registerOnlyNewDefinitions-result.xml)0
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/reset-result.xml (renamed from sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/reset-result.xml)0
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/shared.xml (renamed from sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/shared.xml)0
6 files changed, 13 insertions, 13 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelProvider.java b/sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelFinder.java
index 7f8f561bc97..11d20a2ad74 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelProvider.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualitymodel/DefaultModelFinder.java
@@ -24,27 +24,27 @@ import org.slf4j.LoggerFactory;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.qualitymodel.Model;
import org.sonar.api.qualitymodel.ModelDefinition;
-import org.sonar.api.qualitymodel.ModelProvider;
+import org.sonar.api.qualitymodel.ModelFinder;
import org.sonar.api.utils.Logs;
import org.sonar.api.utils.SonarException;
import org.sonar.jpa.session.DatabaseSessionFactory;
import javax.persistence.Query;
-public class DefaultModelProvider implements ModelProvider {
+public class DefaultModelFinder implements ModelFinder {
private ModelDefinition[] definitions;
private DatabaseSessionFactory sessionFactory;
- public DefaultModelProvider(DatabaseSessionFactory sessionFactory, ModelDefinition[] definitions) {
+ public DefaultModelFinder(DatabaseSessionFactory sessionFactory, ModelDefinition[] definitions) {
this.sessionFactory = sessionFactory;
this.definitions = definitions;
}
/**
- * this constructor is used when there are no templates
+ * This constructor is used when there are no templates
*/
- public DefaultModelProvider(DatabaseSessionFactory sessionFactory) {
+ public DefaultModelFinder(DatabaseSessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
this.definitions = new ModelDefinition[0];
}
diff --git a/sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelProviderTest.java b/sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelFinderTest.java
index beb59782327..1808348c376 100644
--- a/sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelProviderTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/qualitymodel/DefaultModelFinderTest.java
@@ -30,12 +30,12 @@ import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
-public class DefaultModelProviderTest extends AbstractDbUnitTestCase {
+public class DefaultModelFinderTest extends AbstractDbUnitTestCase {
@Test
public void reset() {
setupData("shared");
- DefaultModelProvider provider = new DefaultModelProvider(getSessionFactory());
+ DefaultModelFinder provider = new DefaultModelFinder(getSessionFactory());
Model model = Model.createByName("M1");
Characteristic c1 = model.createCharacteristicByName("NEWM1C1");
@@ -55,7 +55,7 @@ public class DefaultModelProviderTest extends AbstractDbUnitTestCase {
@Test
public void findByName() {
setupData("shared");
- DefaultModelProvider provider = new DefaultModelProvider(getSessionFactory());
+ DefaultModelFinder provider = new DefaultModelFinder(getSessionFactory());
Model model = provider.findByName("M1");
assertNotNull(model);
assertNotNull(model.getCharacteristicByName("M1C1"));
@@ -64,14 +64,14 @@ public class DefaultModelProviderTest extends AbstractDbUnitTestCase {
@Test
public void findByNameNotFound() {
setupData("shared");
- DefaultModelProvider provider = new DefaultModelProvider(getSessionFactory());
+ DefaultModelFinder provider = new DefaultModelFinder(getSessionFactory());
assertNull(provider.findByName("UNKNOWN"));
}
@Test
public void noDefinitionsToRegister() {
setupData("shared");
- DefaultModelProvider provider = new DefaultModelProvider(getSessionFactory());
+ DefaultModelFinder provider = new DefaultModelFinder(getSessionFactory());
provider.registerDefinitions();
// same state
@@ -87,7 +87,7 @@ public class DefaultModelProviderTest extends AbstractDbUnitTestCase {
ModelDefinition newDefinition = new FakeDefinition("NEWMODEL");
ModelDefinition[] definitions = new ModelDefinition[]{existingDefinition, newDefinition};
- DefaultModelProvider provider = new DefaultModelProvider(getSessionFactory(), definitions);
+ DefaultModelFinder provider = new DefaultModelFinder(getSessionFactory(), definitions);
provider.registerDefinitions();
List<Model> models = getSession().getResults(Model.class);
@@ -97,13 +97,13 @@ public class DefaultModelProviderTest extends AbstractDbUnitTestCase {
@Test
public void exists() {
setupData("shared");
- assertTrue(DefaultModelProvider.exists(getSession(), "M1"));
+ assertTrue(DefaultModelFinder.exists(getSession(), "M1"));
}
@Test
public void notExists() {
setupData("shared");
- assertFalse(DefaultModelProvider.exists(getSession(), "UNKNOWN"));
+ assertFalse(DefaultModelFinder.exists(getSession(), "UNKNOWN"));
}
}
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/noDefinitionsToRegister-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/noDefinitionsToRegister-result.xml
index e1f6a9edc04..e1f6a9edc04 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/noDefinitionsToRegister-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/noDefinitionsToRegister-result.xml
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/registerOnlyNewDefinitions-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/registerOnlyNewDefinitions-result.xml
index a33aec7b5e5..a33aec7b5e5 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/registerOnlyNewDefinitions-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/registerOnlyNewDefinitions-result.xml
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/reset-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/reset-result.xml
index 4eaeb3441d9..4eaeb3441d9 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/reset-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/reset-result.xml
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/shared.xml
index e1f6a9edc04..e1f6a9edc04 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelProviderTest/shared.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualitymodel/DefaultModelFinderTest/shared.xml