org.apache.maven.plugins.junitreport
Class ExceptionTool

java.lang.Object
  extended by org.apache.maven.plugins.junitreport.ExceptionTool

public class ExceptionTool
extends Object

Util class for exceptions

Inspired from org.apache.maven.util.StringTool

Version:
$Id: ExceptionTool.java 393632 2006-04-12 22:28:03Z ltheussl $
Author:
Cyrille Le Clerc

Constructor Summary
ExceptionTool()
           
 
Method Summary
 String[] split(String text, String separator)
           Splits the provided text into an array, separator String specified.
 String[] splitNestedStackTraces(String nestedStackTrace)
           Splits the given stacktrace into an array of simple (not nested) stack traces.
 String truncateNestedStackTrace(String netstedStackTrace, String searchedString)
           Splits the given stackTrace into nested stack traces and truncates each of the nested stacktrace (including the nesting stacktrace) then re-concatenates the string to return it
 String truncateStackTrace(String stackTrace, String searchedString)
           Truncates the given stacktrace just before the first occurance of the given searchedString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionTool

public ExceptionTool()
Method Detail

split

public String[] split(String text,
                      String separator)

Splits the provided text into an array, separator String specified.

This method is different of StringTokenizer that only accept chars as separator but not strings

Parameters:
text - the string to split
separator - the spearator
Returns:
An array containing the split string

splitNestedStackTraces

public String[] splitNestedStackTraces(String nestedStackTrace)

Splits the given stacktrace into an array of simple (not nested) stack traces. The nesting stack trace is included in the result

Parameters:
nestedStackTrace - the nested stack trace to split
Returns:
An array of un-nested stacktraces

truncateStackTrace

public String truncateStackTrace(String stackTrace,
                                 String searchedString)

Truncates the given stacktrace just before the first occurance of the given searchedString

Parameters:
stackTrace - the stacktrace to truncate
searchedString - e.g. "at org.apache.commons.jelly.tags.ant.AntTag.doTag"
Returns:
The truncated stacktrace

truncateNestedStackTrace

public String truncateNestedStackTrace(String netstedStackTrace,
                                       String searchedString)

Splits the given stackTrace into nested stack traces and truncates each of the nested stacktrace (including the nesting stacktrace) then re-concatenates the string to return it

Parameters:
netstedStackTrace - the nested stacktrace to truncate
searchedString - e.g. "at org.apache.commons.jelly.tags.ant.AntTag.doTag"
Returns:
The truncated stacktrace


Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.