aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src
diff options
context:
space:
mode:
authorJulien HENRY <henryju@yahoo.fr>2016-07-04 11:58:10 +0200
committerJulien HENRY <henryju@yahoo.fr>2016-07-05 14:00:16 +0200
commit103f9ca40fe6c4864aa489119c1590e0449f1b9f (patch)
treea990c8be0e88b324307c2e3163559a42b1cfa0ac /sonar-db/src
parentb7fcb4dd974df546cc13faa6be6529ca6bc26688 (diff)
downloadsonarqube-103f9ca40fe6c4864aa489119c1590e0449f1b9f.tar.gz
sonarqube-103f9ca40fe6c4864aa489119c1590e0449f1b9f.zip
SONAR-7727 Remove deprecated stuff from Resources API
Diffstat (limited to 'sonar-db/src')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java5
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml30
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml4
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml8
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml12
7 files changed, 32 insertions, 31 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java
index a8a49a0ac29..da0db73cd1a 100644
--- a/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java
@@ -46,7 +46,7 @@ public class ResourceIndexDao extends AbstractDao {
// Directories and packages are explicitly excluded.
private static final String[] RENAMABLE_QUALIFIERS = {Qualifiers.PROJECT, Qualifiers.MODULE, Qualifiers.VIEW, Qualifiers.SUBVIEW};
private static final String[] RENAMABLE_SCOPES = {Scopes.PROJECT};
- private static final String[] NOT_RENAMABLE_QUALIFIERS = {Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE, Qualifiers.CLASS};
+ private static final String[] NOT_RENAMABLE_QUALIFIERS = {Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE};
private static final String[] NOT_RENAMABLE_SCOPES = {Scopes.FILE};
public ResourceIndexDao(MyBatis myBatis, System2 system2) {
diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
index 43faf115245..36fbe09f697 100644
--- a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
@@ -69,7 +69,7 @@ public class ResourceIndexDaoTest {
}
@Test
- public void shouldNotIndexPackages() {
+ public void shouldNotIndexDirectories() {
dbTester.prepareDbUnit(getClass(), "shouldNotIndexPackages.xml");
underTest.indexProject("ABCD");
diff --git a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
index 6569992d9b1..bf53a27b372 100644
--- a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
@@ -186,8 +186,9 @@ public class SnapshotDaoTest {
assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("ABCD").setSort(BY_DATE, ASC)).get(0).getId()).isEqualTo(1L);
assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("ABCD").setSort(BY_DATE, DESC)).get(0).getId()).isEqualTo(3L);
- assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setScope(Scopes.PROJECT).setQualifier(Qualifiers.PACKAGE))).extracting("id").containsOnly(1L);
- assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setScope(Scopes.DIRECTORY).setQualifier(Qualifiers.PACKAGE))).extracting("id").containsOnly(
+ assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setScope(Scopes.PROJECT).setQualifier(Qualifiers.DIRECTORY))).extracting("id")
+ .containsOnly(1L);
+ assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setScope(Scopes.DIRECTORY).setQualifier(Qualifiers.DIRECTORY))).extracting("id").containsOnly(
2L, 3L, 4L, 5L, 6L);
assertThat(underTest.selectSnapshotsByQuery(db.getSession(), new SnapshotQuery().setComponentUuid("ABCD"))).hasSize(3);
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml
index a21482b3613..b1e6adb30fc 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml
@@ -40,7 +40,7 @@
<projects long_name="org.struts"
id="3"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
kee="org.struts:struts-core:org.struts"
uuid="CDEF"
uuid_path="NOT_USED"
@@ -57,8 +57,8 @@
<projects long_name="org.struts.RequestContext"
id="4"
- scope="CLA"
- qualifier="CLA"
+ scope="FIL"
+ qualifier="FIL"
uuid="DEFG"
uuid_path="NOT_USED"
project_uuid="ABCD"
@@ -106,73 +106,73 @@
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="equestcontext"
position="1"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="questcontext"
position="2"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="uestcontext"
position="3"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="estcontext"
position="4"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="stcontext"
position="5"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="tcontext"
position="6"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="context"
position="7"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="ontext"
position="8"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="ntext"
position="9"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="text"
position="10"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<resource_index kee="ext"
position="11"
name_size="14"
component_uuid="DEFG"
root_component_uuid="ABCD"
- qualifier="CLA"/>
+ qualifier="FIL"/>
<!-- Struts -->
<resource_index kee="struts"
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml
index 69706bb423c..78e69d56ec0 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml
@@ -37,7 +37,7 @@
<projects long_name="org.struts"
id="3"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
kee="org.struts:struts-core:org.struts"
uuid="CDEF"
uuid_path="NOT_USED"
@@ -53,7 +53,7 @@
<projects long_name="org.struts.RequestContext"
id="4"
scope="FIL"
- qualifier="CLA"
+ qualifier="FIL"
uuid="DEFG"
uuid_path="NOT_USED"
project_uuid="ABCD"
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml
index ee07faf3fc8..0e759d63ea9 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml
@@ -21,7 +21,7 @@
<projects long_name="org.struts"
id="2"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
kee="org.struts:struts:org.struts"
uuid="BCDE"
uuid_path="NOT_USED"
@@ -38,7 +38,7 @@
<projects long_name="org.struts.RequestContext"
id="3"
scope="FIL"
- qualifier="CLA"
+ qualifier="FIL"
kee="org.struts:struts:org.struts.RequestContext"
uuid="CDEF"
uuid_path="NOT_USED"
@@ -66,7 +66,7 @@
root_component_uuid="ABCD"
component_uuid="BCDE"
scope="DIR"
- qualifier="PAC"/>
+ qualifier="DIR"/>
<snapshots purge_status="[null]"
id="3"
islast="[true]"
@@ -74,5 +74,5 @@
root_component_uuid="ABCD"
component_uuid="CDEF"
scope="FIL"
- qualifier="CLA"/>
+ qualifier="FIL"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml
index 953c02f906f..1f791dc0b64 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml
@@ -47,7 +47,7 @@
period5_date="1317160800000"
depth="1"
scope="PRJ"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400001"
build_date="1317247200000"
version="2.0-SNAPSHOT"
@@ -78,7 +78,7 @@
period5_date="1317160800000"
depth="1"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400002"
build_date="1317247200000"
version="2.1-SNAPSHOT"
@@ -109,7 +109,7 @@
period5_date="1317160800000"
depth="1"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400003"
build_date="1317247200000"
version="2.2-SNAPSHOT"
@@ -161,7 +161,7 @@
period5_date="1317160800000"
depth="1"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400000"
build_date="1317247200000"
version="2.1-SNAPSHOT"
@@ -193,7 +193,7 @@
period5_date="1317160800000"
depth="1"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400000"
build_date="1317247200000"
version="2.1-SNAPSHOT"
@@ -245,7 +245,7 @@
period5_date="1317160800000"
depth="1"
scope="DIR"
- qualifier="PAC"
+ qualifier="DIR"
created_at="1228172400000"
build_date="1317247200000"
version="2.1-SNAPSHOT"