]> source.dussan.org Git - sonarqube.git/commitdiff
Add ServerTester#setProperty()
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 29 Apr 2014 14:27:14 +0000 (16:27 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 29 Apr 2014 14:27:25 +0000 (16:27 +0200)
sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java

index b3752bf62d88a44e7185f8e7ee63f133e5534187..1f669b04d1b53363183a740ebc4fdd7cef29ca5b 100644 (file)
@@ -38,6 +38,7 @@ public class ServerTester extends ExternalResource {
   private Platform platform;
   private File tempDir;
   private Object[] components;
+  private Properties initialProps = new Properties();
 
   /**
    * Called only when JUnit @Rule or @ClassRule is used.
@@ -53,6 +54,7 @@ public class ServerTester extends ExternalResource {
     }
     tempDir = createTempDir();
     Properties properties = new Properties();
+    properties.putAll(initialProps);
     properties.setProperty(CoreProperties.SONAR_HOME, tempDir.getAbsolutePath());
     properties.setProperty(DatabaseProperties.PROP_URL, "jdbc:h2:" + tempDir.getAbsolutePath() + "/h2");
     platform = new Platform();
@@ -97,6 +99,11 @@ public class ServerTester extends ExternalResource {
     return this;
   }
 
+  public ServerTester setProperty(String key, String value) {
+    initialProps.setProperty(key, value);
+    return this;
+  }
+
   /**
    * Get a component from the platform
    */