Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ppanopticon committed Jan 17, 2024
2 parents be57a61 + 311a8e9 commit 317e7e6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ abstract class AbstractDatabaseTest {
*/
@AfterEach
protected open fun teardown() {
this.catalogue.close()
TxFileUtilities.delete(this.config.root)
this.execution.shutdownAndWait()
this.manager.shutdown()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.nio.file.Files
* An abstract class for test cases that test for correctness of serialization
*
* @author Ralph Gasser
* @version 1.5.0
* @version 1.5.1
*/
abstract class AbstractSerializationTest: AbstractEntityTest() {

Expand Down Expand Up @@ -93,18 +93,23 @@ abstract class AbstractSerializationTest: AbstractEntityTest() {

/* Start inserting. */
val txn = this.manager.startTransaction(TransactionType.SYSTEM_EXCLUSIVE)
val ctx = DefaultQueryContext("serialization-populate", this.catalogue, txn)
val catalogueTx = this.catalogue.newTx(ctx)
val schema = catalogueTx.schemaForName(this.schemaName)
val schemaTx = schema.newTx(ctx)
val entity = schemaTx.entityForName(this.entityName)
val entityTx = entity.newTx(ctx)

/* Insert data and track how many entries have been stored for the test later. */
repeat(TestConstants.TEST_COLLECTION_SIZE) {
entityTx.insert(nextRecord(it))
try {
val ctx = DefaultQueryContext("serialization-populate", this.catalogue, txn)
val catalogueTx = this.catalogue.newTx(ctx)
val schema = catalogueTx.schemaForName(this.schemaName)
val schemaTx = schema.newTx(ctx)
val entity = schemaTx.entityForName(this.entityName)
val entityTx = entity.newTx(ctx)

/* Insert data and track how many entries have been stored for the test later. */
repeat(TestConstants.TEST_COLLECTION_SIZE) {
entityTx.insert(nextRecord(it))
}
txn.commit()
} catch (e: Throwable) {
txn.rollback()
throw e
}
txn.commit()
}

/**
Expand Down

0 comments on commit 317e7e6

Please sign in to comment.