Package hudson.plugins.testng.util
Class FormatUtil
java.lang.Object
hudson.plugins.testng.util.FormatUtil
These methods are used to format strings in jelly files
- Author:
- nullin, farshidce
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringescapeString(String str) Replaces newline characters in string with<br/>to retain the newlines when the string is displayed in HTML.static StringformatLong(long value) Formats a long value and prepends it with a - or + This functions is used for showing the diff values for test runsstatic StringformatStackTraceForHTML(String stackTrace) Formats the stack trace for easier readabilitystatic StringformatTime(float duration) Formats the time into a human readable format
-
Field Details
-
MORE_THAN_24HRS
- See Also:
-
-
Method Details
-
formatTime
Formats the time into a human readable format- Parameters:
duration- time duration in seconds- Returns:
- time represented in a human readable format
-
formatLong
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
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
-
escapeJS
-
formatStackTraceForHTML
Formats the stack trace for easier readability- Parameters:
stackTrace- a stack trace- Returns:
- the stack trace formatted for easier readability
-