Skip to content

Commit

Permalink
GEOMESA-3423 - add test
Browse files Browse the repository at this point in the history
  • Loading branch information
autodidacticon committed Dec 10, 2024
1 parent de7d91b commit c0ffb7d
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,40 @@ class PartitionedPostgisDataStoreTest extends Specification with BeforeAfterAll
ok
}

"create logged tables" in {
val ds = DataStoreFinder.getDataStore(params.asJava)
ds must not(beNull)

try {
val sft = SimpleFeatureTypes.renameSft(this.sft, "logged_test")

ds.createSchema(sft)

val typeInfo: TypeInfo = TypeInfo(this.schema, sft)

Seq(
typeInfo.tables.mainPartitions.name.raw,
typeInfo.tables.writeAheadPartitions.name.raw,
typeInfo.tables.spillPartitions.name.raw,
typeInfo.tables.analyzeQueue.name.raw,
typeInfo.tables.sortQueue.name.raw).forall { tableName =>
val sql = isTableLoggedQuery(tableName, "public")
// verify that the table is logged
WithClose(ds.asInstanceOf[JDBCDataStore].getConnection(Transaction.AUTO_COMMIT)) { cx =>
WithClose(cx.createStatement()) { st =>
WithClose(st.executeQuery(sql)) { rs =>
rs.next() must beTrue
logger.info(s"Table ${rs.getString("table_name")} is ${rs.getString("table_name")}")
rs.getString("table_type") mustEqual "permanent"
}
}
}
}
} finally {
ds.dispose()
}
}

"create unlogged tables" in {
val ds = DataStoreFinder.getDataStore(params.asJava)
ds must not(beNull)
Expand Down

0 comments on commit c0ffb7d

Please sign in to comment.