Skip to content

Commit

Permalink
Try to fix derby issue in IT tests
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Escoffier <[email protected]>
  • Loading branch information
cescoffier committed Feb 25, 2014
1 parent 97d7d90 commit 301a993
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.jdbc.DataSourceFactory;
import org.wisdom.test.parents.WisdomTest;

import javax.inject.Inject;
import javax.sql.DataSource;
import javax.xml.ws.Service;

import java.io.File;
import java.sql.Driver;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
Expand All @@ -36,21 +32,9 @@ public void setup() {
db.mkdirs();
}

@After
public void cleanup() {
File log = new File("derby.log");
if (log.isFile()) {
FileUtils.deleteQuietly(log);
}
File db = new File("target/db");
if (db.isDirectory()) {
FileUtils.deleteQuietly(db);
}
}

@Test
public void testDerby() throws SQLException, InvalidSyntaxException {
assertThat(sources).isNotNull();
assertThat(sources).isNotNull();

assertThat(sources.getDataSources()).containsKeys("derby");
assertThat(sources.getDataSource("derby")).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.ImmutableMap;
import org.apache.commons.configuration.MapConfiguration;
import org.apache.commons.io.FileUtils;
import org.apache.derby.jdbc.EmbeddedDriver;
import org.junit.After;
import org.junit.Test;
Expand Down Expand Up @@ -38,9 +39,7 @@ public class TestWithDerby {
@After
public void cleanup() {
File log = new File("derby.log");
if (log.isFile()) {
log.delete();
}
FileUtils.deleteQuietly(log);
}

@Test
Expand Down

0 comments on commit 301a993

Please sign in to comment.