@Test public void testAddNameChangedListener() throws Exception { meta.fireNameChangedListeners( "a", "a" ); meta.fireNameChangedListeners( "a", "b" ); meta.addNameChangedListener( null ); meta.fireNameChangedListeners( "a", "b" ); NameChangedListener listener = mock( NameChangedListener.class ); meta.addNameChangedListener( listener ); meta.fireNameChangedListeners( "b", "a" ); verify( listener, times( 1 ) ).nameChanged( meta, "b", "a" ); meta.removeNameChangedListener( null ); meta.removeNameChangedListener( listener ); meta.fireNameChangedListeners( "b", "a" ); verifyNoMoreInteractions( listener ); }
public void addNameChangedListener( NameChangedListener listener ) { if ( nameChangedListeners == null ) { nameChangedListeners = new ArrayList<NameChangedListener>(); } if ( listener != null ) { nameChangedListeners.add( listener ); } }
AbstractMeta implements ChangedFlagInterface, UndoInterface, HasDatabasesInterface, VariableSpace,
  EngineMetaInterface, NamedParams, HasSlaveServersInterface, AttributesInterface, HasRepositoryInterface,
  LoggingObjectInterface { public void addNameChangedListener( NameChangedListener listener ) { if ( nameChangedListeners == null ) { nameChangedListeners = new ArrayList<NameChangedListener>(); } if ( listener != null ) { nameChangedListeners.add( listener ); } } }
AbstractMeta implements ChangedFlagInterface, UndoInterface, HasDatabasesInterface, VariableSpace,
  EngineMetaInterface, NamedParams, HasSlaveServersInterface, AttributesInterface, HasRepositoryInterface,
  LoggingObjectInterface { public void addNameChangedListener( NameChangedListener listener ) { if ( nameChangedListeners == null ) { nameChangedListeners = new ArrayList<NameChangedListener>(); } if ( listener != null ) { nameChangedListeners.add( listener ); } }  }
