Class AbstractRemoteMachineActionHandler
java.lang.Object
org.uitnet.testing.smartfwk.remote_machine.AbstractRemoteMachineActionHandler
- All Implemented Interfaces:
RemoteMachineConnectionProvider
- Direct Known Subclasses:
SmartRemoteMachineActionHandler
public abstract class AbstractRemoteMachineActionHandler extends Object implements RemoteMachineConnectionProvider
- Author:
- Madhav Krishna
-
Field Summary
Fields Modifier and Type Field Description protected StringappNameprotected RemoteMachineConnectionconnectionprotected longlastRequestAccessTimeInMsprotected RemoteMachineConfigremoteMachineConfigprotected RemoteMachineManagerremoteMachineManagerprotected StringremoteMachineNameprotected intsessionExpiryDurationInSeconds -
Constructor Summary
Constructors Constructor Description AbstractRemoteMachineActionHandler(String remoteMachineName, String appName, int sessionExpiryDurationInSeconds, RemoteMachineConfig remoteMachineConfig) -
Method Summary
Modifier and Type Method Description AbstractRemoteMachineActionHandlerclone()voidconnect()AbstractRemoteMachineActionHandlerdeleteFiles(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue)voiddisconnect()protected abstract voiddisconnect(RemoteMachineConnection connection)StringdownloadFile(String absoluteRemoteFilePath, String absoluteLocalPath)Downloads the file from remote location.StringdownloadFile(String absoluteRemotePath, String remoteFileName, String absoluteLocalPath)Return the local file path where the file is downloaded.StringdownloadFileAsDifferentName(String absoluteRemoteFilePath, String absoluteLocalPath, String newFileName)StringdownloadFileAsDifferentName(String absoluteRemotePath, String remoteFileName, String absoluteLocalPath, String newFileName)List<String>downloadFiles(String absoluteRemotePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, String absoluteLocalPath)StringexecuteCommand(String command)List<String>getFileList(String absolutePath)List<String>getFolderList(String absolutePath)protected booleanisSessionExpired()voidsetRemoteMachineManager(RemoteMachineManager remoteMachineManager)StringuploadFile(String absoluteLocalFilePath, String absoluteRemotePath)Upload the local file on remote location.StringuploadFile(String absoluteLocalPath, String localFileName, String absoluteRemotePath)Upload the file from local path to remote path.StringuploadFileAsDifferentName(String absoluteLocalFilePath, String absoluteRemotePath, String newRemoteFileName)StringuploadFileAsDifferentName(String absoluteLocalPath, String localFileName, String absoluteRemotePath, String newRemoteFileName)List<String>uploadFiles(String absoluteLocalPath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, String absoluteRemotePath)AbstractRemoteMachineActionHandlervalidateFileExists(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, int maxIterationsToLocateFile)AbstractRemoteMachineActionHandlervalidateFilesExist(String absolutePath, List<String> files, int maxIterationsToLocateFile)AbstractRemoteMachineActionHandlervalidateFolderExist(String absolutePath, List<String> folders, int maxIterationsToLocateFolder)AbstractRemoteMachineActionHandlervalidateFolderExists(String absolutePath, TextMatchMechanism folderNameMatchMechanism, String expectedValue, int maxIterationsToLocateFolder)Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.uitnet.testing.smartfwk.remote_machine.RemoteMachineConnectionProvider
connect
-
Field Details
-
remoteMachineManager
-
appName
-
remoteMachineName
-
remoteMachineConfig
-
sessionExpiryDurationInSeconds
protected int sessionExpiryDurationInSeconds -
connection
-
lastRequestAccessTimeInMs
protected long lastRequestAccessTimeInMs
-
-
Constructor Details
-
AbstractRemoteMachineActionHandler
public AbstractRemoteMachineActionHandler(String remoteMachineName, String appName, int sessionExpiryDurationInSeconds, RemoteMachineConfig remoteMachineConfig)
-
-
Method Details
-
setRemoteMachineManager
-
connect
public void connect() -
isSessionExpired
protected boolean isSessionExpired() -
getFileList
-
getFolderList
-
validateFileExists
public AbstractRemoteMachineActionHandler validateFileExists(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, int maxIterationsToLocateFile) -
validateFilesExist
public AbstractRemoteMachineActionHandler validateFilesExist(String absolutePath, List<String> files, int maxIterationsToLocateFile) -
validateFolderExists
public AbstractRemoteMachineActionHandler validateFolderExists(String absolutePath, TextMatchMechanism folderNameMatchMechanism, String expectedValue, int maxIterationsToLocateFolder) -
validateFolderExist
public AbstractRemoteMachineActionHandler validateFolderExist(String absolutePath, List<String> folders, int maxIterationsToLocateFolder) -
deleteFiles
public AbstractRemoteMachineActionHandler deleteFiles(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue) -
downloadFiles
-
uploadFiles
-
executeCommand
-
downloadFile
public String downloadFile(String absoluteRemotePath, String remoteFileName, String absoluteLocalPath)Return the local file path where the file is downloaded.- Parameters:
absoluteRemotePath-remoteFileName-absoluteLocalPath-- Returns:
-
downloadFileAsDifferentName
-
downloadFile
Downloads the file from remote location. Returns the local file path where it got downloaded.- Parameters:
absoluteRemoteFilePath-absoluteLocalPath-- Returns:
-
downloadFileAsDifferentName
-
uploadFile
public String uploadFile(String absoluteLocalPath, String localFileName, String absoluteRemotePath)Upload the file from local path to remote path. Returns the remote file path where the file was uploaded.- Parameters:
absoluteLocalPath-localFileName-absoluteRemotePath-- Returns:
-
uploadFileAsDifferentName
-
uploadFile
Upload the local file on remote location. Returns the remote file path where it got uploaded.- Parameters:
absoluteLocalFilePath-absoluteRemotePath-- Returns:
-
uploadFileAsDifferentName
-
disconnect
public void disconnect()- Specified by:
disconnectin interfaceRemoteMachineConnectionProvider
-
clone
-
disconnect
-