ConditionImpl extends RelationalChildRestrictedObject implements Condition { @Override public Permission getParent( final UnitOfWork transaction ) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); ArgCheck.isTrue( ( transaction.getState() == State.NOT_STARTED ), "transaction state must be NOT_STARTED" ); final KomodoObject grouping = super.getParent( transaction ); final Permission result = Permission.RESOLVER.resolve( transaction, grouping.getParent( transaction ) ); return result; } ConditionImpl( final UnitOfWork uow,
                          final Repository repository,
                          final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override Permission getParent( final UnitOfWork transaction ); @Override int getTypeId(); @Override boolean isConstraint( final UnitOfWork uow ); @Override void setConstraint( final UnitOfWork uow,
                               final boolean newConstraint );  }
@Test public void shouldFailConstructionIfNotCondition() { if ( RelationalObjectImpl.VALIDATE_INITIAL_STATE ) { try { new ConditionImpl( getTransaction(), _repo, this.condition.getParent( getTransaction() ).getAbsolutePath() ); fail(); } catch ( final KException e ) { } } }
@Test public void shouldHaveParentPermission() throws Exception { assertThat( this.condition.getParent( getTransaction() ), is( instanceOf( Permission.class ) ) ); }