Tm1EngineSource
import io.skipcheck.tm1.testcontainers.Tm1EngineSource; Where a Tm1EngineContainer gets TM1 v12 from.
The tm1-engine image contains no IBM software, so every container needs one of
these. They mirror the image's own sources (see the image's README), and
Tm1Source, which does the same for TM1 11.
discover finds one from the environment, so tests don't hard-code paths.
Each setting is read first as a system property and then as an environment variable,
under the same name. The first source found wins, in this order:
TM1_ENGINE_PRIVATE_IMAGE: an image with TM1 built in (Tm1EngineSource.PrivateImage)TM1_ENGINE_HOME_DIR: an install the image made, as a folder (Tm1EngineSource.InstallDir)TM1_ENGINE_INSTALL_VOLUME: a Docker volume holding such an install (Tm1EngineSource.InstallVolume)TM1_ENGINE_BUNDLE_DIR, optionally withTM1_ENGINE_BUNDLE: a folder holding IBM's package, and the file name to use from it (Tm1EngineSource.Bundle)TM1_ENGINE_BUNDLE_URL, optionally withTM1_ENGINE_BUNDLE_SHA256: a download link for the package (Tm1EngineSource.BundleUrl)TM1_BUNDLE_DIR, TM1 11's downloads folder, when it holds a TM1 v12 package too: one folder then serves both versions
Members
PRIVATE_IMAGE static | Settings read by discover, in the order they're tried. |
HOME_DIR static | An install the image made, as a folder, for Tm1EngineSource.InstallDir. |
INSTALL_VOLUME static | A Docker volume holding an install, for Tm1EngineSource.InstallVolume. |
BUNDLE_DIR static | A folder holding IBM's package, for Tm1EngineSource.Bundle. |
BUNDLE static | The package's file name within BUNDLE_DIR; the newest one if unset. |
BUNDLE_URL static | A download link for IBM's package, for Tm1EngineSource.BundleUrl. |
BUNDLE_SHA256 static | The SHA-256 to check the BUNDLE_URL download against; optional. |
describe | A short description for logs and messages. |
discover static | Finds a source from system properties and environment variables. |
discover static | Finds a source using lookup to read each setting. |
PRIVATE_IMAGE
staticString PRIVATE_IMAGESettings read by discover, in the order they're tried.
HOME_DIR
staticString HOME_DIRAn install the image made, as a folder, for Tm1EngineSource.InstallDir.
INSTALL_VOLUME
staticString INSTALL_VOLUMEA Docker volume holding an install, for Tm1EngineSource.InstallVolume.
BUNDLE_DIR
staticString BUNDLE_DIRA folder holding IBM's package, for Tm1EngineSource.Bundle.
BUNDLE
staticString BUNDLEThe package's file name within BUNDLE_DIR; the newest one if unset.
BUNDLE_URL
staticString BUNDLE_URLA download link for IBM's package, for Tm1EngineSource.BundleUrl.
BUNDLE_SHA256
staticString BUNDLE_SHA256The SHA-256 to check the BUNDLE_URL download against; optional.
describe
String describe()A short description for logs and messages. Never includes a URL's query string.
Returns
- the description
discover
staticstatic Optional<Tm1EngineSource> discover()Finds a source from system properties and environment variables. See the class docs.
Returns
- the source, or empty if none is configured
Throws
IllegalArgumentException- if a setting is present but invalid
discover
staticstatic Optional<Tm1EngineSource> discover(Function<String,String> lookup) Finds a source using lookup to read each setting. Blank values count as
unset.
Parameters
lookup- reads a setting by name, returning
nullif it's unset
Returns
- the first source found, or empty if none is configured
Throws
IllegalArgumentException- if a setting is present but invalid, such as a folder that doesn't exist. A wrong setting fails rather than silently skipping the tests.
Also in the Javadoc.