Skip to content

Commit

Permalink
Merge pull request #4 from rareddy/TEIID-2260
Browse files Browse the repository at this point in the history
TEIID-2260: adding a arquillian test
  • Loading branch information
rareddy committed Oct 11, 2012
2 parents 959f0e1 + 233b4aa commit 32674a5
Showing 1 changed file with 26 additions and 0 deletions.
Expand Up @@ -47,6 +47,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.postgresql.Driver;
import org.teiid.adminapi.*;
import org.teiid.adminapi.VDB.ConnectionType;
import org.teiid.adminapi.VDB.Status;
Expand Down Expand Up @@ -516,4 +517,29 @@ public void testDDLExport() throws Exception{
assertEquals(Status.FAILED, vdb.getStatus());
}

@Test
public void testODBCConnectionSuccess() throws Exception {
admin.deploy("bqt.vdb",new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
Driver d = new Driver();
Properties p = new Properties();
p.setProperty("user", "user");
p.setProperty("password", "user");
Connection c = d.connect("jdbc:postgresql://127.0.0.1:35432/bqt", p);
c.close();
}

@Test
public void testODBCConnectionFailure() throws Exception {
admin.deploy("bqt.vdb",new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
Driver d = new Driver();
Properties p = new Properties();
p.setProperty("user", "user");
p.setProperty("password", "notpassword");
try {
d.connect("jdbc:postgresql://127.0.0.1:35432/bqt", p);
fail("failed due to bad credentials");
} catch (SQLException e) {
}
}

}

0 comments on commit 32674a5

Please sign in to comment.