From 7dd514a1d598fe2d15613af864401aa11442667e Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Thu, 28 Apr 2011 11:59:48 +0200 Subject: [PATCH] Move derby logs generated during unit tests to target/ --- .gitignore | 2 +- .../java/org/sonar/test/persistence/DatabaseTestCase.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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"); -- 2.39.5