ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/sound AntSoundPlayer.java
Date Thu, 25 Apr 2002 08:17:31 GMT
donaldp     02/04/25 01:17:31

  Modified:    container/src/java/org/apache/myrmidon/components/workspace
                        ProjectListenerSupport.java
               api/src/java/org/apache/myrmidon/listeners
                        AbstractProjectListener.java
                        ClassicProjectListener.java
                        DefaultProjectListener.java
                        NoPrefixProjectListener.java ProjectEvent.java
                        ProjectListener.java
               container/src/test/org/apache/myrmidon
                        LogMessageTracker.java TrackingProjectListener.java
               antlib/src/java/org/apache/antlib/sound AntSoundPlayer.java
  Removed:     api/src/java/org/apache/myrmidon/listeners LogEvent.java
                        TargetEvent.java TaskEvent.java
  Log:
  Simplify the listener infrastructure by only having one event type. Also brings it more
in line with Ant1 style of things.
  
  Revision  Changes    Path
  1.12      +49 -82    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectListenerSupport.java
  
  Index: ProjectListenerSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectListenerSupport.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ProjectListenerSupport.java	18 Mar 2002 08:53:29 -0000	1.11
  +++ ProjectListenerSupport.java	25 Apr 2002 08:17:30 -0000	1.12
  @@ -7,24 +7,20 @@
    */
   package org.apache.myrmidon.components.workspace;
   
  -import org.apache.myrmidon.listeners.LogEvent;
   import org.apache.myrmidon.listeners.ProjectListener;
   
   /**
    * Support for the project listener event dispatching.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.11 $ $Date: 2002/03/18 08:53:29 $
  + * @version $Revision: 1.12 $ $Date: 2002/04/25 08:17:30 $
    */
   class ProjectListenerSupport
  -    implements LogEvent
   {
       private ProjectListener[] m_listeners = new ProjectListener[ 0 ];
       private String m_projectName;
       private String m_targetName;
       private String m_taskName;
  -    private String m_message;
  -    private Throwable m_throwable;
   
       /**
        * Add an extra project listener that wants to receive notification of listener events.
  @@ -79,25 +75,31 @@
           m_projectName = projectName;
           m_targetName = null;
           m_taskName = null;
  +        /*
   
  -        for( int i = 0; i < m_listeners.length; i++ )
  -        {
  -            m_listeners[ i ].projectStarted( this );
  -        }
  +                final ProjectEvent event =
  +                    new ProjectEvent( null, projectName, null, null, null, null );
  +                for( int i = 0; i < m_listeners.length; i++ )
  +                {
  +                    m_listeners[ i ].projectStarted( event );
  +                }
  +        */
       }
   
       /**
        * Fire a projectFinished event.
        */
  -    public void projectFinished( final String projectName )
  +    public void projectFinished()
       {
  -        m_projectName = projectName;
  -
  -        for( int i = 0; i < m_listeners.length; i++ )
  -        {
  -            m_listeners[ i ].projectFinished( this );
  -        }
  +        /*
  +                final ProjectEvent event =
  +                    new ProjectEvent( null, m_projectName, null, null, null, null );
  +                for( int i = 0; i < m_listeners.length; i++ )
  +                {
  +                    m_listeners[ i ].projectFinished( event );
  +                }
   
  +        */
           m_projectName = null;
           m_targetName = null;
           m_taskName = null;
  @@ -111,11 +113,13 @@
           m_projectName = projectName;
           m_targetName = targetName;
           m_taskName = null;
  -
  -        for( int i = 0; i < m_listeners.length; i++ )
  -        {
  -            m_listeners[ i ].targetStarted( this );
  -        }
  +        /*
  +                final ProjectEvent event =
  +                    new ProjectEvent( null, projectName, targetName, null, null, null );
  +                for( int i = 0; i < m_listeners.length; i++ )
  +                {
  +                    m_listeners[ i ].targetStarted( event );
  +                }*/
       }
   
       /**
  @@ -123,10 +127,13 @@
        */
       public void targetFinished()
       {
  +        /*final ProjectEvent event =
  +            new ProjectEvent( null, m_projectName, m_targetName,
  +                              null, null, null );
           for( int i = 0; i < m_listeners.length; i++ )
           {
  -            m_listeners[ i ].targetFinished( this );
  -        }
  +            m_listeners[ i ].targetFinished( event );
  +        }*/
   
           m_targetName = null;
           m_taskName = null;
  @@ -139,10 +146,14 @@
       {
           m_taskName = taskName;
   
  +        /*final ProjectEvent event =
  +            new ProjectEvent( null, m_projectName, m_targetName,
  +                              taskName, null, null );
  +
           for( int i = 0; i < m_listeners.length; i++ )
           {
  -            m_listeners[ i ].taskStarted( this );
  -        }
  +            m_listeners[ i ].taskStarted( event );
  +        }*/
       }
   
       /**
  @@ -150,10 +161,14 @@
        */
       public void taskFinished()
       {
  +        /*final ProjectEvent event =
  +            new ProjectEvent( null, m_projectName, m_targetName,
  +                              m_taskName, null, null );
  +
           for( int i = 0; i < m_listeners.length; i++ )
           {
  -            m_listeners[ i ].taskFinished( this );
  -        }
  +            m_listeners[ i ].taskFinished( event );
  +        }*/
   
           m_taskName = null;
       }
  @@ -163,62 +178,14 @@
        *
        * @param message the log message
        */
  -    public void log( String message, Throwable throwable )
  +    public void log( final String message, final Throwable throwable )
       {
  -        m_message = message;
  -        m_throwable = throwable;
  -
  -        try
  -        {
  -            for( int i = 0; i < m_listeners.length; i++ )
  -            {
  -                m_listeners[ i ].log( this );
  -            }
  -        }
  -        finally
  +        /*final ProjectEvent event =
  +            new ProjectEvent( null, m_projectName, m_targetName,
  +                              m_taskName, message, throwable );
  +        for( int i = 0; i < m_listeners.length; i++ )
           {
  -            m_message = null;
  -            m_throwable = null;
  -        }
  -    }
  -
  -    /**
  -     * Returns the message.
  -     */
  -    public String getMessage()
  -    {
  -        return m_message;
  -    }
  -
  -    /**
  -     * Returns the error that occurred.
  -     */
  -    public Throwable getThrowable()
  -    {
  -        return m_throwable;
  -    }
  -
  -    /**
  -     * Returns the name of the task.
  -     */
  -    public String getTaskName()
  -    {
  -        return m_taskName;
  -    }
  -
  -    /**
  -     * Returns the name of the target.
  -     */
  -    public String getTargetName()
  -    {
  -        return m_targetName;
  -    }
  -
  -    /**
  -     * Returns the name of the project.
  -     */
  -    public String getProjectName()
  -    {
  -        return m_projectName;
  +            m_listeners[ i ].log( event );
  +        }*/
       }
   }
  
  
  
  1.7       +7 -6      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java
  
  Index: AbstractProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/AbstractProjectListener.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractProjectListener.java	13 Feb 2002 03:02:55 -0000	1.6
  +++ AbstractProjectListener.java	25 Apr 2002 08:17:31 -0000	1.7
  @@ -12,7 +12,8 @@
    * empty implementions of each of the event methods.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.6 $ $Date: 2002/02/13 03:02:55 $
  + * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  + * @version $Revision: 1.7 $ $Date: 2002/04/25 08:17:31 $
    */
   public abstract class AbstractProjectListener
       implements ProjectListener
  @@ -34,35 +35,35 @@
       /**
        * Notify listener of targetStarted event.
        */
  -    public void targetStarted( final TargetEvent event )
  +    public void targetStarted( final ProjectEvent event )
       {
       }
   
       /**
        * Notify listener of targetFinished event.
        */
  -    public void targetFinished( final TargetEvent event )
  +    public void targetFinished( final ProjectEvent event )
       {
       }
   
       /**
        * Notify listener of taskStarted event.
        */
  -    public void taskStarted( final TaskEvent event )
  +    public void taskStarted( final ProjectEvent event )
       {
       }
   
       /**
        * Notify listener of taskFinished event.
        */
  -    public void taskFinished( final TaskEvent event )
  +    public void taskFinished( final ProjectEvent event )
       {
       }
   
       /**
        * Notify listener of log message event.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
       }
   }
  
  
  
  1.12      +9 -9      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ClassicProjectListener.java
  
  Index: ClassicProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ClassicProjectListener.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ClassicProjectListener.java	27 Mar 2002 06:59:03 -0000	1.11
  +++ ClassicProjectListener.java	25 Apr 2002 08:17:31 -0000	1.12
  @@ -14,7 +14,7 @@
    * Classic listener that emulates the default ant1.x listener.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.11 $ $Date: 2002/03/27 06:59:03 $
  + * @version $Revision: 1.12 $ $Date: 2002/04/25 08:17:31 $
    * @ant.type type="listener" name="classic"
    */
   public class ClassicProjectListener
  @@ -30,7 +30,7 @@
       /**
        * Notify listener of targetStarted event.
        */
  -    public void targetStarted( final TargetEvent event )
  +    public void targetStarted( final ProjectEvent event )
       {
           writeTargetHeader( event );
       }
  @@ -38,7 +38,7 @@
       /**
        * Notify listener of targetFinished event.
        */
  -    public void targetFinished( TargetEvent event )
  +    public void targetFinished( final ProjectEvent event )
       {
           getWriter().println();
       }
  @@ -46,7 +46,7 @@
       /**
        * Notify listener of log message event.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
           writeMessage( event );
           writeThrowable( event );
  @@ -63,19 +63,19 @@
       /**
        * Writes the target header.
        */
  -    protected void writeTargetHeader( final TargetEvent event )
  +    protected void writeTargetHeader( final ProjectEvent event )
       {
  -        getWriter().println( event.getTargetName() + ":" );
  +        getWriter().println( event.getTarget() + ":" );
       }
   
       /**
        * Writes a message
        */
  -    protected void writeMessage( final LogEvent event )
  +    protected void writeMessage( final ProjectEvent event )
       {
           // Write the message
           final String message = event.getMessage();
  -        final String task = event.getTaskName();
  +        final String task = event.getTask();
           if( null != task )
           {
               getWriter().println( "\t[" + task + "] " + message );
  @@ -89,7 +89,7 @@
       /**
        * Writes a throwable.
        */
  -    private void writeThrowable( final LogEvent event )
  +    private void writeThrowable( final ProjectEvent event )
       {
           // Write the exception, if any
           final Throwable throwable = event.getThrowable();
  
  
  
  1.14      +5 -5      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java
  
  Index: DefaultProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/DefaultProjectListener.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultProjectListener.java	23 Mar 2002 04:01:25 -0000	1.13
  +++ DefaultProjectListener.java	25 Apr 2002 08:17:31 -0000	1.14
  @@ -11,7 +11,7 @@
    * Default listener that emulates the Ant 1.x no banner listener.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.13 $ $Date: 2002/03/23 04:01:25 $
  + * @version $Revision: 1.14 $ $Date: 2002/04/25 08:17:31 $
    * @ant.type type="listener" name="default"
    */
   public class DefaultProjectListener
  @@ -22,7 +22,7 @@
       /**
        * Notify listener of targetStarted event.
        */
  -    public void targetStarted( final TargetEvent target )
  +    public void targetStarted( final ProjectEvent target )
       {
           m_targetOutput = false;
       }
  @@ -30,7 +30,7 @@
       /**
        * Notify listener of targetFinished event.
        */
  -    public void targetFinished( final TargetEvent event )
  +    public void targetFinished( final ProjectEvent event )
       {
           if( m_targetOutput )
           {
  @@ -41,10 +41,10 @@
       /**
        * Notify listener of log message event.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
           // Write the target header, if necessary
  -        final String target = event.getTargetName();
  +        final String target = event.getTarget();
           if( target != null && !m_targetOutput )
           {
               writeTargetHeader( event );
  
  
  
  1.6       +2 -2      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/NoPrefixProjectListener.java
  
  Index: NoPrefixProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/NoPrefixProjectListener.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NoPrefixProjectListener.java	23 Mar 2002 04:01:25 -0000	1.5
  +++ NoPrefixProjectListener.java	25 Apr 2002 08:17:31 -0000	1.6
  @@ -11,7 +11,7 @@
    * A project listener that emulated the Ant 1.x -emacs mode.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/03/23 04:01:25 $
  + * @version $Revision: 1.6 $ $Date: 2002/04/25 08:17:31 $
    * @ant.type type="listener" name="noprefix"
    */
   public class NoPrefixProjectListener
  @@ -20,7 +20,7 @@
       /**
        * Writes a message
        */
  -    protected void writeMessage( LogEvent event )
  +    protected void writeMessage( final ProjectEvent event )
       {
           getWriter().println( event.getMessage() );
       }
  
  
  
  1.4       +75 -5     jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ProjectEvent.java
  
  Index: ProjectEvent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ProjectEvent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProjectEvent.java	14 Feb 2002 10:53:54 -0000	1.3
  +++ ProjectEvent.java	25 Apr 2002 08:17:31 -0000	1.4
  @@ -7,16 +7,86 @@
    */
   package org.apache.myrmidon.listeners;
   
  +import java.util.EventObject;
  +import org.apache.myrmidon.api.event.TaskEvent;
  +
   /**
  - * A project level event.
  + * An event raised while processing an Ant project.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.3 $ $Date: 2002/02/14 10:53:54 $
  + * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  + * @version $Revision: 1.4 $ $Date: 2002/04/25 08:17:31 $
    */
  -public interface ProjectEvent
  +public class ProjectEvent
  +    extends EventObject
   {
       /**
  -     * Returns the name of the project.
  +     * The name of the project associated with event.
        */
  -    String getProjectName();
  +    private final String m_projectName;
  +
  +    /**
  +     * The name of the target associated with event (if any).
  +     */
  +    private final String m_targetName;
  +
  +    /**
  +     * The name of the task associated with event (if any).
  +     */
  +    private final String m_taskName;
  +
  +    /**
  +     * Message associated with event.
  +     */
  +    private final String m_message;
  +
  +    /**
  +     * Exception associated with event
  +     */
  +    private final Throwable m_throwable;
  +
  +    public ProjectEvent( final TaskEvent source,
  +                         final String projectName,
  +                         final String targetName,
  +                         final String taskName,
  +                         final String message,
  +                         final Throwable throwable )
  +    {
  +        super( source );
  +        m_projectName = projectName;
  +        m_targetName = targetName;
  +        m_taskName = taskName;
  +        m_message = message;
  +        m_throwable = throwable;
  +    }
  +
  +    public String getProject()
  +    {
  +        return m_projectName;
  +    }
  +
  +    public String getTarget()
  +    {
  +        return m_targetName;
  +    }
  +
  +    public String getTask()
  +    {
  +        return m_taskName;
  +    }
  +
  +    public String getMessage()
  +    {
  +        return m_message;
  +    }
  +
  +    public Throwable getThrowable()
  +    {
  +        return m_throwable;
  +    }
  +
  +    public TaskEvent getTaskEvent()
  +    {
  +        return (TaskEvent)getSource();
  +    }
   }
  
  
  
  1.11      +7 -6      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ProjectListener.java
  
  Index: ProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/listeners/ProjectListener.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProjectListener.java	24 Apr 2002 02:20:59 -0000	1.10
  +++ ProjectListener.java	25 Apr 2002 08:17:31 -0000	1.11
  @@ -12,7 +12,8 @@
    * notification of project status.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.10 $ $Date: 2002/04/24 02:20:59 $
  + * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  + * @version $Revision: 1.11 $ $Date: 2002/04/25 08:17:31 $
    * @ant.role name="listener"
    * @todo Think about having a way to indicate that a foreign project
    *       is being referenced, a implicit target is being referenced
  @@ -39,27 +40,27 @@
        * project name reported by the event may be different to that reported
        * in {@link #projectStarted}.
        */
  -    void targetStarted( TargetEvent event );
  +    void targetStarted( ProjectEvent event );
   
       /**
        * Notify the listener that a target has finished.
        */
  -    void targetFinished( TargetEvent event );
  +    void targetFinished( ProjectEvent event );
   
       /**
        * Notify the listener that a task is about to start.
        */
  -    void taskStarted( TaskEvent event );
  +    void taskStarted( ProjectEvent event );
   
       /**
        * Notify the listener that a task has finished.
        */
  -    void taskFinished( TaskEvent event );
  +    void taskFinished( ProjectEvent event );
   
       /**
        * Notify listener of log message event.  Note that this method may
        * be called at any time, so the reported task, target, or project names
        * may be null.
        */
  -    void log( LogEvent event );
  +    void log( ProjectEvent event );
   }
  
  
  
  1.2       +4 -4      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/LogMessageTracker.java
  
  Index: LogMessageTracker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/LogMessageTracker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogMessageTracker.java	26 Feb 2002 23:26:55 -0000	1.1
  +++ LogMessageTracker.java	25 Apr 2002 08:17:31 -0000	1.2
  @@ -9,13 +9,13 @@
   
   import java.util.ArrayList;
   import java.util.List;
  -import org.apache.myrmidon.listeners.LogEvent;
  +import org.apache.myrmidon.listeners.ProjectEvent;
   
   /**
    * Asserts that log messages are delivered in the correct order.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.1 $ $Date: 2002/02/26 23:26:55 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/25 08:17:31 $
    */
   public class LogMessageTracker
       extends TrackingProjectListener
  @@ -26,14 +26,14 @@
       /**
        * Handles a log message.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
           super.log( event );
   
           // Pop the next expected message off the list, and make sure it
           // matches the message in the event
           assertTrue( "Unexpected log message", m_targets.size() > 0 && m_messages.size()
> 0 );
  -        assertEquals( "Unexpected log message", m_targets.remove( 0 ), event.getTargetName()
);
  +        assertEquals( "Unexpected log message", m_targets.remove( 0 ), event.getTarget()
);
           assertEquals( "Unexpected log message", m_messages.remove( 0 ), event.getMessage()
);
       }
   
  
  
  
  1.3       +21 -24    jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/TrackingProjectListener.java
  
  Index: TrackingProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/TrackingProjectListener.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TrackingProjectListener.java	26 Feb 2002 23:26:55 -0000	1.2
  +++ TrackingProjectListener.java	25 Apr 2002 08:17:31 -0000	1.3
  @@ -8,18 +8,15 @@
   package org.apache.myrmidon;
   
   import junit.framework.Assert;
  -import org.apache.myrmidon.listeners.LogEvent;
   import org.apache.myrmidon.listeners.ProjectEvent;
   import org.apache.myrmidon.listeners.ProjectListener;
  -import org.apache.myrmidon.listeners.TargetEvent;
  -import org.apache.myrmidon.listeners.TaskEvent;
   
   /**
    * A project listener that asserts that it receives a particular sequence of
    * events.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/02/26 23:26:55 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/25 08:17:31 $
    */
   public class TrackingProjectListener
       extends Assert
  @@ -36,7 +33,7 @@
       public void projectStarted( final ProjectEvent event )
       {
           assertNull( "Project already started", m_rootProject );
  -        m_rootProject = event.getProjectName();
  +        m_rootProject = event.getProject();
       }
   
       /**
  @@ -44,7 +41,7 @@
        */
       public void projectFinished( final ProjectEvent event )
       {
  -        assertEquals( "Mismatched project name", m_rootProject, event.getProjectName()
);
  +        assertEquals( "Mismatched project name", m_rootProject, event.getProject() );
           m_rootProject = null;
   
           assertNull( "Target not started", m_currentTarget );
  @@ -53,21 +50,21 @@
       /**
        * Notify the listener that a target is about to start.
        */
  -    public void targetStarted( final TargetEvent event )
  +    public void targetStarted( final ProjectEvent event )
       {
           assertNotNull( "Project not started", m_rootProject );
           assertNull( "Target already started", m_currentTarget );
  -        m_currentProject = event.getProjectName();
  -        m_currentTarget = event.getTargetName();
  +        m_currentProject = event.getProject();
  +        m_currentTarget = event.getTarget();
       }
   
       /**
        * Notify the listener that a target has finished.
        */
  -    public void targetFinished( final TargetEvent event )
  +    public void targetFinished( final ProjectEvent event )
       {
  -        assertEquals( "Mismatched project name", m_currentProject, event.getProjectName()
);
  -        assertEquals( "Mismatched target name", m_currentTarget, event.getTargetName()
);
  +        assertEquals( "Mismatched project name", m_currentProject, event.getProject() );
  +        assertEquals( "Mismatched target name", m_currentTarget, event.getTarget() );
           m_currentProject = null;
           m_currentTarget = null;
   
  @@ -77,34 +74,34 @@
       /**
        * Notify the listener that a task is about to start.
        */
  -    public void taskStarted( final TaskEvent event )
  +    public void taskStarted( final ProjectEvent event )
       {
  -        assertEquals( "Mismatched project name", m_currentProject, event.getProjectName()
);
  -        assertEquals( "Mismatched target name", m_currentTarget, event.getTargetName()
);
  +        assertEquals( "Mismatched project name", m_currentProject, event.getProject() );
  +        assertEquals( "Mismatched target name", m_currentTarget, event.getTarget() );
   
           assertNull( "Task already started", m_currentTask );
  -        m_currentTask = event.getTaskName();
  +        m_currentTask = event.getTask();
       }
   
       /**
        * Notify the listener that a task has finished.
        */
  -    public void taskFinished( final TaskEvent event )
  +    public void taskFinished( final ProjectEvent event )
       {
  -        assertEquals( "Mismatched project name", m_currentProject, event.getProjectName()
);
  -        assertEquals( "Mismatched target name", m_currentTarget, event.getTargetName()
);
  -        assertEquals( "Mismatched task name", m_currentTask, event.getTaskName() );
  +        assertEquals( "Mismatched project name", m_currentProject, event.getProject() );
  +        assertEquals( "Mismatched target name", m_currentTarget, event.getTarget() );
  +        assertEquals( "Mismatched task name", m_currentTask, event.getTask() );
           m_currentTask = null;
       }
   
       /**
        * Notify listener of log message event.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
  -        assertEquals( "Mismatched project name", m_currentProject, event.getProjectName()
);
  -        assertEquals( "Mismatched target name", m_currentTarget, event.getTargetName()
);
  -        assertEquals( "Mismatched task name", m_currentTask, event.getTaskName() );
  +        assertEquals( "Mismatched project name", m_currentProject, event.getProject() );
  +        assertEquals( "Mismatched target name", m_currentTarget, event.getTarget() );
  +        assertEquals( "Mismatched task name", m_currentTask, event.getTask() );
           assertNull( "Unexpected build error", event.getThrowable() );
       }
   
  
  
  
  1.2       +2 -3      jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/sound/AntSoundPlayer.java
  
  Index: AntSoundPlayer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/sound/AntSoundPlayer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AntSoundPlayer.java	14 Apr 2002 10:56:38 -0000	1.1
  +++ AntSoundPlayer.java	25 Apr 2002 08:17:31 -0000	1.2
  @@ -22,7 +22,6 @@
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.myrmidon.listeners.AbstractProjectListener;
  -import org.apache.myrmidon.listeners.LogEvent;
   import org.apache.myrmidon.listeners.ProjectEvent;
   
   /**
  @@ -33,7 +32,7 @@
    * Both seem to work fine.
    *
    * @author Nick Pellow
  - * @version $Revision: 1.1 $, $Date: 2002/04/14 10:56:38 $
  + * @version $Revision: 1.2 $, $Date: 2002/04/25 08:17:31 $
    */
   public class AntSoundPlayer
       extends AbstractProjectListener
  @@ -75,7 +74,7 @@
       /**
        * Notify listener of log message event.
        */
  -    public void log( final LogEvent event )
  +    public void log( final ProjectEvent event )
       {
           if( event.getThrowable() != null )
           {
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message