diff options
author | David Gageot <david@gageot.net> | 2012-07-12 08:40:17 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-07-12 17:21:01 +0200 |
commit | 8b1a57036400e89b695a2a70626b43d94ec20ac4 (patch) | |
tree | ecaafbfbcce2294eed804f646e90da64334b0fd5 /sonar-batch | |
parent | ff40d72923a6b480ee0d4795ba8ed417d079baf1 (diff) | |
download | sonarqube-8b1a57036400e89b695a2a70626b43d94ec20ac4.tar.gz sonarqube-8b1a57036400e89b695a2a70626b43d94ec20ac4.zip |
Reuse database for faster unit tests
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java b/sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java index 5a0d8326050..8c318a265d5 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java @@ -33,12 +33,12 @@ import static org.mockito.Mockito.mock; public class UpdateStatusJobTest extends AbstractDbUnitTestCase { @Test - public void shouldUnflagPenultimateLastSnapshot() throws Exception { + public void shouldUnflagPenultimateLastSnapshot() { assertAnalysis(11, "shouldUnflagPenultimateLastSnapshot"); } @Test - public void doNotFailIfNoPenultimateLast() throws Exception { + public void doNotFailIfNoPenultimateLast() { assertAnalysis(5, "doNotFailIfNoPenultimateLast"); } @@ -49,11 +49,11 @@ public class UpdateStatusJobTest extends AbstractDbUnitTestCase { private void assertAnalysis(int snapshotId, String fixture) { setupData("sharedFixture", fixture); + DatabaseSession session = getSession(); UpdateStatusJob sensor = new UpdateStatusJob(mock(ServerMetadata.class), session, new DefaultResourcePersister(session), loadSnapshot(snapshotId)); sensor.execute(); - getSession().stop(); checkTables(fixture, "snapshots"); } |