AbstractMeta implements ChangedFlagInterface, UndoInterface, HasDatabasesInterface, VariableSpace,
  EngineMetaInterface, NamedParams, HasSlaveServersInterface, AttributesInterface, HasRepositoryInterface,
  LoggingObjectInterface { public void addNameChangedListener( NameChangedListener listener ) { if ( nameChangedListeners == null ) { nameChangedListeners = new ArrayList<NameChangedListener>(); } if ( listener != null ) { nameChangedListeners.add( listener ); } }  boolean isShowDialog(); void setShowDialog( boolean showDialog ); boolean isAlwaysShowRunOptions(); void setAlwaysShowRunOptions( boolean alwaysShowRunOptions ); @Override ObjectId getObjectId(); @Override void setObjectId( ObjectId objectId ); @Override String getContainerObjectId(); void setCarteObjectId( String containerObjectId ); @Override String getName(); @Override void setName( String newName ); @Override String getDescription(); @Override void setDescription( String description ); String getExtendedDescription(); void setExtendedDescription( String extendedDescription ); @Override void nameFromFilename(); @Override String getFilename(); @Override void setFilename( String newFilename ); @Override RepositoryDirectoryInterface getRepositoryDirectory(); @Override void setRepositoryDirectory( RepositoryDirectoryInterface directory ); @Override Repository getRepository(); @Override void setRepository( Repository repository ); @Override void setInternalKettleVariables(); abstract void setInternalKettleVariables( VariableSpace var ); @Override DatabaseMeta findDatabase( String name ); @Override int nrDatabases(); @Override DatabaseMeta getDatabase( int i ); void importFromMetaStore(); void addNameChangedListener( NameChangedListener listener ); void removeNameChangedListener( NameChangedListener listener ); void clearNameChangedListeners(); void addFilenameChangedListener( FilenameChangedListener listener ); void removeFilenameChangedListener( FilenameChangedListener listener ); void addContentChangedListener( ContentChangedListener listener ); void removeContentChangedListener( ContentChangedListener listener ); List<ContentChangedListener> getContentChangedListeners(); void addOrReplaceSlaveServer( SlaveServer slaveServer ); @Override List<SlaveServer> getSlaveServers(); void setSlaveServers( List<SlaveServer> slaveServers ); SlaveServer findSlaveServer( String serverString ); String[] getSlaveServerNames(); @Override void addUndo( Object[] from, Object[] to, int[] pos, Point[] prev, Point[] curr, int type_of_change,
                       boolean nextAlso ); void clearUndo(); @Override TransAction nextUndo(); @Override TransAction viewNextUndo(); @Override TransAction previousUndo(); @Override TransAction viewThisUndo(); @Override TransAction viewPreviousUndo(); @Override int getMaxUndo(); @Override void setMaxUndo( int mu ); int getUndoSize(); EmbeddedMetaStore getEmbeddedMetaStore(); @Override void setAttributesMap( Map<String, Map<String, String>> attributesMap ); @Override Map<String, Map<String, String>> getAttributesMap(); @Override void setAttribute( String groupName, String key, String value ); @Override void setAttributes( String groupName, Map<String, String> attributes ); @Override Map<String, String> getAttributes( String groupName ); @Override String getAttribute( String groupName, String key ); void addNote( int p, NotePadMeta ni ); void addNote( NotePadMeta ni ); NotePadMeta getNote( int x, int y ); NotePadMeta getNote( int i ); List<NotePadMeta> getNotes(); List<NotePadMeta> getSelectedNotes(); int indexOfNote( NotePadMeta ni ); void lowerNote( int p ); int nrNotes(); void raiseNote( int p ); void removeNote( int i ); boolean haveNotesChanged(); int[] getNoteIndexes( List<NotePadMeta> notes ); ChannelLogTable getChannelLogTable(); @Override void addOrReplaceDatabase( DatabaseMeta databaseMeta ); @Override void addDatabase( DatabaseMeta ci ); @Override void addDatabase( int p, DatabaseMeta ci ); @Override List<DatabaseMeta> getDatabases(); String[] getDatabaseNames(); @Override int indexOfDatabase( DatabaseMeta di ); @Override void setDatabases( List<DatabaseMeta> databases ); @Override boolean haveConnectionsChanged(); @Override void removeDatabase( int i ); void clearChangedDatabases(); void setChannelLogTable( ChannelLogTable channelLogTable ); @Override void copyVariablesFrom( VariableSpace space ); @Override String environmentSubstitute( String aString ); @Override String[] environmentSubstitute( String[] aString ); @Override String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); @Override VariableSpace getParentVariableSpace(); @Override void setParentVariableSpace( VariableSpace parent ); @Override String getVariable( String variableName, String defaultValue ); @Override String getVariable( String variableName ); @Override boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); @Override void initializeVariablesFrom( VariableSpace parent ); @Override String[] listVariables(); @Override void setVariable( String variableName, String variableValue ); @Override void shareVariablesWith( VariableSpace space ); @Override void injectVariables( Map<String, String> prop ); @Override void addParameterDefinition( String key, String defValue, String description ); @Override String getParameterDescription( String key ); @Override String getParameterDefault( String key ); @Override String getParameterValue( String key ); @Override String[] listParameters(); @Override void setParameterValue( String key, String value ); @Override void eraseParameters(); @Override void clearParameters(); @Override void copyParametersFrom( NamedParams params ); @Override void activateParameters(); @Override LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); IMetaStore getMetaStore(); void setMetaStore( IMetaStore metaStore ); String getSharedObjectsFile(); void setSharedObjectsFile( String sharedObjectsFile ); SharedObjects getSharedObjects(); void setSharedObjects( SharedObjects sharedObjects ); SharedObjects readSharedObjects(); @Override Date getCreatedDate(); @Override void setCreatedDate( Date createdDate ); @Override void setCreatedUser( String createdUser ); @Override String getCreatedUser(); @Override void setModifiedDate( Date modifiedDate ); @Override Date getModifiedDate(); @Override void setModifiedUser( String modifiedUser ); @Override String getModifiedUser(); void clear(); @Override void clearChanged(); @Override void setChanged(); @Override final void setChanged( boolean ch ); void addObserver( PDIObserver o ); void deleteObserver( PDIObserver o ); void notifyObservers( Object arg ); @Override boolean canSave(); @Override boolean hasChanged(); @Override Date getRegistrationDate(); @Override LoggingObjectInterface getParent(); @Override String getObjectName(); @Override String getObjectCopy(); @Override ObjectRevision getObjectRevision(); @Override void setObjectRevision( ObjectRevision objectRevision ); boolean hasMissingPlugins(); Set<String> getPrivateDatabases(); void setPrivateDatabases( Set<String> privateDatabases ); void saveSharedObjects(); @Deprecated void saveMetaStoreObjects( Repository repository, IMetaStore metaStore ); @Override int hashCode(); NamedClusterServiceOsgi getNamedClusterServiceOsgi(); void setNamedClusterServiceOsgi( NamedClusterServiceOsgi namedClusterServiceOsgi ); MetastoreLocatorOsgi getMetastoreLocatorOsgi(); void setMetastoreLocatorOsgi( MetastoreLocatorOsgi metastoreLocatorOsgi ); NamedClusterEmbedManager getNamedClusterEmbedManager( ); void disposeEmbeddedMetastoreProvider(); String getEmbeddedMetastoreProviderKey(); void setEmbeddedMetastoreProviderKey( String embeddedMetastoreProviderKey ); }
