]> source.dussan.org Git - sonarqube.git/commitdiff
Move derby logs generated during unit tests to target/
authorsimonbrandhof <simon.brandhof@gmail.com>
Thu, 28 Apr 2011 09:59:48 +0000 (11:59 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Thu, 28 Apr 2011 09:59:48 +0000 (11:59 +0200)
.gitignore
sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java

index ef28c42b83b3f45856afe31596cea8409907c0d4..5aec99e7667dd71da7ee18c310b17405c5654146 100644 (file)
@@ -3,7 +3,7 @@ sonar-server/src/main/webapp/deploy/gwt
 sonar-server/src/main/webapp/deploy/plugins
 sonar-server/src/main/webapp/deploy/jdbc-driver.jar
 sonar-server/src/main/webapp/deploy/maven/org
-plugins/sonar-core-plugin/derby.log
+sonar-server/src/main/webapp/WEB-INF/log/
 
 # javadoc
 docs.tar
index 9bd6aa688c366180f60eb04ced7971ed7fd4b754..ba9e47b6e76133e89a8789404740ed1b1476f191 100644 (file)
@@ -52,6 +52,13 @@ public abstract class DatabaseTestCase {
 
   @BeforeClass
   public static void startDatabase() throws Exception {
+    System.setProperty("derby.stream.error.file", "target/derby.log");
+
+    /*
+    Note: we could use a datasource instead of a direct JDBC connection.
+    See org.apache.derby.jdbc.ClientDataSource (http://db.apache.org/derby/papers/DerbyClientSpec.html#Connection+URL+Format)
+    and org.dbunit.DataSourceDatabaseTester
+     */
     EmbeddedDriver driver = new EmbeddedDriver();
     DriverManager.registerDriver(driver);
     databaseTester = new JdbcDatabaseTester(driver.getClass().getName(), JDBC_URL + ";create=true");