public class VersionCombinationConfigurator
extends java.lang.Object
Due to the requirement for running with a variety of Derby versions, the compatibility test suite is run as multiple processes. The test is controlled from the main process (the process in which the test/suite is started), and this process spawns additional processes for each server version and each client version. In some cases it also has to spawn additional processes to accomplish other tasks.
For development purposes the default MATS suite is sufficient for ongoing work. Eventually, and at least before cutting a new release, the full development suite should be run, since it will test the trunk against all previous releases. The other suites will test old releases against each other, and as such they are of less interest since the old releases don't change. Note however that these suites can be used to test releases on branches where this version of the compatibility test doesn't exist (just add the JARs to the release repository and configure includes or excludes to suite your needs).
NOTE 1: The set of combinations computed by this class depends on the number of old releases available on the local computer. If there are no old releases available a warning will be emitted, but the test won't fail (it will test trunk vs trunk).
NOTE 2: trunk is defined as a distribution, although it hasn't been released yet. The reason is simple: we always want to test trunk for incompatibilities against older versions.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EMB_DRIVER |
private boolean |
limitToTrunk
Decides if combinations have to involve trunk (as server or client).
|
private java.lang.String |
name
Name of the configuration, only used for informational purposes.
|
private boolean |
newestFixpackOnly
Decides if only the latest branch release is eligible for inclusion.
|
private java.util.List<DerbyVersion> |
toExclude |
private java.util.List<DerbyVersion> |
toInclude |
Modifier | Constructor and Description |
---|---|
private |
VersionCombinationConfigurator(java.lang.String name,
boolean limitToTrunk,
boolean newestFixpackOnly)
Creates a version combination configurator.
|
Modifier and Type | Method and Description |
---|---|
int |
addTests(BaseTestSuite suite)
Adds compatibility tests to the specified suite.
|
private static void |
alarm(java.lang.String msg) |
private java.util.List<DerbyDistribution> |
filterVersions()
Filters Derby distributions available in the distribution repository.
|
(package private) static java.net.URI |
getClassURI(java.lang.Class cl)
Returns the URI of the source for the specified class.
|
static VersionCombinationConfigurator |
getInstanceDevFull()
Returns a configuration that will test trunk against all other available
releases.
|
static VersionCombinationConfigurator |
getInstanceDevMATS()
Returns the default configuration intended to be run as part of
suites.all, which is a kind of minimal acceptance test (MATS).
|
static VersionCombinationConfigurator |
getInstanceOld()
Returns a configuration where the newest releases within each
major-minor version are tested against each other.
|
static VersionCombinationConfigurator |
getInstanceOldFull()
Returns a configuration where all versions found are tested against
each other.
|
private java.io.File |
getJarDirectoryOf(java.lang.Class clazz)
Returns the directory for the JAR file containing the given class.
|
java.lang.String |
getName() |
private DerbyDistribution |
getRunningDistribution()
Returns the running distribution, which is typically trunk.
|
private static void |
println(java.lang.String msg) |
void |
setExcludes(java.util.List<DerbyVersion> toExclude) |
void |
setIncludes(java.util.List<DerbyVersion> toInclude) |
private boolean |
skipServerVersion(DerbyVersion version)
Check if a certain server version should be skipped due to bugs that
prevent it from working in the current environment.
|
private java.util.List<DerbyDistribution> |
sortAndFilterVersions(java.util.List<DerbyDistribution> distributions)
Sorts and filters out distributions based on the configurator settings.
|
private static final java.lang.String EMB_DRIVER
private final java.lang.String name
private final boolean limitToTrunk
private final boolean newestFixpackOnly
private java.util.List<DerbyVersion> toInclude
private java.util.List<DerbyVersion> toExclude
private VersionCombinationConfigurator(java.lang.String name, boolean limitToTrunk, boolean newestFixpackOnly)
name
- name of the configuratorlimitToTrunk
- if true, only add combinations including trunknewestFixpackOnly
- whether or not to only include the newest
release within each pair of major-minor version.public static VersionCombinationConfigurator getInstanceDevMATS()
The default configuration is defined to be all combinations that have trunk as either the server or the client.
public static VersionCombinationConfigurator getInstanceDevFull()
public static VersionCombinationConfigurator getInstanceOld()
Given releases designated M.m.f.p (i.e. 10.8.1.2), this
configuration will include all major-minor releases with the highest
public static VersionCombinationConfigurator getInstanceOldFull()
public java.lang.String getName()
public int addTests(BaseTestSuite suite)
The following determines how many tests are added:
suite
- the suite to add the tests topublic void setIncludes(java.util.List<DerbyVersion> toInclude)
public void setExcludes(java.util.List<DerbyVersion> toExclude)
private boolean skipServerVersion(DerbyVersion version)
version
- the server version to checktrue
if the specified version should be skipped, or
false
otherwiseprivate java.util.List<DerbyDistribution> filterVersions()
private DerbyDistribution getRunningDistribution()
java.lang.IllegalStateException
- if parsing the version string fails, if
required Derby classes are missing, or if trunk is run off the
classes directoryprivate java.io.File getJarDirectoryOf(java.lang.Class clazz)
java.lang.IllegalStateException
- if the class isn't loaded from a JARprivate java.util.List<DerbyDistribution> sortAndFilterVersions(java.util.List<DerbyDistribution> distributions)
distributions
- list of distributions to filterstatic java.net.URI getClassURI(java.lang.Class cl)
cl
- class to find the source forURI
pointing to the source, or null
it cannot
be obtained.private static void println(java.lang.String msg)
private static void alarm(java.lang.String msg)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.