AbstractMeta implements ChangedFlagInterface, UndoInterface, HasDatabasesInterface, VariableSpace,
  EngineMetaInterface, NamedParams, HasSlaveServersInterface, AttributesInterface, HasRepositoryInterface,
  LoggingObjectInterface { public void addNameChangedListener( NameChangedListener listener ) { if ( nameChangedListeners == null ) { nameChangedListeners = new ArrayList<NameChangedListener>(); } if ( listener != null ) { nameChangedListeners.add( listener ); } }  boolean isShowDialog(); void setShowDialog( boolean showDialog ); boolean isAlwaysShowRunOptions(); void setAlwaysShowRunOptions( boolean alwaysShowRunOptions ); @Override ObjectId getObjectId(); @Override void setObjectId( ObjectId objectId ); @Override String getContainerObjectId(); void setCarteObjectId( String containerObjectId ); @Override String getName(); @Override void setName( String newName ); @Override String getDescription(); @Override void setDescription( String description ); String getExtendedDescription(); void setExtendedDescription( String extendedDescription ); @Override void nameFromFilename(); @Override String getFilename(); @Override void setFilename( String newFilename ); @Override RepositoryDirectoryInterface getRepositoryDirectory(); @Override void setRepositoryDirectory( RepositoryDirectoryInterface directory ); @Override Repository getRepository(); @Override void setRepository( Repository repository ); @Override void setInternalKettleVariables(); abstract void setInternalKettleVariables( VariableSpace var ); @Override DatabaseMeta findDatabase( String name ); @Override int nrDatabases(); @Override DatabaseMeta getDatabase( int i ); void importFromMetaStore(); void addNameChangedListener( NameChangedListener listener ); void removeNameChangedListener( NameChangedListener listener ); void clearNameChangedListeners(); void addFilenameChangedListener( FilenameChangedListener listener ); void removeFilenameChangedListener( FilenameChangedListener listener ); void addContentChangedListener( ContentChangedListener listener ); void removeContentChangedListener( ContentChangedListener listener ); List<ContentChangedListener> getContentChangedListeners(); void addOrReplaceSlaveServer( SlaveServer slaveServer ); @Override List<SlaveServer> getSlaveServers(); void setSlaveServers( List<SlaveServer> slaveServers ); SlaveServer findSlaveServer( String serverString ); String[] getSlaveServerNames(); @Override void addUndo( Object[] from, Object[] to, int[] pos, Point[] prev, Point[] curr, int type_of_change,
                       boolean nextAlso ); void clearUndo(); @Override TransAction nextUndo(); @Override TransAction viewNextUndo(); @Override TransAction previousUndo(); @Override TransAction viewThisUndo(); @Override TransAction viewPreviousUndo(); @Override int getMaxUndo(); @Override void setMaxUndo( int mu ); int getUndoSize(); EmbeddedMetaStore getEmbeddedMetaStore(); @Override void setAttributesMap( Map<String, Map<String, String>> attributesMap ); @Override Map<String, Map<String, String>> getAttributesMap(); @Override void setAttribute( String groupName, String key, String value ); @Override void setAttributes( String groupName, Map<String, String> attributes ); @Override Map<String, String> getAttributes( String groupName ); @Override String getAttribute( String groupName, String key ); void addNote( int p, NotePadMeta ni ); void addNote( NotePadMeta ni ); NotePadMeta getNote( int x, int y ); NotePadMeta getNote( int i ); List<NotePadMeta> getNotes(); List<NotePadMeta> getSelectedNotes(); int indexOfNote( NotePadMeta ni ); void lowerNote( int p ); int nrNotes(); void raiseNote( int p ); void removeNote( int i ); boolean haveNotesChanged(); int[] getNoteIndexes( List<NotePadMeta> notes ); ChannelLogTable getChannelLogTable(); @Override void addOrReplaceDatabase( DatabaseMeta databaseMeta ); @Override void addDatabase( DatabaseMeta ci ); @Override void addDatabase( int p, DatabaseMeta ci ); @Override List<DatabaseMeta> getDatabases(); String[] getDatabaseNames(); @Override int indexOfDatabase( DatabaseMeta di ); @Override void setDatabases( List<DatabaseMeta> databases ); @Override boolean haveConnectionsChanged(); @Override void removeDatabase( int i ); void clearChangedDatabases(); void setChannelLogTable( ChannelLogTable channelLogTable ); @Override void copyVariablesFrom( VariableSpace space ); @Override String environmentSubstitute( String aString ); @Override String[] environmentSubstitute( String[] aString ); @Override String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); @Override VariableSpace getParentVariableSpace(); @Override void setParentVariableSpace( VariableSpace parent ); @Override String getVariable( String variableName, String defaultValue ); @Override String getVariable( String variableName ); @Override boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); @Override void initializeVariablesFrom( VariableSpace parent ); @Override String[] listVariables(); @Override void setVariable( String variableName, String variableValue ); @Override void shareVariablesWith( VariableSpace space ); @Override void injectVariables( Map<String, String> prop ); @Override void addParameterDefinition( String key, String defValue, String description ); @Override String getParameterDescription( String key ); @Override String getParameterDefault( String key ); @Override String getParameterValue( String key ); @Override String[] listParameters(); @Override void setParameterValue( String key, String value ); @Override void eraseParameters(); @Override void clearParameters(); @Override void copyParametersFrom( NamedParams params ); @Override void activateParameters(); @Override LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); IMetaStore getMetaStore(); void setMetaStore( IMetaStore metaStore ); String getSharedObjectsFile(); void setSharedObjectsFile( String sharedObjectsFile ); SharedObjects getSharedObjects(); void setSharedObjects( SharedObjects sharedObjects ); SharedObjects readSharedObjects(); @Override Date getCreatedDate(); @Override void setCreatedDate( Date createdDate ); @Override void setCreatedUser( String createdUser ); @Override String getCreatedUser(); @Override void setModifiedDate( Date modifiedDate ); @Override Date getModifiedDate(); @Override void setModifiedUser( String modifiedUser ); @Override String getModifiedUser(); void clear(); @Override void clearChanged(); @Override void setChanged(); @Override final void setChanged( boolean ch ); void addObserver( PDIObserver o ); void deleteObserver( PDIObserver o ); void notifyObservers( Object arg ); @Override boolean canSave(); @Override boolean hasChanged(); @Override Date getRegistrationDate(); @Override LoggingObjectInterface getParent(); @Override String getObjectName(); @Override String getObjectCopy(); @Override ObjectRevision getObjectRevision(); @Override void setObjectRevision( ObjectRevision objectRevision ); boolean hasMissingPlugins(); Set<String> getPrivateDatabases(); void setPrivateDatabases( Set<String> privateDatabases ); void saveSharedObjects(); @Deprecated void saveMetaStoreObjects( Repository repository, IMetaStore metaStore ); @Override int hashCode(); NamedClusterServiceOsgi getNamedClusterServiceOsgi(); void setNamedClusterServiceOsgi( NamedClusterServiceOsgi namedClusterServiceOsgi ); MetastoreLocatorOsgi getMetastoreLocatorOsgi(); void setMetastoreLocatorOsgi( MetastoreLocatorOsgi metastoreLocatorOsgi ); NamedClusterEmbedManager getNamedClusterEmbedManager( ); void disposeEmbeddedMetastoreProvider(); String getEmbeddedMetastoreProviderKey(); void setEmbeddedMetastoreProviderKey( String embeddedMetastoreProviderKey ); static final int TYPE_UNDO_CHANGE; static final int TYPE_UNDO_NEW; static final int TYPE_UNDO_DELETE; static final int TYPE_UNDO_POSITION; }