Commit b94854d2 authored by R.W.Majeed's avatar R.W.Majeed

allow external servers for test main methods

parent f9677059
......@@ -30,9 +30,9 @@ import de.sekmi.histream.i2b2.PostgresPatientStore;
public class TestPostgresPatientStore implements Closeable {
PostgresPatientStore store;
public void open(String host, int port) throws ClassNotFoundException, SQLException{
public void open(String host, int port, String user, String password, String projectId) throws ClassNotFoundException, SQLException{
store = new PostgresPatientStore();
store.open(DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/i2b2", "i2b2demodata", "demodata"), "demo");
store.open(DriverManager.getConnection("jdbc:postgresql://"+host+":"+port+"/i2b2", user, password),projectId);
}
public PostgresPatientStore getStore(){return store;}
......@@ -43,11 +43,12 @@ public class TestPostgresPatientStore implements Closeable {
}
private void open()throws Exception{
open("localhost",15432);
open("localhost",15432,"i2b2demodata", "demodata","demo");
}
public static void main(String args[]) throws Exception{
TestPostgresPatientStore test = new TestPostgresPatientStore();
test.open();
// test.open();
test.open("134.106.36.86",15437, "i2b2crcdata","","AKTIN");
System.out.println("Current patient cache size: "+test.store.size());
test.close();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment