DataRoleImpl extends RelationalObjectImpl implements DataRole { @Override public Vdb 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 Vdb result = Vdb.RESOLVER.resolve( transaction, grouping.getParent( transaction ) ); return result; } DataRoleImpl( final UnitOfWork uow,
                         final Repository repository,
                         final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override String[] addMappedRole( final UnitOfWork transaction,
                                   final String roleNameToAdd ); @Override Permission addPermission( final UnitOfWork transaction,
                                     final String permissionName ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name ); @Override KomodoObject getChild( final UnitOfWork transaction,
                                  final String name,
                                  final String typeName ); @Override KomodoObject[] getChildren( final UnitOfWork transaction,
                                       final String... namePatterns ); @Override KomodoObject[] getChildrenOfType( final UnitOfWork transaction,
                                             final String type,
                                             final String... namePatterns ); @Override KomodoType[] getChildTypes(); @Override String getDescription( final UnitOfWork uow ); @Override String[] getMappedRoles( final UnitOfWork transaction,
                                    final String... namePatterns ); @Override Vdb getParent( final UnitOfWork transaction ); @Override Permission[] getPermissions( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override int getTypeId(); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name ); @Override boolean hasChild( final UnitOfWork transaction,
                             final String name,
                             final String typeName ); @Override boolean hasChildren( final UnitOfWork transaction ); @Override boolean isAllowCreateTempTables( final UnitOfWork uow ); @Override boolean isAnyAuthenticated( final UnitOfWork uow ); @Override boolean isGrantAll( final UnitOfWork uow ); @Override String[] removeMappedRole( final UnitOfWork transaction,
                                      final String roleNameToRemove ); @Override void removePermission( final UnitOfWork transaction,
                                  final String permissionToRemove ); @Override void setAllowCreateTempTables( final UnitOfWork uow,
                                          final boolean newAllowCreateTempTables ); @Override void setAnyAuthenticated( final UnitOfWork uow,
                                     final boolean newAnyAuthenticated ); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setGrantAll( final UnitOfWork uow,
                             final boolean newGrantAll );  }
@Test public void shouldFailConstructionIfNotDataRole() { if ( RelationalObjectImpl.VALIDATE_INITIAL_STATE ) { try { new DataRoleImpl( getTransaction(), _repo, this.dataRole.getParent( getTransaction() ).getAbsolutePath() ); fail(); } catch ( final KException e ) { } } }
@Test public void shouldHaveParentVdb() throws Exception { assertThat( this.dataRole.getParent( getTransaction() ), is( instanceOf( Vdb.class ) ) ); }