Skip to content

Instantly share code, notes, and snippets.

@thody
Created September 24, 2013 13:55
Show Gist options
  • Save thody/6685122 to your computer and use it in GitHub Desktop.
Save thody/6685122 to your computer and use it in GitHub Desktop.
Snippet depicting usage of `DBIRule` with `DataSourceFactory` passed in via constructor.
private static DataSourceFactory dataSourceFactory;
@BeforeClass
public static void setUpClass() {
dataSourceFactory = new DataSourceFactory();
dataSourceFactory.setUrl("jdbc:h2:mem:DbTest-" + System.currentTimeMillis());
dataSourceFactory.setUser("sa");
dataSourceFactory.setPassword("");
dataSourceFactory.setDriverClass("org.h2.Driver");
}
@Rule
public DBIRule dbiRule = new DBIRule(dataSourceFactory);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment