@Test public void shouldIncludeStandardOptionDefaultValuesWithPropertyDescriptors() throws Exception { final Map< String, String > options = this.function.getStandardOptions(); final PropertyDescriptor[] propDescriptors = this.function.getPropertyDescriptors( getTransaction() ); for ( final Entry< String, String > entry : options.entrySet() ) { for ( final PropertyDescriptor descriptor : propDescriptors ) { if ( entry.getKey().equals( descriptor.getName() ) ) { final String value = entry.getValue(); final Object[] defaultValues = descriptor.getDefaultValues(); if ( StringUtils.isBlank( value ) ) { assertThat( defaultValues.length, is( 0 ) ); } else { assertThat( defaultValues.length, is( 1 ) ); assertThat( value, is( defaultValues[0] ) ); } } } } }
@Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; }
FunctionImpl extends AbstractProcedureImpl implements Function { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } }
FunctionImpl extends AbstractProcedureImpl implements Function { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } protected  FunctionImpl( final UnitOfWork uow,
                            final Repository repository,
                            final String workspacePath ); }
FunctionImpl extends AbstractProcedureImpl implements Function { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } protected  FunctionImpl( final UnitOfWork uow,
                            final Repository repository,
                            final String workspacePath ); @Override StatementOption[] getCustomOptions( final UnitOfWork transaction ); @Override Determinism getDeterminism( final UnitOfWork transaction ); @Override Map< String, String > getStandardOptions(); @Override boolean isAggregate( final UnitOfWork transaction ); @Override boolean isAllowsDistinct( final UnitOfWork transaction ); @Override boolean isAllowsOrderBy( final UnitOfWork transaction ); @Override boolean isAnalytic( final UnitOfWork transaction ); @Override boolean isDecomposable( final UnitOfWork transaction ); @Override boolean isNullOnNull( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override boolean isUsesDistinctRows( final UnitOfWork transaction ); @Override boolean isVarArgs( final UnitOfWork transaction ); @Override void setAggregate( final UnitOfWork transaction,
                              final boolean newAggregate ); @Override void setAllowsDistinct( final UnitOfWork transaction,
                                   final boolean newAllowsDistinct ); @Override void setAllowsOrderBy( final UnitOfWork transaction,
                                  final boolean newAllowsOrderBy ); @Override void setAnalytic( final UnitOfWork transaction,
                             final boolean newIsAnalytic ); @Override void setDecomposable( final UnitOfWork transaction,
                                 final boolean newDecomposable ); @Override void setDeterminism( final UnitOfWork transaction,
                                final Determinism newDeterminism ); @Override void setNullOnNull( final UnitOfWork transaction,
                               final boolean newNullOnNull ); @Override void setUsesDistinctRows( final UnitOfWork transaction,
                                     final boolean newUsesDistinctRows ); @Override void setVarArgs( final UnitOfWork transaction,
                            final boolean newVarArgs ); }
FunctionImpl extends AbstractProcedureImpl implements Function { @Override public Map< String, String > getStandardOptions() { if ( _defaultValues == null ) { final Map< String, String > superOptions = super.getStandardOptions(); final Map< String, String > options = StandardOption.defaultValues(); final Map< String, String > combined = new HashMap< >( superOptions.size() + options.size() ); combined.putAll( superOptions ); combined.putAll( options ); _defaultValues = Collections.unmodifiableMap( combined ); } return _defaultValues; } protected  FunctionImpl( final UnitOfWork uow,
                            final Repository repository,
                            final String workspacePath ); @Override StatementOption[] getCustomOptions( final UnitOfWork transaction ); @Override Determinism getDeterminism( final UnitOfWork transaction ); @Override Map< String, String > getStandardOptions(); @Override boolean isAggregate( final UnitOfWork transaction ); @Override boolean isAllowsDistinct( final UnitOfWork transaction ); @Override boolean isAllowsOrderBy( final UnitOfWork transaction ); @Override boolean isAnalytic( final UnitOfWork transaction ); @Override boolean isDecomposable( final UnitOfWork transaction ); @Override boolean isNullOnNull( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override boolean isUsesDistinctRows( final UnitOfWork transaction ); @Override boolean isVarArgs( final UnitOfWork transaction ); @Override void setAggregate( final UnitOfWork transaction,
                              final boolean newAggregate ); @Override void setAllowsDistinct( final UnitOfWork transaction,
                                   final boolean newAllowsDistinct ); @Override void setAllowsOrderBy( final UnitOfWork transaction,
                                  final boolean newAllowsOrderBy ); @Override void setAnalytic( final UnitOfWork transaction,
                             final boolean newIsAnalytic ); @Override void setDecomposable( final UnitOfWork transaction,
                                 final boolean newDecomposable ); @Override void setDeterminism( final UnitOfWork transaction,
                                final Determinism newDeterminism ); @Override void setNullOnNull( final UnitOfWork transaction,
                               final boolean newNullOnNull ); @Override void setUsesDistinctRows( final UnitOfWork transaction,
                                     final boolean newUsesDistinctRows ); @Override void setVarArgs( final UnitOfWork transaction,
                            final boolean newVarArgs );  }