Clover coverage report - Alipes Project - 0.1
Coverage timestamp: Sat Sep 10 2005 21:25:58 BST
file stats: LOC: 77   Methods: 4
NCLOC: 28   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MultiplexorException.java 100% 100% 100% 100%
coverage
 1    /* $Id: MultiplexorException.java,v 1.1 2004/03/17 21:18:40 johndavidtaylor Exp $
 2    * Created on Mar 13, 2004 by jdt
 3    * The alipes project
 4    * (c) 2004
 5    *
 6    */
 7    package org.abraracourcix.alipes.pipes;
 8   
 9    import java.util.ArrayList;
 10    import java.util.Collection;
 11    import java.util.Iterator;
 12   
 13    import org.abraracourcix.alipes.listeners.ListenerException;
 14   
 15    /**
 16    * Can occur if one or more of the multiplexor's listeners throw an exception.
 17    * Since any or all of the multiplexor's listeners can throw exceptions during
 18    * multiplexing this exception bundles them all up into one.
 19    *
 20    * @author jdt
 21    */
 22    public class MultiplexorException extends ListenerException {
 23    /**
 24    * Underlying exceptions bundled in.
 25    */
 26    private Collection causes = new ArrayList();
 27    /**
 28    * Constructor
 29    * @param cause root cause
 30    */
 31  1 public MultiplexorException(final Throwable cause) {
 32  1 super(cause);
 33  1 causes.add(cause);
 34    }
 35    /**
 36    * Constructor
 37    * @param description Description of error
 38    * @param cause root cause
 39    */
 40  6 public MultiplexorException(final String description, final Throwable cause) {
 41  6 super(description, cause);
 42  6 causes.add(cause);
 43    }
 44   
 45    /**
 46    * Add a new exception
 47    * @param cause yet another cause
 48    */
 49  9 public final void addCause(final Throwable cause) {
 50  9 causes.add(cause);
 51    }
 52    /**
 53    * Override to append all enclosed exceptions
 54    * @return see below
 55    * @see java.lang.Throwable#getMessage()
 56    */
 57  2 public final String getMessage() {
 58  2 final StringBuffer buff = new StringBuffer(super.getMessage()+":\n");
 59  2 final Iterator it = causes.iterator();
 60  2 while (it.hasNext()) {
 61  6 final Throwable ex = (Throwable) it.next();
 62  6 buff.append(ex.getMessage()+"\n");
 63    }
 64  2 return buff.toString();
 65    }
 66    }
 67   
 68   
 69    /*
 70    * $Log: MultiplexorException.java,v $
 71    * Revision 1.1 2004/03/17 21:18:40 johndavidtaylor
 72    * Copied across from incubation in beanpeeler
 73    *
 74    * Revision 1.1 2004/03/14 00:44:22 johndavidtaylor
 75    * Added ListenerException
 76    *
 77    */