aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-12 08:40:17 +0200
committerDavid Gageot <david@gageot.net>2012-07-12 17:21:01 +0200
commit8b1a57036400e89b695a2a70626b43d94ec20ac4 (patch)
treeecaafbfbcce2294eed804f646e90da64334b0fd5 /sonar-server
parentff40d72923a6b480ee0d4795ba8ed417d079baf1 (diff)
downloadsonarqube-8b1a57036400e89b695a2a70626b43d94ec20ac4.tar.gz
sonarqube-8b1a57036400e89b695a2a70626b43d94ec20ac4.zip
Reuse database for faster unit tests
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/configuration/PropertiesBackup.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java2
2 files changed, 1 insertions, 2 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/configuration/PropertiesBackup.java b/sonar-server/src/main/java/org/sonar/server/configuration/PropertiesBackup.java
index da419f65b26..d0fb42a0777 100644
--- a/sonar-server/src/main/java/org/sonar/server/configuration/PropertiesBackup.java
+++ b/sonar-server/src/main/java/org/sonar/server/configuration/PropertiesBackup.java
@@ -67,6 +67,7 @@ public class PropertiesBackup implements Backupable {
}
}
}
+ databaseSession.commit();
}
private void clearProperties() {
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
index d8f207ac833..078a39dc41a 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
@@ -112,8 +112,6 @@ public class PropertiesBackupTest extends AbstractDbUnitTestCase {
FileUtils.readFileToString(
TestUtils.getResource(getClass(), "backup-with-multiline-property.xml"), CharEncoding.UTF_8));
- getSession().commit();
-
Property property = getSession().getSingleResult(Property.class, "key", "sonar.multiline.secured");
assertThat(property.getValue(), startsWith("ONQwdcwcwwdadalkdmaiQGMqMVnhtAbhxwjjoVkHbWgx"));
assertThat(property.getValue(), endsWith("mmmm"));