public class ReleaseRepository
extends java.lang.Object
The releases are used by tests, for instance by the upgrade and compatibility tests, to verify characteristics and behavior across Derby releases.
This particular repository is rather dumb - it is up to the user to keep the
repository content updated. The repository layout is based on the layout of
the SVN repository for releases at
https://svn.apache.org/repos/asf/db/derby/jars
. This means there will
be a directory for each release, where the directory name is the release
version. Inside this directory, all the distribution JARs can be found.
The repository location defaults to $HOME/.derbyTestingReleases
on
UNIX-like systems, and to %UserProfile%\.derbyTestingReleases
on
Windows (in Java, both of these maps to the system property 'user.home').
The location can be overridden by specifying the system property
derbyTesting.oldReleasePath
.
If the default location doesn't exist, and the system property
derbyTesting.oldReleasePath
is unspecified, it is up to the tests
using the release repository to decide if this condition fails the test or
not. If the system property is set to a non-existing directory an exception
will be thrown when instantiating the repository.
The repository is lazily initialized, as there's no reason to incur the initialization cost when running tests that don't require the repository. The disk is inspected only when the repository is instantiated, any updates to the on-disk repository after the repository has been instantiated will not take effect.
Implementation note: This code should be runnable with J2ME, which means that it needs to be compatible with J2SE 1.4 for the time being.
Modifier and Type | Field and Description |
---|---|
private static java.io.File |
DEFAULT_HOME |
private java.util.List<DerbyDistribution> |
dists
List of distributions found in the repository.
|
private static java.lang.String |
OVERRIDE_HOME_PROP
The property used to override the location of the repository.
|
private static ReleaseRepository |
repos
The repository instance.
|
private java.io.File |
reposLocation
The repository location (on disk).
|
Modifier | Constructor and Description |
---|---|
private |
ReleaseRepository(java.io.File reposLocation)
Creates a new, empty repository.
|
Modifier and Type | Method and Description |
---|---|
private void |
buildDistributionList() |
private void |
filterDistributions(java.util.List dists)
Filters out distributions that cannot be run in the current environment
for some reason.
|
DerbyDistribution[] |
getDistributions()
Returns the list of distributions in the repository.
|
static ReleaseRepository |
getInstance()
Returns the release repository object.
|
private static void |
println(java.lang.String msg)
Prints a debug message if debugging is enabled.
|
private static void |
traceit(java.lang.String msg)
Prints a trace message if tracing is enabled.
|
private static final java.lang.String OVERRIDE_HOME_PROP
private static final java.io.File DEFAULT_HOME
private static ReleaseRepository repos
private final java.io.File reposLocation
private java.util.List<DerbyDistribution> dists
null
, the
repository hasn't been initialized.private ReleaseRepository(java.io.File reposLocation)
reposLocation
- the location of the repository contentsbuildDistributionList()
public static ReleaseRepository getInstance() throws java.io.IOException
The release repository will be built from a default directory, or
from the directory specified by the system property
derbyTesting.oldReleasePath
.
java.io.IOException
public DerbyDistribution[] getDistributions()
private void buildDistributionList()
private void filterDistributions(java.util.List dists)
The reason for getting filtered out is typically due to lacking functionality or a bug in a specific Derby distribution.
dists
- the list of distributions to filter (modified in-place)private static void traceit(java.lang.String msg)
private static void println(java.lang.String msg)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.