Class BundlesInstaller
java.lang.Object
org.apache.sling.testing.clients.osgi.BundlesInstaller
Utility for installing and starting additional bundles for testing
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinstallBundles(List<File> toInstall, boolean startBundles) Install a list of bundles supplied as FilesbooleanisInstalled(File bundleFile) Checks if a bundle is installed or not.booleanisInstalledWithSameVersion(File bundleFile) Check if the installed version matches the one of the bundle (file)voidstartAllBundles(List<String> symbolicNames, int timeout) Start all the bundles in a {{List}}voiduninstallBundles(List<File> toUninstall) Uninstall a list of bundles supplied as FilesvoidwaitBundlesInstalled(List<String> symbolicNames, long timeout) Wait for multiple bundles to be installed in the OSGi web console.booleanwaitForBundlesInstalled(List<String> symbolicNames, int timeoutSeconds) Deprecated.
-
Field Details
-
ACTIVE_STATE
- See Also:
-
-
Constructor Details
-
BundlesInstaller
-
-
Method Details
-
isInstalled
Checks if a bundle is installed or not. Does not retry.- Parameters:
bundleFile- bundle file- Returns:
- true if the bundle is installed
- Throws:
ClientException- if the state of the bundle could not be determined
-
isInstalledWithSameVersion
Check if the installed version matches the one of the bundle (file)- Parameters:
bundleFile- bundle file- Returns:
- true if the bundle is installed and has the same version
- Throws:
ClientException- if the installed version cannot be retrievedIOException- if the file version cannot be read
-
installBundles
public void installBundles(List<File> toInstall, boolean startBundles) throws ClientException, IOException Install a list of bundles supplied as Files- Parameters:
toInstall- list ob bundles to installstartBundles- whether to start the bundles- Throws:
ClientException- if an error occurs during installationIOException- if reading the file fails
-
uninstallBundles
Uninstall a list of bundles supplied as Files- Parameters:
toUninstall- bundles to uninstall- Throws:
ClientException- if one of the requests failedIOException- if the files cannot be read from disk
-
waitForBundlesInstalled
@Deprecated public boolean waitForBundlesInstalled(List<String> symbolicNames, int timeoutSeconds) throws ClientException, InterruptedException Deprecated.Wait for all bundles specified in symbolicNames list to be installed in the OSGi web console.- Parameters:
symbolicNames- the list of names for the bundlestimeoutSeconds- how many seconds to wait- Returns:
- true if all the bundles were installed
- Throws:
ClientException- if something went wrongInterruptedException- if interrupted
-
waitBundlesInstalled
public void waitBundlesInstalled(List<String> symbolicNames, long timeout) throws InterruptedException, TimeoutException Wait for multiple bundles to be installed in the OSGi web console.- Parameters:
symbolicNames- the list bundles to be checkedtimeout- max total time to wait for all bundles, in ms, before throwingTimeoutException- Throws:
TimeoutException- if the timeout was reached before all the bundles were installedInterruptedException- to mark this operation as "waiting", callers should rethrow it
-
startAllBundles
public void startAllBundles(List<String> symbolicNames, int timeout) throws InterruptedException, TimeoutException Start all the bundles in a {{List}}- Parameters:
symbolicNames- the list of bundles to starttimeout- total max time to wait for all the bundles, in ms- Throws:
TimeoutException- if the timeout is reached before all the bundles are startedInterruptedException- to mark this operation as "waiting", callers should rethrow it
-
waitBundlesInstalled(List, long)