FileDocCategorySizeDatePackage
MockBuildListener.javaAPI DocApache Ant 1.702371Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant

MockBuildListener

public class MockBuildListener extends Assert implements BuildListener

Fields Summary
private final Vector
buffer
private final Project
project
Constructors Summary
public MockBuildListener(Project project)


        
        this.project = project;
    
Methods Summary
public voidaddBuildEvent(java.lang.String message, int priority)

        final BuildEvent be = new BuildEvent(project);
        be.setMessage(message, priority);
        buffer.addElement(be);
    
public voidassertEmpty()

        assertTrue("MockBuildListener is not empty", buffer.isEmpty());
    
public voidbuildFinished(BuildEvent event)

public voidbuildStarted(BuildEvent event)

public voidmessageLogged(BuildEvent actual)

        if(actual.getPriority()==Project.MSG_DEBUG)
            return;
        assertTrue("unexpected messageLogged: "+actual.getMessage(), !buffer.isEmpty());
        assertEquals("unexpected project ", project, actual.getProject());

        BuildEvent expected = (BuildEvent) buffer.elementAt(0);
        buffer.removeElementAt(0);
        assertEquals("unexpected messageLogged ", expected.getMessage(), actual.getMessage());
        assertEquals("unexpected priority ", expected.getPriority(), actual.getPriority());
    
public voidtargetFinished(BuildEvent event)

public voidtargetStarted(BuildEvent event)

public voidtaskFinished(BuildEvent event)

public voidtaskStarted(BuildEvent event)