use of com.google.gwtorm.jdbc.JdbcSchema in project gerrit by GerritCodeReview.
the class SchemaCreatorTest method getCauses_CreateSchema.
@Test
public void getCauses_CreateSchema() throws OrmException, SQLException, IOException {
// Initially the schema should be empty.
String[] types = { "TABLE", "VIEW" };
try (JdbcSchema d = (JdbcSchema) db.open();
ResultSet rs = d.getConnection().getMetaData().getTables(null, null, null, types)) {
assertThat(rs.next()).isFalse();
}
// Create the schema using the current schema version.
//
db.create();
db.assertSchemaVersion();
// By default sitePath is set to the current working directory.
//
File sitePath = new File(".").getAbsoluteFile();
if (sitePath.getName().equals(".")) {
sitePath = sitePath.getParentFile();
}
assertThat(db.getSystemConfig().sitePath).isEqualTo(sitePath.getCanonicalPath());
}
Aggregations