GSATestUtils.getGSATestUtils().initializeMinimalConfigpath(
configpath, "/SimpleRepository", definitionFiles, props, null, null, null, false
);
// Start Nucleus
Nucleus n = startNucleus(configpath);
TransactionDemarcation td = new TransactionDemarcation();
MutableRepository r = (MutableRepository) n.resolveName("/SimpleRepository");
try {
// Start a new transaction
td.begin(((GSARepository) r).getTransactionManager());
// Create the item
MutableRepositoryItem item = r.createItem("simpleItem");
item.setPropertyValue("name", "simpleName");
// Persist to the repository
r.addItem(item);
// Try to get it back from the repository
String id = item.getRepositoryId();
RepositoryItem item2 = r.getItem(id, "simpleItem");
assertNotNull(
" We did not get back the item just created from the repository.", item2
);
rollback = false;
} finally {
// End the transaction, rollback on error
td.end(rollback);
// shut down Nucleus
n.stopService();
// Shut down HSQLDB
db.shutdown();
}
}