use of org.qi4j.api.unitofwork.UnitOfWork in project qi4j-sdk by Qi4j.
the class TransientVisibilityTest method givenFromEntityWhenAccessingBesideLayerVisibleExpectSuccess.
@Test
public void givenFromEntityWhenAccessingBesideLayerVisibleExpectSuccess() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
FromEntity entity = unitOfWork.newEntity(FromEntity.class, "123");
entity.besideLayerVisible();
} finally {
if (unitOfWork.isOpen()) {
unitOfWork.discard();
}
}
}
use of org.qi4j.api.unitofwork.UnitOfWork in project qi4j-sdk by Qi4j.
the class TransientVisibilityTest method givenFromEntityWhenAccessingBelowApplicationVisibleExpectSuccess.
@Test
public void givenFromEntityWhenAccessingBelowApplicationVisibleExpectSuccess() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
FromEntity entity = unitOfWork.newEntity(FromEntity.class, "123");
entity.belowApplicationVisible();
} finally {
if (unitOfWork.isOpen()) {
unitOfWork.discard();
}
}
}
use of org.qi4j.api.unitofwork.UnitOfWork in project qi4j-sdk by Qi4j.
the class TransientVisibilityTest method givenFromEntityWhenAccessingAboveLayerVisibleExpectException.
@Test(expected = NoSuchTransientException.class)
public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
FromEntity entity = unitOfWork.newEntity(FromEntity.class, "123");
entity.aboveLayerVisible();
} finally {
if (unitOfWork.isOpen()) {
unitOfWork.discard();
}
}
}
use of org.qi4j.api.unitofwork.UnitOfWork in project qi4j-sdk by Qi4j.
the class TransientVisibilityTest method givenFromEntityWhenAccessingModuleModuleVisibleExpectSuccess.
@Test
public void givenFromEntityWhenAccessingModuleModuleVisibleExpectSuccess() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
FromEntity entity = unitOfWork.newEntity(FromEntity.class, "123");
entity.moduleModuleVisible();
} finally {
if (unitOfWork.isOpen()) {
unitOfWork.discard();
}
}
}
use of org.qi4j.api.unitofwork.UnitOfWork in project qi4j-sdk by Qi4j.
the class TransientVisibilityTest method givenFromEntityWhenAccessingAboveApplicationVisibleExpectException.
@Test(expected = NoSuchTransientException.class)
public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException() {
UnitOfWork unitOfWork = module.newUnitOfWork();
try {
FromEntity entity = unitOfWork.newEntity(FromEntity.class, "123");
entity.aboveApplicationVisible();
} finally {
if (unitOfWork.isOpen()) {
unitOfWork.discard();
}
}
}
Aggregations