// SONAR-7681 a public implementation of List must be used in MyBatis - potential concurrency exceptions otherwise
@CheckForNull
private final ArrayList<String> qualifiers;
+ @CheckForNull
+ private final ArrayList<String> scopes;
private final String baseUuid;
private final Strategy strategy;
private ComponentTreeQuery(Builder builder) {
this.nameOrKeyQuery = builder.nameOrKeyQuery;
this.qualifiers = builder.qualifiers == null ? null : newArrayList(builder.qualifiers);
+ this.scopes = builder.scopes == null ? null : newArrayList(builder.scopes);
this.baseUuid = builder.baseUuid;
this.strategy = requireNonNull(builder.strategy);
}
return qualifiers;
}
+ @CheckForNull
+ public Collection<String> getScopes() {
+ return scopes;
+ }
+
@CheckForNull
public String getNameOrKeyQuery() {
return nameOrKeyQuery;
private String nameOrKeyQuery;
@CheckForNull
private Collection<String> qualifiers;
+ @CheckForNull
+ private Collection<String> scopes;
private String baseUuid;
private Strategy strategy;
return this;
}
+ public Builder setScopes(Collection<String> scopes) {
+ this.scopes = scopes;
+ return this;
+ }
+
public Builder setBaseUuid(String uuid) {
this.baseUuid = uuid;
return this;
import org.sonar.api.utils.System2;
import org.sonar.core.config.PurgeConstants;
+import static java.util.Arrays.asList;
+import static java.util.Collections.singletonList;
+
public class PurgeConfiguration {
private final IdUuidPair rootProjectIdUuid;
- private final String[] scopesWithoutHistoricalData;
+ private final Collection<String> scopesWithoutHistoricalData;
private final int maxAgeInDaysOfClosedIssues;
private final Optional<Integer> maxAgeInDaysOfInactiveShortLivingBranches;
private final System2 system2;
private final Collection<String> disabledComponentUuids;
- public PurgeConfiguration(IdUuidPair rootProjectId, String[] scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues,
+ public PurgeConfiguration(IdUuidPair rootProjectId, Collection<String> scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues,
Optional<Integer> maxAgeInDaysOfInactiveShortLivingBranches, System2 system2, Collection<String> disabledComponentUuids) {
this.rootProjectIdUuid = rootProjectId;
this.scopesWithoutHistoricalData = scopesWithoutHistoricalData;
}
public static PurgeConfiguration newDefaultPurgeConfiguration(Configuration config, IdUuidPair idUuidPair, Collection<String> disabledComponentUuids) {
- String[] scopes = new String[] {Scopes.FILE};
+ Collection<String> scopesWithoutHistoricalData = singletonList(Scopes.FILE);
if (config.getBoolean(PurgeConstants.PROPERTY_CLEAN_DIRECTORY).orElse(false)) {
- scopes = new String[] {Scopes.DIRECTORY, Scopes.FILE};
+ scopesWithoutHistoricalData = asList(Scopes.FILE, Scopes.DIRECTORY);
}
- return new PurgeConfiguration(idUuidPair, scopes, config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES).get(),
+ return new PurgeConfiguration(idUuidPair, scopesWithoutHistoricalData, config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES).get(),
config.getInt(PurgeConstants.DAYS_BEFORE_DELETING_INACTIVE_SHORT_LIVING_BRANCHES), System2.INSTANCE, disabledComponentUuids);
}
return rootProjectIdUuid;
}
- public String[] scopesWithoutHistoricalData() {
+ public Collection<String> getScopesWithoutHistoricalData() {
return scopesWithoutHistoricalData;
}
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
PurgeCommands commands = new PurgeCommands(session, mapper, profiler);
String rootUuid = conf.rootProjectIdUuid().getUuid();
deleteAbortedAnalyses(rootUuid, commands);
- deleteDataOfComponentsWithoutHistoricalData(session, rootUuid, conf.scopesWithoutHistoricalData(), commands);
+ deleteDataOfComponentsWithoutHistoricalData(session, rootUuid, conf.getScopesWithoutHistoricalData(), commands);
purgeAnalyses(commands, rootUuid);
purgeDisabledComponents(session, conf, listener);
deleteOldClosedIssues(conf, mapper, listener);
commands.deleteAnalyses(query);
}
- private void deleteDataOfComponentsWithoutHistoricalData(DbSession dbSession, String rootUuid, String[] scopesWithoutHistoricalData, PurgeCommands purgeCommands) {
- if (scopesWithoutHistoricalData.length == 0) {
+ private void deleteDataOfComponentsWithoutHistoricalData(DbSession dbSession, String rootUuid, Collection<String> scopesWithoutHistoricalData, PurgeCommands purgeCommands) {
+ if (scopesWithoutHistoricalData.isEmpty()) {
return;
}
dbSession,
ComponentTreeQuery.builder()
.setBaseUuid(rootUuid)
- .setQualifiers(Arrays.asList(scopesWithoutHistoricalData))
+ .setScopes(scopesWithoutHistoricalData)
.setStrategy(Strategy.LEAVES)
.build())
.stream().map(ComponentDto::uuid)
#{qualifier,jdbcType=VARCHAR}
</foreach>
</if>
+ <if test="query.scopes != null">
+ and p.scope in
+ <foreach collection="query.scopes" item="scope" open="(" close=")" separator=",">
+ #{scope,jdbcType=VARCHAR}
+ </foreach>
+ </if>
<if test="query.nameOrKeyQuery != null">
and (
p.kee = #{query.nameOrKeyQuery,jdbcType=VARCHAR}
and pm.person_id is null
</otherwise>
</choose>
- <include refid="org.sonar.db.component.ComponentMapper.selectDescendantsFilters"/>
+ and p.enabled = ${_true}
+ <if test="query.qualifiers != null">
+ and p.qualifier in
+ <foreach collection="query.qualifiers" item="qualifier" open="(" close=")" separator=",">
+ #{qualifier,jdbcType=VARCHAR}
+ </foreach>
+ </if>
+ <if test="query.nameOrKeyQuery != null">
+ and (
+ p.kee = #{query.nameOrKeyQuery,jdbcType=VARCHAR}
+ or
+ upper(p.name) like #{query.nameOrKeyUpperLikeQuery,jdbcType=VARCHAR} escape '/'
+ )
+ </if>
</sql>
<select id="selectPastMeasuresOnSingleAnalysis" parameterType="map" resultType="org.sonar.db.measure.PastMeasureDto">
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
+import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
}
@Test
- public void select_descendants_with_children_stragegy() {
+ public void select_descendants_with_children_strategy() {
// project has 2 children: module and file 1. Other files are part of module.
ComponentDto project = newPrivateProjectDto(db.organizations().insert(), PROJECT_UUID);
db.components().insertProjectAndSnapshot(project);
ComponentDto module = newModuleDto(MODULE_UUID, project);
db.components().insertComponent(module);
- ComponentDto file1 = newFileDto(project, null, FILE_1_UUID).setDbKey("file-key-1").setName("File One");
- db.components().insertComponent(file1);
- ComponentDto file2 = newFileDto(module, null, FILE_2_UUID).setDbKey("file-key-2").setName("File Two");
- db.components().insertComponent(file2);
- ComponentDto file3 = newFileDto(module, null, FILE_3_UUID).setDbKey("file-key-3").setName("File Three");
- db.components().insertComponent(file3);
+ ComponentDto fileInProject = newFileDto(project, null, FILE_1_UUID).setDbKey("file-key-1").setName("File One");
+ db.components().insertComponent(fileInProject);
+ ComponentDto file1InModule = newFileDto(module, null, FILE_2_UUID).setDbKey("file-key-2").setName("File Two");
+ db.components().insertComponent(file1InModule);
+ ComponentDto file2InModule = newFileDto(module, null, FILE_3_UUID).setDbKey("file-key-3").setName("File Three");
+ db.components().insertComponent(file2InModule);
db.commit();
// test children of root
// test children of leaf component (file here), matching name
query = newTreeQuery(FILE_1_UUID).setNameOrKeyQuery("Foo").build();
assertThat(underTest.selectDescendants(dbSession, query)).isEmpty();
+
+ // test filtering by scope
+ query = newTreeQuery(project.uuid()).setScopes(asList(Scopes.FILE)).build();
+ assertThat(underTest.selectDescendants(dbSession, query))
+ .extracting(ComponentDto::uuid)
+ .containsExactlyInAnyOrder(fileInProject.uuid());
+ query = newTreeQuery(project.uuid()).setScopes(asList(Scopes.PROJECT)).build();
+ assertThat(underTest.selectDescendants(dbSession, query))
+ .extracting(ComponentDto::uuid)
+ .containsExactlyInAnyOrder(module.uuid());
}
@Test
*/
package org.sonar.db.purge;
-import java.util.Collections;
import java.util.Date;
import java.util.Optional;
import org.junit.Test;
import org.sonar.core.config.PurgeConstants;
import org.sonar.core.config.PurgeProperties;
+import static java.util.Collections.emptyList;
import static org.assertj.core.api.Assertions.assertThat;
public class PurgeConfigurationTest {
@Test
public void should_delete_all_closed_issues() {
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 0, Optional.empty(), System2.INSTANCE, Collections.emptyList());
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), emptyList(), 0, Optional.empty(), System2.INSTANCE, emptyList());
assertThat(conf.maxLiveDateOfClosedIssues()).isNull();
- conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], -1, Optional.empty(), System2.INSTANCE, Collections.emptyList());
+ conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), emptyList(), -1, Optional.empty(), System2.INSTANCE, emptyList());
assertThat(conf.maxLiveDateOfClosedIssues()).isNull();
}
public void should_delete_only_old_closed_issues() {
Date now = DateUtils.parseDate("2013-05-18");
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30, Optional.empty(), System2.INSTANCE, Collections.emptyList());
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), emptyList(), 30, Optional.empty(), System2.INSTANCE, emptyList());
Date toDate = conf.maxLiveDateOfClosedIssues(now);
assertThat(toDate.getYear()).isEqualTo(113);// =2013
@Test
public void should_have_empty_branch_purge_date() {
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30, Optional.of(10), System2.INSTANCE, Collections.emptyList());
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), emptyList(), 30, Optional.of(10), System2.INSTANCE, emptyList());
assertThat(conf.maxLiveDateOfInactiveShortLivingBranches()).isNotEmpty();
long tenDaysAgo = DateUtils.addDays(new Date(System2.INSTANCE.now()), -10).getTime();
assertThat(conf.maxLiveDateOfInactiveShortLivingBranches().get().getTime()).isBetween(tenDaysAgo - 5000, tenDaysAgo + 5000);
@Test
public void should_calculate_branch_purge_date() {
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30, Optional.empty(), System2.INSTANCE, Collections.emptyList());
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), emptyList(), 30, Optional.empty(), System2.INSTANCE, emptyList());
assertThat(conf.maxLiveDateOfInactiveShortLivingBranches()).isEmpty();
}
@Test
- public void do_not_delete_directory_by_default() {
+ public void delete_files_but_not_directories_by_default() {
MapSettings settings = new MapSettings(new PropertyDefinitions(PurgeProperties.all()));
settings.setProperty(PurgeConstants.PROPERTY_CLEAN_DIRECTORY, false);
settings.setProperty(PurgeConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES, 5);
Date now = new Date();
- PurgeConfiguration underTest = PurgeConfiguration.newDefaultPurgeConfiguration(settings.asConfig(), new IdUuidPair(42L, "any-uuid"), Collections.emptyList());
+ PurgeConfiguration underTest = PurgeConfiguration.newDefaultPurgeConfiguration(settings.asConfig(), new IdUuidPair(42L, "any-uuid"), emptyList());
- assertThat(underTest.scopesWithoutHistoricalData()).contains(Scopes.FILE)
- .doesNotContain(Scopes.DIRECTORY);
+ assertThat(underTest.getScopesWithoutHistoricalData())
+ .containsExactlyInAnyOrder(Scopes.FILE);
assertThat(underTest.maxLiveDateOfClosedIssues(now)).isEqualTo(DateUtils.addDays(now, -5));
}
@Test
- public void delete_directory_if_in_settings() {
+ public void delete_directory_if_enabled_in_settings() {
MapSettings settings = new MapSettings(new PropertyDefinitions(PurgeProperties.all()));
settings.setProperty(PurgeConstants.PROPERTY_CLEAN_DIRECTORY, true);
- PurgeConfiguration underTest = PurgeConfiguration.newDefaultPurgeConfiguration(settings.asConfig(), new IdUuidPair(42L, "any-uuid"), Collections.emptyList());
+ PurgeConfiguration underTest = PurgeConfiguration.newDefaultPurgeConfiguration(settings.asConfig(), new IdUuidPair(42L, "any-uuid"), emptyList());
- assertThat(underTest.scopesWithoutHistoricalData()).contains(Scopes.DIRECTORY, Scopes.FILE);
+ assertThat(underTest.getScopesWithoutHistoricalData())
+ .containsExactlyInAnyOrder(Scopes.DIRECTORY, Scopes.FILE);
}
}
import org.sonar.db.rule.RuleDefinitionDto;
import static java.util.Arrays.asList;
+import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void shouldDeleteHistoricalDataOfDirectoriesAndFiles() {
dbTester.prepareDbUnit(getClass(), "shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml");
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, "ABCD"), new String[] {Scopes.DIRECTORY, Scopes.FILE},
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, "PROJECT_UUID"), asList(Scopes.DIRECTORY, Scopes.FILE),
30, Optional.of(30), System2.INSTANCE, Collections.emptyList());
underTest.purge(dbSession, conf, PurgeListener.EMPTY, new PurgeProfiler());
dbSession.commit();
- dbTester.assertDbUnit(getClass(), "shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml", "projects", "snapshots");
+ dbTester.assertDbUnit(getClass(), "shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml", "projects", "snapshots", "project_measures");
}
@Test
@Test
public void should_delete_all_closed_issues() {
dbTester.prepareDbUnit(getClass(), "should_delete_all_closed_issues.xml");
- PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, "1"), new String[0],
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, "1"), emptyList(),
0, Optional.empty(), System2.INSTANCE, Collections.emptyList());
underTest.purge(dbSession, conf, PurgeListener.EMPTY, new PurgeProfiler());
dbSession.commit();
}
private static PurgeConfiguration newConfigurationWith30Days() {
- return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, THE_PROJECT_UUID), new String[0], 30, Optional.of(30), System2.INSTANCE, Collections.emptyList());
+ return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, THE_PROJECT_UUID), emptyList(), 30, Optional.of(30), System2.INSTANCE, Collections.emptyList());
}
private static PurgeConfiguration newConfigurationWith30Days(System2 system2, String rootProjectUuid, String... disabledComponentUuids) {
- return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, rootProjectUuid), new String[0], 30, Optional.of(30), system2, asList(disabledComponentUuids));
+ return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, rootProjectUuid), emptyList(), 30, Optional.of(30), system2, asList(disabledComponentUuids));
}
}
-<!--
-
-What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6 (DIR/FIL) are deleted
-
--->
-
<dataset>
<!-- the project -->
<projects organization_uuid="org1"
- uuid="ABCD"
+ uuid="PROJECT_UUID"
uuid_path="."
- project_uuid="ABCD"
+ project_uuid="PROJECT_UUID"
module_uuid="[null]"
module_uuid_path="."
main_branch_project_uuid="[null]"
name="project"
description="[null]"
private="[false]"
- tags="[null]"
language="java"
copy_component_uuid="[null]"
developer_uuid="[null]"
authorization_updated_at="[null]"
id="1"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
b_copy_component_uuid="[null]"
b_description="[null]"
<!-- the directory -->
<projects organization_uuid="org1"
- uuid="EFGH"
- uuid_path=".ABCD."
- project_uuid="ABCD"
- module_uuid="ABCD"
+ uuid="DIR_UUID"
+ uuid_path=".PROJECT_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
module_uuid_path="."
main_branch_project_uuid="[null]"
created_at="[null]"
name="my/dir"
description="[null]"
private="[false]"
- tags="[null]"
language="java"
copy_component_uuid="[null]"
developer_uuid="[null]"
authorization_updated_at="[null]"
id="2"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
b_copy_component_uuid="[null]"
b_description="[null]"
<!-- the file -->
<projects organization_uuid="org1"
- uuid="GHIJ"
- uuid_path=".ABCD.EFGH."
- project_uuid="ABCD"
- module_uuid="ABCD"
- module_uuid_path=".ABCD."
+ uuid="FILE_UUID"
+ uuid_path=".PROJECT_UUID.DIR_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
+ module_uuid_path=".PROJECT_UUID."
main_branch_project_uuid="[null]"
created_at="[null]"
long_name="[null]"
name="my/dir/File.java"
description="[null]"
private="[false]"
- tags="[null]"
language="java"
copy_component_uuid="[null]"
developer_uuid="[null]"
authorization_updated_at="[null]"
id="3"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
+ b_changed="[false]"
+ b_copy_component_uuid="[null]"
+ b_description="[null]"
+ b_enabled="[false]"
+ b_uuid_path="[null]"
+ b_language="[null]"
+ b_long_name="[null]"
+ b_module_uuid="[null]"
+ b_module_uuid_path="[null]"
+ b_name="[null]"
+ b_path="[null]"
+ b_qualifier="[null]"
+ />
+
+ <!-- unit test file -->
+ <projects organization_uuid="org1"
+ uuid="TEST_FILE_UUID"
+ uuid_path=".PROJECT_UUID.DIR_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
+ module_uuid_path=".PROJECT_UUID."
+ main_branch_project_uuid="[null]"
+ created_at="[null]"
+ long_name="[null]"
+ scope="FIL"
+ qualifier="UTS"
+ kee="project:my/dir/FileTest.java"
+ name="my/dir/FileTest.java"
+ description="[null]"
+ private="[false]"
+ language="java"
+ copy_component_uuid="[null]"
+ developer_uuid="[null]"
+ path="[null]"
+ deprecated_kee="[null]"
+ authorization_updated_at="[null]"
+ id="4"
+ enabled="[true]"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
b_copy_component_uuid="[null]"
b_description="[null]"
<!-- do not purge last snapshots -->
<snapshots id="1"
uuid="u1"
- component_uuid="ABCD"
+ component_uuid="PROJECT_UUID"
status="P"
islast="[true]"
purge_status="[null]"
version="[null]"
/>
+ <project_measures id="1"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="PROJECT_UUID"/>
+ <project_measures id="2"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="DIR_UUID"/>
+ <project_measures id="3"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="FILE_UUID"/>
+ <project_measures id="4"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="TEST_FILE_UUID"/>
+
<!-- snapshots to be purged -->
<snapshots id="4"
- uuid="u4"
- component_uuid="ABCD"
+ uuid="u2"
+ component_uuid="PROJECT_UUID"
status="P"
islast="[false]"
purge_status="1"
version="[null]"
/>
+ <project_measures id="5"
+ analysis_uuid="u2"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="PROJECT_UUID"/>
+ <!--<project_measures id="6"-->
+ <!--analysis_uuid="u2"-->
+ <!--metric_id="10"-->
+ <!--value="[null]"-->
+ <!--text_value="[null]"-->
+ <!--measure_data="[null]"-->
+ <!--variation_value_1="[null]"-->
+ <!--variation_value_2="[null]"-->
+ <!--variation_value_3="[null]"-->
+ <!--variation_value_4="[null]"-->
+ <!--variation_value_5="[null]"-->
+ <!--alert_status="[null]"-->
+ <!--alert_text="[null]"-->
+ <!--person_id="[null]"-->
+ <!--description="[null]"-->
+ <!--component_uuid="DIR_UUID"/>-->
+ <!--<project_measures id="7"-->
+ <!--analysis_uuid="u2"-->
+ <!--metric_id="10"-->
+ <!--value="[null]"-->
+ <!--text_value="[null]"-->
+ <!--measure_data="[null]"-->
+ <!--variation_value_1="[null]"-->
+ <!--variation_value_2="[null]"-->
+ <!--variation_value_3="[null]"-->
+ <!--variation_value_4="[null]"-->
+ <!--variation_value_5="[null]"-->
+ <!--alert_status="[null]"-->
+ <!--alert_text="[null]"-->
+ <!--person_id="[null]"-->
+ <!--description="[null]"-->
+ <!--component_uuid="FILE_UUID"/>-->
+ <!--<project_measures id="8"-->
+ <!--analysis_uuid="u2"-->
+ <!--metric_id="10"-->
+ <!--value="[null]"-->
+ <!--text_value="[null]"-->
+ <!--measure_data="[null]"-->
+ <!--variation_value_1="[null]"-->
+ <!--variation_value_2="[null]"-->
+ <!--variation_value_3="[null]"-->
+ <!--variation_value_4="[null]"-->
+ <!--variation_value_5="[null]"-->
+ <!--alert_status="[null]"-->
+ <!--alert_text="[null]"-->
+ <!--person_id="[null]"-->
+ <!--description="[null]"-->
+ <!--component_uuid="TEST_FILE_UUID"/>-->
+
</dataset>
<!-- the project -->
<projects organization_uuid="org1"
- uuid="ABCD"
+ uuid="PROJECT_UUID"
uuid_path="."
- project_uuid="ABCD"
+ project_uuid="PROJECT_UUID"
module_uuid="[null]"
module_uuid_path="."
main_branch_project_uuid="[null]"
authorization_updated_at="[null]"
id="1"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
+ b_copy_component_uuid="[null]"
b_description="[null]"
b_enabled="[false]"
b_uuid_path="[null]"
<!-- the directory -->
<projects organization_uuid="org1"
- uuid="EFGH"
- uuid_path=".ABCD."
- project_uuid="ABCD"
- module_uuid="ABCD"
+ uuid="DIR_UUID"
+ uuid_path=".PROJECT_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
module_uuid_path="."
main_branch_project_uuid="[null]"
created_at="[null]"
authorization_updated_at="[null]"
id="2"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
+ b_copy_component_uuid="[null]"
b_description="[null]"
b_enabled="[false]"
b_uuid_path="[null]"
<!-- the file -->
<projects organization_uuid="org1"
- uuid="GHIJ"
- uuid_path=".ABCD.EFGH."
- project_uuid="ABCD"
- module_uuid="ABCD"
- module_uuid_path=".ABCD."
+ uuid="FILE_UUID"
+ uuid_path=".PROJECT_UUID.DIR_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
+ module_uuid_path=".PROJECT_UUID."
main_branch_project_uuid="[null]"
created_at="[null]"
long_name="[null]"
authorization_updated_at="[null]"
id="3"
enabled="[true]"
- root_uuid="ABCD"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
b_changed="[false]"
+ b_copy_component_uuid="[null]"
+ b_description="[null]"
+ b_enabled="[false]"
+ b_uuid_path="[null]"
+ b_language="[null]"
+ b_long_name="[null]"
+ b_module_uuid="[null]"
+ b_module_uuid_path="[null]"
+ b_name="[null]"
+ b_path="[null]"
+ b_qualifier="[null]"
+ />
+
+ <!-- unit test file -->
+ <projects organization_uuid="org1"
+ uuid="TEST_FILE_UUID"
+ uuid_path=".PROJECT_UUID.DIR_UUID."
+ project_uuid="PROJECT_UUID"
+ module_uuid="PROJECT_UUID"
+ module_uuid_path=".PROJECT_UUID."
+ main_branch_project_uuid="[null]"
+ created_at="[null]"
+ long_name="[null]"
+ scope="FIL"
+ qualifier="UTS"
+ kee="project:my/dir/FileTest.java"
+ name="my/dir/FileTest.java"
+ description="[null]"
+ private="[false]"
+ language="java"
+ copy_component_uuid="[null]"
+ developer_uuid="[null]"
+ path="[null]"
+ deprecated_kee="[null]"
+ authorization_updated_at="[null]"
+ id="4"
+ enabled="[true]"
+ root_uuid="PROJECT_UUID"
+ tags="[null]"
+ b_changed="[false]"
+ b_copy_component_uuid="[null]"
b_description="[null]"
b_enabled="[false]"
b_uuid_path="[null]"
<!-- do not purge last snapshots -->
<snapshots id="1"
uuid="u1"
- component_uuid="ABCD"
+ component_uuid="PROJECT_UUID"
status="P"
islast="[true]"
purge_status="[null]"
version="[null]"
/>
+ <project_measures id="1"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="PROJECT_UUID"/>
+ <project_measures id="2"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="DIR_UUID"/>
+ <project_measures id="3"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="FILE_UUID"/>
+ <project_measures id="4"
+ analysis_uuid="u1"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="TEST_FILE_UUID"/>
+
<!-- snapshots to be purged -->
<snapshots id="4"
- uuid="u4"
- component_uuid="ABCD"
+ uuid="u2"
+ component_uuid="PROJECT_UUID"
status="P"
islast="[false]"
purge_status="[null]"
version="[null]"
/>
+ <project_measures id="5"
+ analysis_uuid="u2"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="PROJECT_UUID"/>
+ <project_measures id="6"
+ analysis_uuid="u2"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="DIR_UUID"/>
+ <project_measures id="7"
+ analysis_uuid="u2"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="FILE_UUID"/>
+ <project_measures id="8"
+ analysis_uuid="u2"
+ metric_id="10"
+ value="[null]"
+ text_value="[null]"
+ measure_data="[null]"
+ variation_value_1="[null]"
+ variation_value_2="[null]"
+ variation_value_3="[null]"
+ variation_value_4="[null]"
+ variation_value_5="[null]"
+ alert_status="[null]"
+ alert_text="[null]"
+ person_id="[null]"
+ description="[null]"
+ component_uuid="TEST_FILE_UUID"/>
+
</dataset>