Hey,
I think QI-59 is fixed now. EntityPropertiInstance simply calls
super.set(aNewValue), which will invoke the constraints checking in
PropertyInstance.
Testcase that now works:
@Test
public void
givenEntityWithConstrainedPropertyWhenInvalidPropertyValueSetThenThrowException()
{
UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
try
{
TestCase testCase = uow.newEntity( TestCase.class );
testCase.someProperty().set( null );
uow.complete();
fail( "Should not be allowed to set invalid property value" );
}
catch( Exception e )
{
uow.discard();
}
}
interface TestCase
extends EntityComposite
{
@NotNull Property<String> someProperty();
}
---
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev