public class

BuildNumberMatcher

extends DocumentMatcher
java.lang.Object
   ↳ org.hamcrest.BaseMatcher<T>
     ↳ org.hamcrest.TypeSafeMatcher<T>
       ↳ com.atlassian.jira.functest.matcher.DocumentMatcher
         ↳ com.atlassian.jira.functest.matcher.BuildNumberMatcher

Class Overview

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.

Summary

Public Constructors
BuildNumberMatcher(int expectedBuildNumber)
Creates a new BuildNumberMatcher.
Public Methods
void describeTo(Description description)
static BuildNumberMatcher hasBuildNumber(int buildNumber)
Does the backup file have the given build number.
Protected Methods
boolean matchesDocument(Document doc)
int readBuildNumberFrom(Document doc)
Reads the build number from a JIRA XML backup using DOM + XPath.
[Expand]
Inherited Methods
From class com.atlassian.jira.functest.matcher.DocumentMatcher
From class org.hamcrest.TypeSafeMatcher
From class org.hamcrest.BaseMatcher
From class java.lang.Object
From interface org.hamcrest.Matcher
From interface org.hamcrest.SelfDescribing

Public Constructors

public BuildNumberMatcher (int expectedBuildNumber)

Creates a new BuildNumberMatcher.

Parameters
expectedBuildNumber a build number

Public Methods

public void describeTo (Description description)

public static BuildNumberMatcher hasBuildNumber (int buildNumber)

Does the backup file have the given build number.

Parameters
buildNumber a build number
Returns
  • a BuildNumberMatcher

Protected Methods

protected boolean matchesDocument (Document doc)

Throws
Exception

protected int readBuildNumberFrom (Document doc)

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