From: simonbrandhof Date: Thu, 28 Apr 2011 09:59:48 +0000 (+0200) Subject: Move derby logs generated during unit tests to target/ X-Git-Tag: 2.8~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7dd514a1d598fe2d15613af864401aa11442667e;p=sonarqube.git Move derby logs generated during unit tests to target/ --- diff --git a/.gitignore b/.gitignore index ef28c42b83b..5aec99e7667 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java b/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java index 9bd6aa688c3..ba9e47b6e76 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/persistence/DatabaseTestCase.java @@ -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");