@Test public void shouldIncludeOptionsWithPropertyNames() throws Exception { final String custom = "blah"; this.function.setStatementOption( getTransaction(), custom, "sledge" ); boolean customFound = false; final String standard = this.function.getStandardOptions().keySet().iterator().next(); this.function.setStatementOption( getTransaction(), standard, "hammer" ); boolean standardFound = false; for ( final String prop : this.function.getPropertyNames( getTransaction() ) ) { if ( custom.equals( prop ) ) { if ( customFound ) { fail( "Custom option included multiple times in property names" ); } customFound = true; } else if ( standard.equals( prop ) ) { if ( standardFound ) { fail( "Standard option included multiple times in property names" ); } standardFound = true; } if ( customFound && standardFound ) { break; } } if ( !customFound ) { fail( "Custom option not included in property names" ); } if ( !standardFound ) { fail( "Standard option not included in property names" ); } }
@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 );  }