com.atlassian.jira.util
Class MockBuildUtilsInfo

java.lang.Object
  extended by com.atlassian.jira.util.MockBuildUtilsInfo
All Implemented Interfaces:
BuildUtilsInfo

public class MockBuildUtilsInfo
extends Object
implements BuildUtilsInfo

Since:
v6.2.3

Constructor Summary
MockBuildUtilsInfo()
           
 
Method Summary
 int getApplicationBuildNumber()
          Gets the build number of this JIRA install.
 String getApplinksVersion()
          Returns the version of AppLinks that JIRA ships with.
 String getBuildInformation()
          Gets a build information summary as a String.
 String getBuildPartnerName()
          Gets the partner name of this JIRA build
 String getBuildProperty(String key)
           
 String getCommitId()
          Returns the id of the SCM commit that was used to make this build of JIRA.
 Date getCurrentBuildDate()
          Gets the date this version of JIRA was built on.
 String getCurrentBuildNumber()
          Gets the current build number of JIRA.
 int getDatabaseBuildNumber()
          Gets the build number of the database that this JIRA instance points to.
 String getDocVersion()
          Return the version used for JIRA documentation.
 String getGuavaOsgiVersion()
           
 String getLuceneVersion()
          Returns the version of Apache Lucene included in JIRA.
 String getMinimumUpgradableBuildNumber()
          Gets the minimal build number that JIRA can upgrade from
 String getMinimumUpgradableVersion()
          Get the minimum version of JIRA that can be upgraded to this instance version.
 String getSalVersion()
          Returns the version of Atlassian SAL that JIRA exports into OSGI-land.
 String getSvnRevision()
          Returns the SCM commit id that was used to make this build of JIRA.
 Collection<Locale> getUnavailableLocales()
           
 String getVersion()
          Gets the current version of JIRA
 int[] getVersionNumbers()
          Gets the numerical components of the version.
 boolean isBeta()
          Returns whether the current version is a beta (i.e.
 boolean isMilestone()
          Returns whether the current version is a milestone (i.e.
 boolean isRc()
          Returns whether the current version is a release candidate (i.e.
 boolean isSnapshot()
          Returns whether the current version is a snapshot (i.e.
 MockBuildUtilsInfo setDocVersion(String docVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockBuildUtilsInfo

public MockBuildUtilsInfo()
Method Detail

getVersion

public String getVersion()
Description copied from interface: BuildUtilsInfo
Gets the current version of JIRA

Specified by:
getVersion in interface BuildUtilsInfo
Returns:
the current version of JIRA

getDocVersion

public String getDocVersion()
Description copied from interface: BuildUtilsInfo
Return the version used for JIRA documentation. This is the version that JIRA uses when generating links to its externally hosted documentation.

Specified by:
getDocVersion in interface BuildUtilsInfo
Returns:
the version used for JIRA documentation.

setDocVersion

public MockBuildUtilsInfo setDocVersion(String docVersion)

getVersionNumbers

public int[] getVersionNumbers()
Description copied from interface: BuildUtilsInfo
Gets the numerical components of the version.
    • "5.0" gives [5, 0, 0]
      "5.0.1" gives [5, 0, 1]
      "5.0-beta1" gives [5, 0, 0]
      "5.0.1-SNAPSHOT" gives [5, 0, 1]
  • The returned array is guaranteed to have at least 3 elements. Any non-numeric suffix in getVersion() is ignored.

    A simple way to use this information is with Guava's Ints.lexicographicalComparator():

      int[] v510 = {5, 1, 0};
      if (Ints.lexicographicalComparator().compare(buildUtils.getVersionNumbers(), v510) >= 0 ) { ...
     

    Specified by:
    getVersionNumbers in interface BuildUtilsInfo
    Returns:
    the leading numerical components of getVersion()

    getCurrentBuildNumber

    public String getCurrentBuildNumber()
    Description copied from interface: BuildUtilsInfo
    Gets the current build number of JIRA.

    This is the same value as BuildUtilsInfo.getApplicationBuildNumber() except it is returned as a String.

    Specified by:
    getCurrentBuildNumber in interface BuildUtilsInfo
    Returns:
    the current build number of JIRA
    See Also:
    BuildUtilsInfo.getDatabaseBuildNumber(), BuildUtilsInfo.getApplicationBuildNumber()

    getApplicationBuildNumber

    public int getApplicationBuildNumber()
    Description copied from interface: BuildUtilsInfo
    Gets the build number of this JIRA install.

    That is, the build number of the currently running installation files. The DB also stores a build number.

    Specified by:
    getApplicationBuildNumber in interface BuildUtilsInfo
    Returns:
    the build number of this JIRA install.
    See Also:
    BuildUtilsInfo.getDatabaseBuildNumber()

    getDatabaseBuildNumber

    public int getDatabaseBuildNumber()
    Description copied from interface: BuildUtilsInfo
    Gets the build number of the database that this JIRA instance points to.

    Under normal circumstances this will be the same as the build number of the JIRA installation. However, when you first upgrade a JIRA database or import data exported from an older JIRA, the existing database will start on the previous build number. JIRA will then run "Upgrade Tasks" to update the data in the DB.

    Specified by:
    getDatabaseBuildNumber in interface BuildUtilsInfo
    Returns:
    the build number of the database that JIRA points to.
    See Also:
    BuildUtilsInfo.getCurrentBuildNumber()

    getMinimumUpgradableBuildNumber

    public String getMinimumUpgradableBuildNumber()
    Description copied from interface: BuildUtilsInfo
    Gets the minimal build number that JIRA can upgrade from

    Specified by:
    getMinimumUpgradableBuildNumber in interface BuildUtilsInfo
    Returns:
    the minimal build number that JIRA can upgrade from

    getCurrentBuildDate

    public Date getCurrentBuildDate()
    Description copied from interface: BuildUtilsInfo
    Gets the date this version of JIRA was built on.

    Specified by:
    getCurrentBuildDate in interface BuildUtilsInfo
    Returns:
    the date this version of JIRA was built on

    getBuildPartnerName

    public String getBuildPartnerName()
    Description copied from interface: BuildUtilsInfo
    Gets the partner name of this JIRA build

    Specified by:
    getBuildPartnerName in interface BuildUtilsInfo
    Returns:
    the partner name of this JIRA build.

    getBuildInformation

    public String getBuildInformation()
    Description copied from interface: BuildUtilsInfo
    Gets a build information summary as a String.

    Specified by:
    getBuildInformation in interface BuildUtilsInfo
    Returns:
    a build information summary

    getSvnRevision

    public String getSvnRevision()
    Description copied from interface: BuildUtilsInfo
    Returns the SCM commit id that was used to make this build of JIRA. This used to be an SVN revision, but is now a Git commit id (aka a SHA1). This method returns an empty string if JIRA was built from the source distribution.

    Specified by:
    getSvnRevision in interface BuildUtilsInfo
    Returns:
    a String containing the SCM commit id, or an empty String.

    getCommitId

    public String getCommitId()
    Description copied from interface: BuildUtilsInfo
    Returns the id of the SCM commit that was used to make this build of JIRA. This method returns an empty string if JIRA was built from the source distribution.

    Specified by:
    getCommitId in interface BuildUtilsInfo
    Returns:
    the SCM commit id that was used to make this build of JIRA.

    getMinimumUpgradableVersion

    public String getMinimumUpgradableVersion()
    Description copied from interface: BuildUtilsInfo
    Get the minimum version of JIRA that can be upgraded to this instance version.

    Specified by:
    getMinimumUpgradableVersion in interface BuildUtilsInfo
    Returns:
    the minimum version that can be upgraded.

    getUnavailableLocales

    public Collection<Locale> getUnavailableLocales()
    Specified by:
    getUnavailableLocales in interface BuildUtilsInfo

    getSalVersion

    public String getSalVersion()
    Description copied from interface: BuildUtilsInfo
    Returns the version of Atlassian SAL that JIRA exports into OSGI-land.

    Specified by:
    getSalVersion in interface BuildUtilsInfo
    Returns:
    the version of Atlassian SAL that JIRA exports

    getApplinksVersion

    public String getApplinksVersion()
    Description copied from interface: BuildUtilsInfo
    Returns the version of AppLinks that JIRA ships with.

    Specified by:
    getApplinksVersion in interface BuildUtilsInfo
    Returns:
    the version of AppLinks that JIRA ships with

    getLuceneVersion

    public String getLuceneVersion()
    Description copied from interface: BuildUtilsInfo
    Returns the version of Apache Lucene included in JIRA.

    This will be the version used to export the lucene packages to the OSGI container.

    Specified by:
    getLuceneVersion in interface BuildUtilsInfo
    Returns:
    the version of Apache Lucene included in JIRA.

    getGuavaOsgiVersion

    public String getGuavaOsgiVersion()
    Specified by:
    getGuavaOsgiVersion in interface BuildUtilsInfo
    Returns:
    the osgi version that Guava (com.google.common) shold be exported as

    getBuildProperty

    public String getBuildProperty(String key)
    Specified by:
    getBuildProperty in interface BuildUtilsInfo

    isBeta

    public boolean isBeta()
    Description copied from interface: BuildUtilsInfo
    Returns whether the current version is a beta (i.e. has -beta after its version numbers)

    Specified by:
    isBeta in interface BuildUtilsInfo
    Returns:
    true if the version string has -beta after its version numbers, otherwise false (case-insensitive)

    isRc

    public boolean isRc()
    Description copied from interface: BuildUtilsInfo
    Returns whether the current version is a release candidate (i.e. has -rc after its version numbers)

    Specified by:
    isRc in interface BuildUtilsInfo
    Returns:
    true if the version string has -rc after its version numbers, otherwise false (case-insensitive)

    isSnapshot

    public boolean isSnapshot()
    Description copied from interface: BuildUtilsInfo
    Returns whether the current version is a snapshot (i.e. has -SNAPSHOT after its version numbers)

    Specified by:
    isSnapshot in interface BuildUtilsInfo
    Returns:
    true if the version string has -SNAPSHOT after its version numbers, otherwise false (case-insensitive)

    isMilestone

    public boolean isMilestone()
    Description copied from interface: BuildUtilsInfo
    Returns whether the current version is a milestone (i.e. has -mXX after its version numbers)

    Specified by:
    isMilestone in interface BuildUtilsInfo
    Returns:
    true if the version string has -m after its version numbers, otherwise false (case-insensitive)


    Copyright © 2002-2014 Atlassian. All Rights Reserved.