Class UninstallerSessionBuilder
java.lang.Object
com.install4j.api.test.session.AbstractSessionBuilder
com.install4j.api.test.session.InstallationDirectorySessionBuilder
com.install4j.api.test.session.UninstallerSessionBuilder
Builds and starts an
UninstallerSession for an installed uninstaller.
try (UninstallerSession session = UninstallerSessionBuilder
.forInstallation(installedDir)
.start()) {
session.currentScreen().clickNext();
session.waitForScreenId("uninstallFinished");
session.currentScreen().clickFinish();
}
Kotlin extensions
SessionExtensions.kt in this package adds useSession { ... } as a Kotlin
inline extension: it calls start(), runs the trailing lambda on the resulting
UninstallerSession as this, and closes the session afterwards.
-
Method Summary
Modifier and TypeMethodDescriptionAdditional command-line arguments passed to the installer application.debug(boolean debug) Switch the session to in-process debug mode.static UninstallerSessionBuilderforInstallation(File installationDirectory) Create a builder for the given installation directory containing a previously installed install4j uninstaller.Redirect install4j's runtime logger output to the given file.start()Start the installer application and return the typed session handle.systemProperty(String key, String value) Set a system property on the test JVM before the installer starts.Default timeout applied to every wait operation.workingDirectory(File dir) Working directory for the running installer application.
-
Method Details
-
forInstallation
@NotNull public static UninstallerSessionBuilder forInstallation(@NotNull File installationDirectory) Create a builder for the given installation directory containing a previously installed install4j uninstaller. The directory is the installation target chosen for the corresponding installer run. -
timeout
Description copied from class:AbstractSessionBuilderDefault timeout applied to every wait operation. The default is 3 minutes. Override per session for longer installations.- Overrides:
timeoutin classAbstractSessionBuilder
-
arg
Description copied from class:AbstractSessionBuilderAdditional command-line arguments passed to the installer application.- Overrides:
argin classAbstractSessionBuilder
-
systemProperty
@NotNull public UninstallerSessionBuilder systemProperty(@NotNull String key, @NotNull String value) Description copied from class:AbstractSessionBuilderSet a system property on the test JVM before the installer starts.- Overrides:
systemPropertyin classAbstractSessionBuilder
-
workingDirectory
Description copied from class:AbstractSessionBuilderWorking directory for the running installer application.- Overrides:
workingDirectoryin classAbstractSessionBuilder
-
logFile
Description copied from class:AbstractSessionBuilderRedirect install4j's runtime logger output to the given file.- Overrides:
logFilein classAbstractSessionBuilder
-
debug
Description copied from class:AbstractSessionBuilderSwitch the session to in-process debug mode. By default the test API spawns the produced installer media as a real subprocess (with its bundled JRE, native launcher, and the full extraction code path) and drives it over IPC. In debug mode it runs the installer in the test JVM directly, which is faster but requires aninstall4jc -gdebug build to exist alongside the media file. Use debug mode locally during development; leave it off for CI runs that should exercise the real installer.- Overrides:
debugin classAbstractSessionBuilder
-
start
Description copied from class:AbstractSessionBuilderStart the installer application and return the typed session handle.- Specified by:
startin classAbstractSessionBuilder
-