VdbImpl extends RelationalObjectImpl implements Vdb { @Override public Descriptor getPrimaryType( final UnitOfWork transaction ) throws KException { return new PrimaryTypeDescriptor( getRepository(), super.getPrimaryType( transaction ) ); } VdbImpl( final UnitOfWork uow,
                    final Repository repository,
                    final String workspacePath ); @Override KomodoType getTypeIdentifier(UnitOfWork uow); @Override DataRole addDataRole( final UnitOfWork transaction,
                                 final String dataRoleName ); @Override Entry addEntry( final UnitOfWork transaction,
                           final String entryName,
                           final String entryPath ); @Override VdbImport addImport( final UnitOfWork transaction,
                                final String vdbName ); @Override Model addModel( final UnitOfWork transaction,
                           final String modelName ); @Override Translator addTranslator( final UnitOfWork transaction,
                                     final String translatorName,
                                     final String translatorType ); @Override VdbManifest createManifest( final UnitOfWork transaction,
                                       final Properties properties ); @Override byte[] export( final UnitOfWork transaction,
                          final Properties properties ); @Override String getAllowedLanguages( final UnitOfWork transaction ); @Override String getAuthenticationType( final UnitOfWork transaction ); @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 getConnectionType( final UnitOfWork uow ); @Override DataRole[] getDataRoles( final UnitOfWork transaction,
                                    final String... namePatterns ); @Override String getDescription( final UnitOfWork uow ); @Override Entry[] getEntries( final UnitOfWork transaction,
                               final String... namePatterns ); @Override String getGssPattern( final UnitOfWork transaction ); @Override VdbImport[] getImports( final UnitOfWork transaction,
                                   final String... namePatterns ); @Override Model[] getModels( final UnitOfWork transaction,
                              final String... namePatterns ); @Override String getOriginalFilePath( final UnitOfWork uow ); @Override String getPasswordPattern( final UnitOfWork transaction ); @Override PropertyDescriptor getPropertyDescriptor( final UnitOfWork transaction,
                                                     final String propName ); @Override Descriptor getPrimaryType( final UnitOfWork transaction ); @Override int getQueryTimeout( final UnitOfWork transaction ); @Override String getSecurityDomain( final UnitOfWork transaction ); @Override Translator[] getTranslators( final UnitOfWork transaction,
                                        final String... namePatterns ); @Override int getTypeId(); @Override String getVdbName( final UnitOfWork uow ); @Override int getVersion( final UnitOfWork uow ); @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 isPreview( final UnitOfWork uow ); @Override void removeDataRole( final UnitOfWork transaction,
                                final String dataRoleToRemove ); @Override void removeEntry( final UnitOfWork transaction,
                             final String entryToRemove ); @Override void removeImport( final UnitOfWork transaction,
                              final String importToRemove ); @Override void removeModel( final UnitOfWork transaction,
                             final String modelToRemove ); @Override void removeTranslator( final UnitOfWork transaction,
                                  final String translatorToRemove ); @Override void rename( final UnitOfWork transaction,
                        final String newName ); @Override void setAllowedLanguages( final UnitOfWork transaction,
                                     final String newAllowedLanguages ); @Override void setAuthenticationType( final UnitOfWork transaction,
                                       final String newAuthenticationType ); @Override void setConnectionType( final UnitOfWork uow,
                                   final String newConnectionType ); @Override void setDescription( final UnitOfWork uow,
                                final String newDescription ); @Override void setGssPattern( final UnitOfWork transaction,
                               final String newGssPattern ); @Override void setOriginalFilePath( final UnitOfWork uow,
                                     final String newOriginalFilePath ); @Override void setPasswordPattern( final UnitOfWork transaction,
                                    final String newPasswordPattern ); @Override void setPreview( final UnitOfWork uow,
                            final boolean newPreview ); @Override void setQueryTimeout( final UnitOfWork transaction,
                                 final int newQueryTimeout ); @Override void setSecurityDomain( final UnitOfWork transaction,
                                   final String newSecurityDomain ); @Override void setVdbName( final UnitOfWork uow,
                            final String newVdbName ); @Override void setVersion( final UnitOfWork uow,
                            final int newVersion ); @Override DocumentType getDocumentType(UnitOfWork transaction); @Override DeployStatus deploy(UnitOfWork uow, Teiid teiid);  }
@Test public void shouldHaveCorrectPrimaryType() throws Exception { assertThat( this.vdb.getPrimaryType( getTransaction() ).getName(), is( VdbLexicon.Vdb.VIRTUAL_DATABASE ) ); }
@Test public void shouldIncludeSpecialPropertiesInPrimaryTypePropertyDescriptors() throws Exception { final PropertyDescriptor[] descriptors = this.vdb.getPrimaryType( getTransaction() ).getPropertyDescriptors( getTransaction() ); final List< String > specialProps = new ArrayList<>( Arrays.asList( VdbImpl.SpecialProperty.valuesAsTeiidNames() ) ); assertThat( descriptors.length > specialProps.size(), is( true ) ); for ( final PropertyDescriptor descriptor : descriptors ) { if ( specialProps.contains( descriptor.getName() ) ) { specialProps.remove( descriptor.getName() ); } } assertThat( specialProps.isEmpty(), is( true ) ); }