java/src/org/apache/qetest/trax/LoggingErrorListener.java [159:265]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public String getQuickCounters()
    {
        return (prefix + "(" + counters[TYPE_WARNING] + ", "
                + counters[TYPE_ERROR] + ", " + counters[TYPE_FATALERROR] + ")");
    }


    /** Cheap-o string representation of last warn/error/fatal we got. */
    protected String lastItem = NOTHING_HANDLED;

    /**
     * Sets a String representation of last item we handled. 
     *
     * @param s set into lastItem for retrieval with getLast()
     */
    protected void setLastItem(String s)
    {
        lastItem = s;
    }

    /**
     * Get a string representation of last item we logged.  
     *
     * @return String of the last item handled
     */
    public String getLast()
    {
        return lastItem;
    }


    /** Expected values for events we may handle, default=ITEM_DONT_CARE. */
    protected String[] expected = 
    {
        ITEM_DONT_CARE, /* warning */
        ITEM_DONT_CARE, /* error */
        ITEM_DONT_CARE  /* fatalError */
    };


    /**
     * Ask us to report checkPass/Fail for certain events we handle.
     * Since we may have to handle many events between when a test 
     * will be able to call us, testers can set this to have us 
     * automatically call checkPass when we see an item that matches, 
     * or to call checkFail when we get an unexpected item.
     * Generally, we only call check* methods when:
     * <ul>
     * <li>containsString is not set, reset, or is ITEM_DONT_CARE, 
     * we do nothing (i.e. never call check* for this item)</li>
     * <li>containsString is ITEM_CHECKFAIL, we will always call 
     * checkFail with the contents of any item if it occours</li>
     * <li>containsString is anything else, we will grab a String 
     * representation of every item of that type that comes along, 
     * and if the containsString is found, case-sensitive, within 
     * the handled item's string, call checkPass, otherwise 
     * call checkFail</li>
     * <ul>
     * Note that any time we handle a particular event that was 
     * expected, we un-set the expected value for that item.  This 
     * means that you can only ask us to validate one occourence 
     * of any particular event; all events after that one will 
     * be treated as ITEM_DONT_CARE.  Callers can of course call 
     * setExpected again, of course, but this covers the case where 
     * we handle multiple events in a single block, perhaps out of 
     * the caller's direct control. 
     * Note that we first store the event via setLast(), then we 
     * validate the event as above, and then we potentially 
     * re-throw the exception as by setThrowWhen().
     *
     * @param itemType which of the various types of items we might 
     * handle; should be defined as a constant by subclasses
     * @param containsString a string to look for within whatever 
     * item we handle - usually checked for by seeing if the actual 
     * item we handle contains the containsString
     */
    public void setExpected(int itemType, String containsString)
    {
        // Default to don't care on null
        if (null == containsString)
            containsString = ITEM_DONT_CARE;

        try
        {
            expected[itemType] = containsString;
        }
        catch (ArrayIndexOutOfBoundsException aioobe)
        {
            // Just log it for callers reference and continue anyway
            logger.logMsg(level, prefix + " setExpected called with illegal type:" + itemType);
        }
    }


    /**
     * Reset all items or counters we've handled.  
     */
    public void reset()
    {
        setLastItem(NOTHING_HANDLED);
        for (int i = 0; i < counters.length; i++)
        {
            counters[i] = 0;
        }
        for (int j = 0; j < expected.length; j++)
        {
            expected[j] = ITEM_DONT_CARE;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/src/org/apache/qetest/xsl/LoggingSAXErrorHandler.java [156:262]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public String getQuickCounters()
    {
        return (prefix + "(" + counters[TYPE_WARNING] + ", "
                + counters[TYPE_ERROR] + ", " + counters[TYPE_FATALERROR] + ")");
    }


    /** Cheap-o string representation of last warn/error/fatal we got. */
    protected String lastItem = NOTHING_HANDLED;

    /**
     * Sets a String representation of last item we handled. 
     *
     * @param s set into lastItem for retrieval with getLast()
     */
    protected void setLastItem(String s)
    {
        lastItem = s;
    }

    /**
     * Get a string representation of last item we logged.  
     *
     * @return String of the last item handled
     */
    public String getLast()
    {
        return lastItem;
    }


    /** Expected values for events we may handle, default=ITEM_DONT_CARE. */
    protected String[] expected = 
    {
        ITEM_DONT_CARE, /* warning */
        ITEM_DONT_CARE, /* error */
        ITEM_DONT_CARE  /* fatalError */
    };


    /**
     * Ask us to report checkPass/Fail for certain events we handle.
     * Since we may have to handle many events between when a test 
     * will be able to call us, testers can set this to have us 
     * automatically call checkPass when we see an item that matches, 
     * or to call checkFail when we get an unexpected item.
     * Generally, we only call check* methods when:
     * <ul>
     * <li>containsString is not set, reset, or is ITEM_DONT_CARE, 
     * we do nothing (i.e. never call check* for this item)</li>
     * <li>containsString is ITEM_CHECKFAIL, we will always call 
     * checkFail with the contents of any item if it occours</li>
     * <li>containsString is anything else, we will grab a String 
     * representation of every item of that type that comes along, 
     * and if the containsString is found, case-sensitive, within 
     * the handled item's string, call checkPass, otherwise 
     * call checkFail</li>
     * <ul>
     * Note that any time we handle a particular event that was 
     * expected, we un-set the expected value for that item.  This 
     * means that you can only ask us to validate one occourence 
     * of any particular event; all events after that one will 
     * be treated as ITEM_DONT_CARE.  Callers can of course call 
     * setExpected again, of course, but this covers the case where 
     * we handle multiple events in a single block, perhaps out of 
     * the caller's direct control. 
     * Note that we first store the event via setLast(), then we 
     * validate the event as above, and then we potentially 
     * re-throw the exception as by setThrowWhen().
     *
     * @param itemType which of the various types of items we might 
     * handle; should be defined as a constant by subclasses
     * @param containsString a string to look for within whatever 
     * item we handle - usually checked for by seeing if the actual 
     * item we handle contains the containsString
     */
    public void setExpected(int itemType, String containsString)
    {
        // Default to don't care on null
        if (null == containsString)
            containsString = ITEM_DONT_CARE;

        try
        {
            expected[itemType] = containsString;
        }
        catch (ArrayIndexOutOfBoundsException aioobe)
        {
            // Just log it for callers reference and continue anyway
            logger.logMsg(level, prefix + " setExpected called with illegal type:" + itemType);
        }
    }


    /**
     * Reset all items or counters we've handled.  
     */
    public void reset()
    {
        setLastItem(NOTHING_HANDLED);
        for (int i = 0; i < counters.length; i++)
        {
            counters[i] = 0;
        }
        for (int j = 0; j < expected.length; j++)
        {
            expected[j] = ITEM_DONT_CARE;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



