Package hudson.plugins.testng.util
Class FormatUtil
- java.lang.Object
-
- hudson.plugins.testng.util.FormatUtil
-
public class FormatUtil extends Object
These methods are used to format strings in jelly files- Author:
- nullin, farshidce
-
-
Field Summary
Fields Modifier and Type Field Description static String
MORE_THAN_24HRS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
escapeJS(String str)
static String
escapeString(String str)
Replaces newline characters in string with<br/>
to retain the newlines when the string is displayed in HTML.static String
formatLong(long value)
Formats a long value and prepends it with a - or + This functions is used for showing the diff values for test runsstatic String
formatStackTraceForHTML(String stackTrace)
Formats the stack trace for easier readabilitystatic String
formatTime(float duration)
Formats the time into a human readable format
-
-
-
Field Detail
-
MORE_THAN_24HRS
public static final String MORE_THAN_24HRS
- See Also:
- Constant Field Values
-
-
Method Detail
-
formatTime
public static String formatTime(float duration)
Formats the time into a human readable format- Parameters:
duration
- time duration in seconds- Returns:
- time represented in a human readable format
-
formatLong
public static String formatLong(long value)
Formats a long value and prepends it with a - or + This functions is used for showing the diff values for test runs- Parameters:
value
- long value- Returns:
- a long value prepended with a - or +
-
escapeString
public static String escapeString(String str)
Replaces newline characters in string with<br/>
to retain the newlines when the string is displayed in HTML. It also replaces<
,>
,&
, and"
characters with their corresponding html code. ref : http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php- Parameters:
str
- a string- Returns:
- escaped string
-
-