org.kuali.rice.testtools.common
Class JiraAwareFailureUtils

java.lang.Object
  extended by org.kuali.rice.testtools.common.JiraAwareFailureUtils

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

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
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
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIRA_BROWSE_URL_PROPERTY

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/

See Also:
Constant Field Values

REGEX_LOCATION_POPERTY

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

See Also:
Constant Field Values

CONTAINS_LOCATION_PROERTY

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

See Also:
Constant Field Values
Method Detail

fail

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.

Parameters:
message - to pass to fail
failable - JiraAwareFailable.fail(java.lang.String)

fail

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.

Parameters:
contents - to check for jira matches on
message - to pass to fail, also checked for jira matches
failable - JiraAwareFailable.fail(java.lang.String)

fail

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.

Parameters:
contents - to check for jira matches on
message - to pass to fail, also checked for jira matches
failable - JiraAwareFailable.fail(java.lang.String)

failOnMatchedJira

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.

Parameters:
contents - to check for containing of the jiraMatches keys.
message - to check for containing of the jiraMatches keys if contents doesn't
failable - to fail with the jiraMatches value if the contents or message is detected

failOnMatchedJira

public 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.

Parameters:
contents - to check for containing of the jiraMatches keys.
failable - to fail with the jiraMatches value if the jiraMatches key is contained in the contents

findMatchedJira

public 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.

Parameters:
contents - to search for key in from properties file
Returns:
value for key which matches contents

findMatchedJiraContains

protected static String findMatchedJiraContains(String contents)

findMatchedJiraRegex

protected static String findMatchedJiraRegex(String contents)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.