use of org.qi4j.api.unitofwork.UnitOfWorkFactory in project qi4j-sdk by Qi4j.
the class Qi95IssueTest method canCreateAndQueryWithInMemoryRdfWithJdbm.
@Test
public void canCreateAndQueryWithInMemoryRdfWithJdbm() throws Exception {
Application application = createApplication(inMemoryRdf, jdbmStore, domain);
try {
application.activate();
Module domain = application.findModule("Domain", "Domain");
UnitOfWorkFactory unitOfWorkFactory = domain;
createABunchOfStuffAndDoQueries(unitOfWorkFactory, domain);
} finally {
application.passivate();
}
}
use of org.qi4j.api.unitofwork.UnitOfWorkFactory in project qi4j-sdk by Qi4j.
the class Qi95IssueTest method canCreateAndQueryWithNativeRdfWithInMemoryStore.
@Test
public void canCreateAndQueryWithNativeRdfWithInMemoryStore() throws Exception {
Application application = createApplication(nativeRdf, inMemoryStore, domain);
try {
application.activate();
Module domain = application.findModule("Domain", "Domain");
UnitOfWorkFactory unitOfWorkFactory = domain;
createABunchOfStuffAndDoQueries(unitOfWorkFactory, domain);
} finally {
application.passivate();
}
}
use of org.qi4j.api.unitofwork.UnitOfWorkFactory in project qi4j-sdk by Qi4j.
the class PostgreSQLEntityStorePerformanceTest method cleanUp.
@Override
protected void cleanUp() throws Exception {
try {
super.cleanUp();
} finally {
Energy4Java qi4j = new Energy4Java();
Assembler[][][] assemblers = new Assembler[][][] { { { createAssembler() } } };
Application application = qi4j.newApplication(new ApplicationAssemblerAdapter(assemblers) {
});
application.activate();
Module moduleInstance = application.findModule("Layer 1", "config");
UnitOfWorkFactory uowf = moduleInstance;
UnitOfWork uow = uowf.newUnitOfWork();
try {
SQLConfiguration config = uow.get(SQLConfiguration.class, PostgreSQLEntityStoreAssembler.DEFAULT_ENTITYSTORE_IDENTITY);
// TODO fix AbstractEntityStorePerformanceTest to extend from AbstractQi4jTest
// SQLUtil.getConnection( this.serviceLocator );
Connection connection = null;
String schemaName = config.schemaName().get();
if (schemaName == null) {
schemaName = SQLs.DEFAULT_SCHEMA_NAME;
}
Statement stmt = null;
try {
stmt = connection.createStatement();
stmt.execute(String.format("DELETE FROM %s." + SQLs.TABLE_NAME, schemaName));
connection.commit();
} finally {
SQLUtil.closeQuietly(stmt);
}
} finally {
uow.discard();
}
}
}
use of org.qi4j.api.unitofwork.UnitOfWorkFactory in project qi4j-sdk by Qi4j.
the class Qi95IssueTest method canCreateAndQueryWithNativeRdfAndJdbm.
@Test
public void canCreateAndQueryWithNativeRdfAndJdbm() throws Exception {
Application application = createApplication(nativeRdf, jdbmStore, domain);
try {
application.activate();
Module domain = application.findModule("Domain", "Domain");
UnitOfWorkFactory unitOfWorkFactory = domain;
createABunchOfStuffAndDoQueries(unitOfWorkFactory, domain);
} finally {
application.passivate();
}
}
use of org.qi4j.api.unitofwork.UnitOfWorkFactory in project qi4j-sdk by Qi4j.
the class Qi95IssueTest method canCreateAndQueryWithAllInMemory.
@Test
public void canCreateAndQueryWithAllInMemory() throws Exception {
Application application = createApplication(inMemoryRdf, inMemoryStore, domain);
try {
application.activate();
Module domain = application.findModule("Domain", "Domain");
UnitOfWorkFactory unitOfWorkFactory = domain;
createABunchOfStuffAndDoQueries(unitOfWorkFactory, domain);
} finally {
application.passivate();
}
}
Aggregations