Class PawContainer
- All Implemented Interfaces:
AutoCloseable, org.testcontainers.lifecycle.Startable
Tm1ServerContainer.
try (var tm1 = new Tm1ServerContainer(tm1Source);
var paw = new PawContainer(pawSource).withTm1Server(tm1).acceptLicense()) {
paw.start(); // starts tm1 first
return paw.getUrl(); // http://localhost:54321/
}
IBM ships PAW Local as about 30 Docker images, with compose files and a paw.sh
that starts them, in ipa_workspace_local_<release>.<build>.zip. This class uses
those as they are, never rebuilding or republishing them. It runs
docker/paw/paw-local.sh, which unpacks the zip, loads the images when any is
missing, writes PAW's configuration and runs IBM's paw.sh, inside a small Linux
"runner" container that talks to the Docker daemon. So it works the same on Windows,
macOS and Linux: the host needs only Docker. The unpacked zip and PAW's secrets live in
the Docker volume "tm1-paw-home", and IBM's compose files mount files from it by
its path on the Docker host.
Users log on to PAW as users of the TM1 server (PAAuthMode=tm1). PAW is
configured with the server's address on its network, and every PAW container is
connected to that network too, because PAW calls TM1 at the address the Admin Server
advertises.
When the TM1 server runs in Cognos (CAM) security
(Tm1ServerContainer.withCamSecurity(CognosContainer, String...)), PAW does too (PAAuthMode=cam), as
pa-setup wires it: users log on through Cognos, in the TM1 server's namespace. PAW
checks logons with Cognos's dispatcher on the network (http://cognos:9300), and
sends browsers to Cognos's address on the host to log on. Tests log on with a Cognos
test user's name and password, which PAW checks with Cognos. A browser that logs on
through Cognos isn't sent back to PAW, though: Cognos hands logons back only to the
addresses in IBM's pmhub.html, which CognosContainer doesn't install
(pa-setup does, with COGNOS_PMHUB_URLS).
Things to know:
- The license: starting fails unless IBM's PAW license is accepted, with
acceptLicense()or by setting "PAW_ACCEPT_LICENSE"=true. - One PAW per Docker daemon: IBM's compose files give every container a fixed
name, under the compose project
paw. Most tests share one, withRequiresPaw. - Heavy: PAW needs about 15 GB of memory. The first start loads about 8 GB of images, which takes a few minutes; later starts take about a minute.
- Cleanup:
stop()removes the PAW containers and keeps PAW's data. IBM's containers carry no Testcontainers labels, so if the JVM dies they keep running, and the next start reuses them. - linux/amd64 only: on Apple Silicon, IBM's images run under Rosetta.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccepts IBM's license for Planning Analytics Workspace, which is in the PAW Local zip aslicenses/LA_en.Where PAW comes from.@Nullable Tm1ServerContainerThe TM1 server set withwithTm1Server(Tm1ServerContainer).getUrl()PAW's address as seen from the host, e.g.booleanWhether PAW is started.static PawContainershared()The PAW most tests share: one per test JVM, started on first use with the sourcePawSource.discover()finds, againstTm1ServerContainer.shared().voidstart()Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works.voidstop()Removes the PAW containers, keeping PAW's data.toString()Lists servers from a separate Admin Server (Tm1ServerContainer.withAdminServer(Tm1AdminServerContainer)) instead of the TM1 server's own.withSetting(String name, String value) Sets one ofpaw-local.sh'sPAW_*settings, such asPAW_JVM_ARGSorPAW_TM1WEB_URL.withStartupTimeout(Duration timeout) How longstart()may take to load IBM's images and start PAW.Logs PAW users on totm1, and lists servers from its Admin Server.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.lifecycle.Startable
close, getDependencies
-
Field Details
-
ACCEPT_LICENSE
Accepts IBM's license for PAW whentrue. Read as a system property, then an environment variable.- See Also:
-
HOME_VOLUME
The Docker volume holding the unpacked PAW Local zip and PAW's secrets, shared by every PAW started this way.- See Also:
-
-
Constructor Details
-
PawContainer
A PAW started fromsource's zip.- Parameters:
source- the PAW Local zip
-
-
Method Details
-
withTm1Server
Logs PAW users on totm1, and lists servers from its Admin Server. Startstm1first if it isn't running.- Parameters:
tm1- the TM1 server- Returns:
- this container
-
withAdminServer
Lists servers from a separate Admin Server (Tm1ServerContainer.withAdminServer(Tm1AdminServerContainer)) instead of the TM1 server's own. Users still log on through that TM1 server, which must be registered with this Admin Server and on its network.- Parameters:
admin- the Admin Server PAW lists servers from- Returns:
- this container
-
acceptLicense
Accepts IBM's license for Planning Analytics Workspace, which is in the PAW Local zip aslicenses/LA_en. IBM's own setup asks for this in its admin tool, which this class skips.- Returns:
- this container
-
withSetting
Sets one ofpaw-local.sh'sPAW_*settings, such asPAW_JVM_ARGSorPAW_TM1WEB_URL. The TM1 server, ports, network and paths are set by this class.- Parameters:
name- the setting, starting withPAW_value- its value- Returns:
- this container
-
withStartupTimeout
How longstart()may take to load IBM's images and start PAW. Default: 20 minutes, since the first start loads about 8 GB of images.- Parameters:
timeout- the time allowed- Returns:
- this container
-
getSource
-
getTm1Server
The TM1 server set withwithTm1Server(Tm1ServerContainer).- Returns:
- the server, or
nullif none was set
-
isRunning
-
getUrl
PAW's address as seen from the host, e.g.http://localhost:54321/.- Returns:
- the URL, ending in
/ - Throws:
IllegalStateException- if PAW isn't started
-
start
public void start()Starts the TM1 server if needed, then PAW, and waits until a TM1 call through PAW works.- Specified by:
startin interfaceorg.testcontainers.lifecycle.Startable- Throws:
IllegalStateException- if the license isn't accepted or no TM1 server is set
-
stop
public void stop()Removes the PAW containers, keeping PAW's data.- Specified by:
stopin interfaceorg.testcontainers.lifecycle.Startable
-
toString