From c1d7bdb92af87e4e8882c7126cad5c5872254ba2 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 6 Mar 2012 09:22:19 +0100 Subject: Commit instead of flush statements when changing preparedStatement of batch --- .../java/org/sonar/core/purge/PurgeCommands.java | 195 +++++++++++++++++++++ .../main/java/org/sonar/core/purge/PurgeDao.java | 176 +------------------ .../org/sonar/core/purge/PurgeCommandsTest.java | 89 ++++++++++ .../java/org/sonar/core/purge/PurgeDaoTest.java | 75 -------- .../PurgeCommandsTest/shouldDeleteResource.xml | 27 +++ .../shouldDeleteSnapshot-result.xml | 38 ++++ .../PurgeCommandsTest/shouldDeleteSnapshot.xml | 75 ++++++++ ...eteWastedMeasuresWhenPurgingSnapshot-result.xml | 78 +++++++++ ...ouldDeleteWastedMeasuresWhenPurgingSnapshot.xml | 78 +++++++++ .../shouldPurgeSnapshot-result.xml | 101 +++++++++++ .../PurgeCommandsTest/shouldPurgeSnapshot.xml | 94 ++++++++++ .../purge/PurgeDaoTest/shouldDeleteResource.xml | 27 --- .../PurgeDaoTest/shouldDeleteSnapshot-result.xml | 38 ---- .../purge/PurgeDaoTest/shouldDeleteSnapshot.xml | 75 -------- ...eteWastedMeasuresWhenPurgingSnapshot-result.xml | 78 --------- ...ouldDeleteWastedMeasuresWhenPurgingSnapshot.xml | 78 --------- .../PurgeDaoTest/shouldPurgeSnapshot-result.xml | 101 ----------- .../purge/PurgeDaoTest/shouldPurgeSnapshot.xml | 94 ---------- 18 files changed, 781 insertions(+), 736 deletions(-) create mode 100644 sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java create mode 100644 sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml create mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteResource.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml delete mode 100644 sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml (limited to 'sonar-core') diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java new file mode 100644 index 00000000000..22a841a2e3f --- /dev/null +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java @@ -0,0 +1,195 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.core.purge; + +import com.google.common.annotations.VisibleForTesting; +import org.apache.ibatis.session.SqlSession; + +import java.util.List; + +final class PurgeCommands { + private PurgeCommands() { + } + + @VisibleForTesting + static void deleteResources(List resourceIds, SqlSession session, PurgeMapper mapper, PurgeVendorMapper vendorMapper) { + // Note : do not merge the delete statements into a single loop of resource ids. It's + // voluntarily grouped by tables in order to benefit from JDBC batch mode. + // Batch requests can only relate to the same PreparedStatement. + + for (Long resourceId : resourceIds) { + deleteSnapshots(PurgeSnapshotQuery.create().setResourceId(resourceId), session, mapper); + } + + // possible missing optimization: filter requests according to resource scope + + for (Long resourceId : resourceIds) { + mapper.deleteResourceLinks(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceProperties(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceIndex(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceGroupRoles(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceUserRoles(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceManualMeasures(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + vendorMapper.deleteResourceReviewComments(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + vendorMapper.deleteResourceActionPlansReviews(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceReviews(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceActionPlans(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResourceEvents(resourceId); + } + session.commit(); + + for (Long resourceId : resourceIds) { + mapper.deleteResource(resourceId); + } + session.commit(); + } + + @VisibleForTesting + static void deleteSnapshots(final PurgeSnapshotQuery query, final SqlSession session, final PurgeMapper mapper) { + deleteSnapshots(mapper.selectSnapshotIds(query), session, mapper); + } + + private static void deleteSnapshots(final List snapshotIds, final SqlSession session, final PurgeMapper mapper) { + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotDependencies(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotDuplications(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotEvents(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotMeasureData(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotMeasures(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotSource(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotViolations(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshot(snapshotId); + } + + session.commit(); + } + + @VisibleForTesting + static void purgeSnapshots(final PurgeSnapshotQuery query, final SqlSession session, final PurgeMapper mapper) { + purgeSnapshots(mapper.selectSnapshotIds(query), session, mapper); + } + + private static void purgeSnapshots(final List snapshotIds, final SqlSession session, final PurgeMapper mapper) { + // note that events are not deleted + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotDependencies(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotDuplications(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotSource(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotViolations(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotWastedMeasures(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.deleteSnapshotMeasuresOnQualityModelRequirements(snapshotId); + } + session.commit(); + + for (Long snapshotId : snapshotIds) { + mapper.updatePurgeStatusToOne(snapshotId); + } + session.commit(); + } + +} diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java index 14792e2c12b..a93661f87a0 100644 --- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java +++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeDao.java @@ -73,7 +73,7 @@ public class PurgeDao { .setIslast(false) .setStatus(new String[]{"U"}) .setRootProjectId(project.getId()); - deleteSnapshots(query, session, purgeMapper); + PurgeCommands.deleteSnapshots(query, session, purgeMapper); session.commit(); } } @@ -97,16 +97,16 @@ public class PurgeDao { .setIslast(false) .setScopes(scopesWithoutHistoricalData) .setRootSnapshotId(projectSnapshotId); - deleteSnapshots(query, session, purgeMapper); + PurgeCommands.deleteSnapshots(query, session, purgeMapper); session.commit(); } PurgeSnapshotQuery query = PurgeSnapshotQuery.create().setRootSnapshotId(projectSnapshotId).setNotPurged(true); - purgeSnapshots(query, session, purgeMapper); + PurgeCommands.purgeSnapshots(query, session, purgeMapper); session.commit(); // must be executed at the end for reentrance - purgeSnapshots(PurgeSnapshotQuery.create().setId(projectSnapshotId).setNotPurged(true), session, purgeMapper); + PurgeCommands.purgeSnapshots(PurgeSnapshotQuery.create().setId(projectSnapshotId).setNotPurged(true), session, purgeMapper); session.commit(); } } @@ -156,83 +156,10 @@ public class PurgeDao { } List resourceIds = mapper.selectResourceIdsByRootId(rootProjectId); - deleteResources(resourceIds, session, mapper, vendorMapper); + PurgeCommands.deleteResources(resourceIds, session, mapper, vendorMapper); session.commit(); } - @VisibleForTesting - void deleteResources(List resourceIds, SqlSession session, PurgeMapper mapper, PurgeVendorMapper vendorMapper) { - // Note : do not merge the delete statements into a single loop of resource ids. It's - // voluntarily grouped by tables in order to benefit from JDBC batch mode. - // Batch requests can only relate to the same PreparedStatement. - - for (Long resourceId : resourceIds) { - deleteSnapshots(PurgeSnapshotQuery.create().setResourceId(resourceId), session, mapper); - } - - // possible missing optimization: filter requests according to resource scope - - for (Long resourceId : resourceIds) { - mapper.deleteResourceLinks(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceProperties(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceIndex(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceGroupRoles(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceUserRoles(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceManualMeasures(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - vendorMapper.deleteResourceReviewComments(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - vendorMapper.deleteResourceActionPlansReviews(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceReviews(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceActionPlans(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResourceEvents(resourceId); - } - session.flushStatements(); - - for (Long resourceId : resourceIds) { - mapper.deleteResource(resourceId); - } - session.flushStatements(); - } - @VisibleForTesting void disableResource(long resourceId, PurgeMapper mapper) { mapper.deleteResourceIndex(resourceId); @@ -245,7 +172,7 @@ public class PurgeDao { final SqlSession session = mybatis.openBatchSession(); try { final PurgeMapper mapper = session.getMapper(PurgeMapper.class); - deleteSnapshots(mapper.selectSnapshotIds(query), session, mapper); + PurgeCommands.deleteSnapshots(query, session, mapper); session.commit(); return this; @@ -254,97 +181,6 @@ public class PurgeDao { } } - @VisibleForTesting - void deleteSnapshots(final PurgeSnapshotQuery query, final SqlSession session, final PurgeMapper mapper) { - deleteSnapshots(mapper.selectSnapshotIds(query), session, mapper); - } - - private void deleteSnapshots(final List snapshotIds, final SqlSession session, final PurgeMapper mapper) { - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotDependencies(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotDuplications(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotEvents(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotMeasureData(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotMeasures(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotSource(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotViolations(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshot(snapshotId); - } - - session.flushStatements(); - } - - @VisibleForTesting - void purgeSnapshots(final PurgeSnapshotQuery query, final SqlSession session, final PurgeMapper mapper) { - purgeSnapshots(mapper.selectSnapshotIds(query), session, mapper); - } - - private void purgeSnapshots(final List snapshotIds, final SqlSession session, final PurgeMapper mapper) { - // note that events are not deleted - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotDependencies(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotDuplications(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotSource(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotViolations(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotWastedMeasures(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.deleteSnapshotMeasuresOnQualityModelRequirements(snapshotId); - } - session.flushStatements(); - - for (Long snapshotId : snapshotIds) { - mapper.updatePurgeStatusToOne(snapshotId); - } - session.flushStatements(); - } - /** * Load the whole tree of projects, including the project given in parameter. */ diff --git a/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java b/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java new file mode 100644 index 00000000000..d4411bfa8be --- /dev/null +++ b/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java @@ -0,0 +1,89 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.core.purge; + +import org.apache.ibatis.session.SqlSession; +import org.junit.Test; +import org.sonar.core.persistence.DaoTestCase; +import org.sonar.core.persistence.MyBatis; + +import java.util.Arrays; + +public class PurgeCommandsTest extends DaoTestCase { + /** + * Test that all related data is deleted. + */ + @Test + public void shouldDeleteSnapshot() { + setupData("shouldDeleteSnapshot"); + + SqlSession session = getMyBatis().openSession(); + try { + PurgeCommands.deleteSnapshots(PurgeSnapshotQuery.create().setId(5L), session, session.getMapper(PurgeMapper.class)); + } finally { + MyBatis.closeQuietly(session); + } + checkTables("shouldDeleteSnapshot", + "snapshots", "project_measures", "measure_data", "rule_failures", "snapshot_sources", "duplications_index", "events", "dependencies"); + } + + /** + * Test that all related data is purged. + */ + @Test + public void shouldPurgeSnapshot() { + setupData("shouldPurgeSnapshot"); + + SqlSession session = getMyBatis().openSession(); + try { + PurgeCommands.purgeSnapshots(PurgeSnapshotQuery.create().setId(1L), session, session.getMapper(PurgeMapper.class)); + } finally { + MyBatis.closeQuietly(session); + } + checkTables("shouldPurgeSnapshot", + "snapshots", "project_measures", "measure_data", "rule_failures", "snapshot_sources", "duplications_index", "events", "dependencies", "reviews"); + } + + @Test + public void shouldDeleteWastedMeasuresWhenPurgingSnapshot() { + setupData("shouldDeleteWastedMeasuresWhenPurgingSnapshot"); + + SqlSession session = getMyBatis().openSession(); + try { + PurgeCommands.purgeSnapshots(PurgeSnapshotQuery.create().setId(1L), session, session.getMapper(PurgeMapper.class)); + } finally { + MyBatis.closeQuietly(session); + } + checkTables("shouldDeleteWastedMeasuresWhenPurgingSnapshot", "project_measures"); + } + + @Test + public void shouldDeleteResource() { + setupData("shouldDeleteResource"); + SqlSession session = getMyBatis().openSession(); + try { + PurgeCommands.deleteResources(Arrays.asList(1L), session, session.getMapper(PurgeMapper.class), session.getMapper(PurgeVendorMapper.class)); + } finally { + MyBatis.closeQuietly(session); + } + assertEmptyTables("projects", "snapshots", "events", "reviews", "review_comments"); + } + +} diff --git a/sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java b/sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java index 2df27e177c2..9269f7c4daf 100644 --- a/sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java @@ -29,7 +29,6 @@ import org.sonar.core.persistence.DaoTestCase; import org.sonar.core.persistence.MyBatis; import org.sonar.core.resource.ResourceDao; -import java.util.Arrays; import java.util.List; import static org.hamcrest.Matchers.is; @@ -45,26 +44,6 @@ public class PurgeDaoTest extends DaoTestCase { dao = new PurgeDao(getMyBatis(), new ResourceDao(getMyBatis())); } - /** - * Test that all related data is deleted. - */ - @Test - public void shouldDeleteSnapshot() { - setupData("shouldDeleteSnapshot"); - - SqlSession session = getMyBatis().openSession(); - try { - // this method does not commit and close the session - dao.deleteSnapshots(PurgeSnapshotQuery.create().setId(5L), session, session.getMapper(PurgeMapper.class)); - session.commit(); - - } finally { - MyBatis.closeQuietly(session); - } - checkTables("shouldDeleteSnapshot", - "snapshots", "project_measures", "measure_data", "rule_failures", "snapshot_sources", "duplications_index", "events", "dependencies"); - } - @Test public void shouldDeleteAbortedBuilds() { setupData("shouldDeleteAbortedBuilds"); @@ -72,44 +51,6 @@ public class PurgeDaoTest extends DaoTestCase { checkTables("shouldDeleteAbortedBuilds", "snapshots"); } - /** - * Test that all related data is purged. - */ - @Test - public void shouldPurgeSnapshot() { - setupData("shouldPurgeSnapshot"); - - SqlSession session = getMyBatis().openSession(); - try { - dao.purgeSnapshots(PurgeSnapshotQuery.create().setId(1L), session, session.getMapper(PurgeMapper.class)); - - // the above method does not commit and close the session - session.commit(); - - } finally { - MyBatis.closeQuietly(session); - } - checkTables("shouldPurgeSnapshot", - "snapshots", "project_measures", "measure_data", "rule_failures", "snapshot_sources", "duplications_index", "events", "dependencies", "reviews"); - } - - @Test - public void shouldDeleteWastedMeasuresWhenPurgingSnapshot() { - setupData("shouldDeleteWastedMeasuresWhenPurgingSnapshot"); - - SqlSession session = getMyBatis().openSession(); - try { - dao.purgeSnapshots(PurgeSnapshotQuery.create().setId(1L), session, session.getMapper(PurgeMapper.class)); - - // the above method does not commit and close the session - session.commit(); - - } finally { - MyBatis.closeQuietly(session); - } - checkTables("shouldDeleteWastedMeasuresWhenPurgingSnapshot", "project_measures"); - } - @Test public void shouldCloseReviewWhenDisablingResource() { setupData("shouldCloseReviewWhenDisablingResource"); @@ -167,22 +108,6 @@ public class PurgeDaoTest extends DaoTestCase { assertThat(snapshots.size(), is(3)); } - @Test - public void shouldDeleteResource() { - setupData("shouldDeleteResource"); - SqlSession session = getMyBatis().openSession(); - try { - dao.deleteResources(Arrays.asList(1L), session, session.getMapper(PurgeMapper.class), session.getMapper(PurgeVendorMapper.class)); - - // the above method does not commit and close the session - session.commit(); - - } finally { - MyBatis.closeQuietly(session); - } - assertEmptyTables("projects", "snapshots", "events", "reviews", "review_comments"); - } - @Test public void shouldDeleteProject() { setupData("shouldDeleteProject"); diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml new file mode 100644 index 00000000000..df9741558c4 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml new file mode 100644 index 00000000000..6734c0522a8 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml new file mode 100644 index 00000000000..61ebfe5caab --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml new file mode 100644 index 00000000000..d264293021c --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml @@ -0,0 +1,78 @@ + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml new file mode 100644 index 00000000000..b9fddbbc0c9 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml @@ -0,0 +1,78 @@ + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml new file mode 100644 index 00000000000..b8af6c0b035 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml new file mode 100644 index 00000000000..ef7489378b9 --- /dev/null +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteResource.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteResource.xml deleted file mode 100644 index df9741558c4..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteResource.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml deleted file mode 100644 index 6734c0522a8..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml deleted file mode 100644 index 61ebfe5caab..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml deleted file mode 100644 index d264293021c..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml deleted file mode 100644 index b9fddbbc0c9..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml deleted file mode 100644 index b8af6c0b035..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml deleted file mode 100644 index ef7489378b9..00000000000 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3