Package org.opennms.smoketest.utils
Class KarafShell
- java.lang.Object
-
- org.opennms.smoketest.utils.KarafShell
-
public class KarafShell extends Object
Helper class to run commands in the Karaf Shell as well as verify the log.- Author:
- mvrueden
-
-
Constructor Summary
Constructors Constructor Description KarafShell(InetSocketAddress sshAddress)
KarafShell(InetSocketAddress sshAddress, String username, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KarafShell
runCommand(String command)
Is the same asrunCommand(command, null
.KarafShell
runCommand(String command, java.util.function.Function<String,Boolean> verifyOutputFunction)
Runs the given command in the karaf shell.KarafShell
verifyLog(java.util.function.Function<String,Boolean> function)
Is the same asrunCommand(null, function)
.
-
-
-
Constructor Detail
-
KarafShell
public KarafShell(InetSocketAddress sshAddress)
-
KarafShell
public KarafShell(InetSocketAddress sshAddress, String username, String password)
-
-
Method Detail
-
runCommand
public KarafShell runCommand(String command, java.util.function.Function<String,Boolean> verifyOutputFunction)
Runs the given command in the karaf shell. The optionalfunction
verifies the output.- Parameters:
command
- the command to run, e.g. "features:list"verifyOutputFunction
- An optional function to verify the output, e.g. to check for certain log messages- Returns:
- The shell itself, to run further commands.
-
runCommand
public KarafShell runCommand(String command)
Is the same asrunCommand(command, null
.- See Also:
runCommand(String, Function)
-
verifyLog
public KarafShell verifyLog(java.util.function.Function<String,Boolean> function)
Is the same asrunCommand(null, function)
.- See Also:
runCommand(String, Function)
-
-