skipcheck

TM1 Testcontainers · Docs · Containers

PlanningAnalyticsEnvironment.Builder

import { PlanningAnalyticsEnvironment } from "@skipcheck/tm1-testcontainers";

Builds a PlanningAnalyticsEnvironment. Every part is optional.

Members

tm1Adds a TM1 server named name (its server name and network alias), changed with customizer once wired.
adminServerAdds a shared Admin Server even for one TM1 server, changed with customizer.
tm1WebAdds TM1 Web, listing every server, changed with customizer.
pawAdds PAW, changed with customizer (to accept the license, say).
cognosAdds Cognos, putting every TM1 server in CAM security; add its test users with customizer.
keycloakAdds Keycloak, giving Cognos an OIDC namespace, changed with customizer.
camSecurityThe CAM namespace TM1's users log on through, and the TM1 administrators (by default, the first test user).
tm1SourceWhere TM1 comes from, rather than Tm1Source.discover.
tm1WebSourceWhere TM1 Web comes from, rather than Tm1WebSource.discover.
pawSourceWhere PAW comes from, rather than PawSource.discover.
cognosSourceWhere Cognos comes from, rather than CognosSource.discover.
networkThe network to use, rather than a new one (which the environment removes when it stops).
reuseKeeps the containers running between test runs, when you've also turned on reuse (testcontainers.reuse.enable=true in ~/.testcontainers.properties, or TESTCONTAINERS_REUSE_ENABLE=true).
withFileSourcesThe sources and images read from pa-environment.yaml.
buildThe environment, wired.
buildBuilds, with the developer's reuse switch given, so tests needn't set it.
build

tm1

tm1(name: string, customizer: Customizer<Tm1ServerContainer> = none): this

Adds a TM1 server named name (its server name and network alias), changed with customizer once wired.

Throws

IllegalArgumentException for a bad name, or one added twice

adminServer

adminServer(customizer: Customizer<Tm1AdminServerContainer> = none): this

Adds a shared Admin Server even for one TM1 server, changed with customizer.

tm1Web

tm1Web(customizer: Customizer<Tm1WebContainer> = none): this

Adds TM1 Web, listing every server, changed with customizer.

paw

paw(customizer: Customizer<PawContainer>): this

Adds PAW, changed with customizer (to accept the license, say). With cognos, users log on to PAW through Cognos, in the CAM namespace.

cognos

cognos(customizer: Customizer<CognosContainer>): this

Adds Cognos, putting every TM1 server in CAM security; add its test users with customizer.

keycloak

keycloak(customizer: Customizer<KeycloakContainer> = none): this

Adds Keycloak, giving Cognos an OIDC namespace, changed with customizer.

camSecurity

camSecurity(namespace: CognosContainer.Namespace, ...admins: string[]): this

The CAM namespace TM1's users log on through, and the TM1 administrators (by default, the first test user).

tm1Source

tm1Source(source: Tm1Source): this

Where TM1 comes from, rather than Tm1Source.discover.

tm1WebSource

tm1WebSource(source: Tm1WebSource): this

Where TM1 Web comes from, rather than Tm1WebSource.discover.

pawSource

pawSource(source: PawSource): this

Where PAW comes from, rather than PawSource.discover.

cognosSource

cognosSource(source: CognosSource): this

Where Cognos comes from, rather than CognosSource.discover.

network

network(network: Network): this

The network to use, rather than a new one (which the environment removes when it stops).

reuse

reuse(reuse: boolean): this

Keeps the containers running between test runs, when you've also turned on reuse (testcontainers.reuse.enable=true in ~/.testcontainers.properties, or TESTCONTAINERS_REUSE_ENABLE=true). A later run with the same configuration finds them, and objects tests left behind are still there. Without the switch it has no effect. See PlanningAnalyticsEnvironment for what's reused and how to start clean.

With your own network, reuse only works if it's the same network each run: its name is part of the environment's identity.

Parameters

reuse
whether to keep the containers

Returns

this builder

withFileSources

withFileSources(sources: FileSources): this

The sources and images read from pa-environment.yaml.

build

build(): PlanningAnalyticsEnvironment

The environment, wired.

Throws

IllegalStateException if parts are missing, or don't go together

build

build(reuseEnabled: boolean): PlanningAnalyticsEnvironment

Builds, with the developer's reuse switch given, so tests needn't set it.

build

build(reuseEnabled: boolean = DockerHost.reuseEnabled()): PlanningAnalyticsEnvironment