public class JiraAwareFailureUtils extends Object
Link test failures to existing Jiras as a html link in Jenkins.
The more failures the more useful it is to not have to keep tracking down the same Jiras.
Set -Djira.aware.regex.failures.location and -Djira.aware.contains.failures.location to define file locations, else
Modifier and Type | Field and Description |
---|---|
static String |
CONTAINS_LOCATION_PROERTY
Set -Djira.aware.contains.failures.location to point to the the regex failures properties, defaults to
JiraAwareContainsFailures.properties
|
static String |
JIRA_BROWSE_URL_PROPERTY
Set -Djira.aware.base.url to point your Jira url base (include trailing slash), defaults to
https://jira.kuali.org/browse/
|
static String |
REGEX_LOCATION_POPERTY
Set -Djira.aware.regex.failures.location to point to the the regex failures properties, defaults to
JiraAwareRegexFailures.properties
|
Modifier and Type | Method and Description |
---|---|
static void |
fail(String message,
JiraAwareFailable failable)
Calls
failOnMatchedJira(String, JiraAwareFailable) and calls fail on the JiraAwareFailable.fail(java.lang.String) if no matched jira failures. |
static void |
fail(String contents,
String message,
JiraAwareFailable failable)
Calls
failOnMatchedJira(String, String, JiraAwareFailable) and calls fail on the JiraAwareFailable.fail(java.lang.String) fails if no matched jira failures. |
static void |
fail(String contents,
String message,
Throwable throwable,
JiraAwareFailable failable)
Calls
failOnMatchedJira(String, String, JiraAwareFailable) and calls fail on the JiraAwareFailable.fail(java.lang.String) fails if no matched jira failures. |
static void |
failOnMatchedJira(String contents,
JiraAwareFailable failable)
If the contents contains the jiraMatches key, calls fail on the
JiraAwareFailable.fail(java.lang.String) passing in the jiraMatches value for the matched key. |
static void |
failOnMatchedJira(String contents,
String message,
JiraAwareFailable failable)
Calls
failOnMatchedJira(String, JiraAwareFailable) with the contents and if no match is detected then the message. |
static String |
findMatchedJira(String contents)
Returns the value from the properties files for the key matching the contents or an empty string if no match is found.
|
protected static String |
findMatchedJiraContains(String contents) |
protected static String |
findMatchedJiraRegex(String contents) |
public static final String JIRA_BROWSE_URL_PROPERTY
Set -Djira.aware.base.url to point your Jira url base (include trailing slash), defaults to https://jira.kuali.org/browse/
public static final String REGEX_LOCATION_POPERTY
Set -Djira.aware.regex.failures.location to point to the the regex failures properties, defaults to JiraAwareRegexFailures.properties
public static final String CONTAINS_LOCATION_PROERTY
Set -Djira.aware.contains.failures.location to point to the the regex failures properties, defaults to JiraAwareContainsFailures.properties
public static void fail(String message, JiraAwareFailable failable)
Calls failOnMatchedJira(String, JiraAwareFailable)
and calls fail on the JiraAwareFailable.fail(java.lang.String)
if no matched jira failures.
message
- to pass to failfailable
- JiraAwareFailable.fail(java.lang.String)
public static void fail(String contents, String message, JiraAwareFailable failable)
Calls failOnMatchedJira(String, String, JiraAwareFailable)
and calls fail on the JiraAwareFailable.fail(java.lang.String)
fails if no matched jira failures.
contents
- to check for jira matches onmessage
- to pass to fail, also checked for jira matchesfailable
- JiraAwareFailable.fail(java.lang.String)
public static void fail(String contents, String message, Throwable throwable, JiraAwareFailable failable)
Calls failOnMatchedJira(String, String, JiraAwareFailable)
and calls fail on the JiraAwareFailable.fail(java.lang.String)
fails if no matched jira failures.
contents
- to check for jira matches onmessage
- to pass to fail, also checked for jira matchesfailable
- JiraAwareFailable.fail(java.lang.String)
public static void failOnMatchedJira(String contents, String message, JiraAwareFailable failable)
Calls failOnMatchedJira(String, JiraAwareFailable)
with the contents and if no match is detected then the message.
contents
- to check for containing of the jiraMatches keys.message
- to check for containing of the jiraMatches keys if contents doesn'tfailable
- to fail with the jiraMatches value if the contents or message is detectedpublic static void failOnMatchedJira(String contents, JiraAwareFailable failable)
If the contents contains the jiraMatches key, calls fail on the JiraAwareFailable.fail(java.lang.String)
passing in the jiraMatches value for the matched key.
contents
- to check for containing of the jiraMatches keys.failable
- to fail with the jiraMatches value if the jiraMatches key is contained in the contentspublic static String findMatchedJira(String contents)
Returns the value from the properties files for the key matching the contents or an empty string if no match is found.
contents
- to search for key in from properties fileprotected static String findMatchedJiraContains(String contents)
protected static String findMatchedJiraRegex(String contents)
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.