com.atlassian.jira.functest.matcher
Class BuildNumberMatcher
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<InputStream>
com.atlassian.jira.functest.matcher.DocumentMatcher
com.atlassian.jira.functest.matcher.BuildNumberMatcher
- All Implemented Interfaces:
- org.hamcrest.Matcher<InputStream>, org.hamcrest.SelfDescribing
public class BuildNumberMatcher
- extends DocumentMatcher
Hamcrest matcher used to verify that a JIRA XML backup has a given build number in it. This is used in upgrade task
tests to ensure that the upgrade is actually being performed.
- Since:
- v5.0
Constructor Summary |
BuildNumberMatcher(int expectedBuildNumber)
Creates a new BuildNumberMatcher. |
Methods inherited from class org.hamcrest.TypeSafeMatcher |
describeMismatch, describeMismatchSafely, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
BuildNumberMatcher
public BuildNumberMatcher(int expectedBuildNumber)
- Creates a new BuildNumberMatcher.
- Parameters:
expectedBuildNumber
- a build number
hasBuildNumber
public static BuildNumberMatcher hasBuildNumber(int buildNumber)
- Does the backup file have the given build number.
- Parameters:
buildNumber
- a build number
- Returns:
- a BuildNumberMatcher
matchesDocument
protected boolean matchesDocument(@Nullable
Document doc)
throws Exception
- Specified by:
matchesDocument
in class DocumentMatcher
- Throws:
Exception
describeTo
public void describeTo(org.hamcrest.Description description)
readBuildNumberFrom
protected int readBuildNumberFrom(Document doc)
throws Exception
- Reads the build number from a JIRA XML backup using DOM + XPath.
- Parameters:
doc
- a Document containing the XML backup
- Returns:
- an int containing the build number
- Throws:
Exception
- if anything goes wrong
Copyright © 2002-2013 Atlassian. All Rights Reserved.