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
All Methods Instance Methods Abstract Methods Concrete Methods 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)AbstractRemoteMachineActionHandlervalidateFilesExist(String absolutePath, List<String> files)AbstractRemoteMachineActionHandlervalidateFolderExist(String absolutePath, List<String> folders)AbstractRemoteMachineActionHandlervalidateFolderExists(String absolutePath, TextMatchMechanism directoryNameMatchMechanism, String expectedValue)-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.uitnet.testing.smartfwk.remote_machine.RemoteMachineConnectionProvider
connect
-
-
-
-
Field Detail
-
remoteMachineManager
protected RemoteMachineManager remoteMachineManager
-
appName
protected String appName
-
remoteMachineName
protected String remoteMachineName
-
remoteMachineConfig
protected RemoteMachineConfig remoteMachineConfig
-
sessionExpiryDurationInSeconds
protected int sessionExpiryDurationInSeconds
-
connection
protected RemoteMachineConnection connection
-
lastRequestAccessTimeInMs
protected long lastRequestAccessTimeInMs
-
-
Constructor Detail
-
AbstractRemoteMachineActionHandler
public AbstractRemoteMachineActionHandler(String remoteMachineName, String appName, int sessionExpiryDurationInSeconds, RemoteMachineConfig remoteMachineConfig)
-
-
Method Detail
-
setRemoteMachineManager
public void setRemoteMachineManager(RemoteMachineManager remoteMachineManager)
-
connect
public void connect()
-
isSessionExpired
protected boolean isSessionExpired()
-
validateFileExists
public AbstractRemoteMachineActionHandler validateFileExists(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue)
-
validateFilesExist
public AbstractRemoteMachineActionHandler validateFilesExist(String absolutePath, List<String> files)
-
validateFolderExists
public AbstractRemoteMachineActionHandler validateFolderExists(String absolutePath, TextMatchMechanism directoryNameMatchMechanism, String expectedValue)
-
validateFolderExist
public AbstractRemoteMachineActionHandler validateFolderExist(String absolutePath, List<String> folders)
-
deleteFiles
public AbstractRemoteMachineActionHandler deleteFiles(String absolutePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue)
-
downloadFiles
public List<String> downloadFiles(String absoluteRemotePath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, String absoluteLocalPath)
-
uploadFiles
public List<String> uploadFiles(String absoluteLocalPath, TextMatchMechanism fileNameMatchMechanism, String expectedValue, String absoluteRemotePath)
-
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
public String downloadFileAsDifferentName(String absoluteRemotePath, String remoteFileName, String absoluteLocalPath, String newFileName)
-
downloadFile
public String downloadFile(String absoluteRemoteFilePath, String absoluteLocalPath)
Downloads the file from remote location. Returns the local file path where it got downloaded.- Parameters:
absoluteRemoteFilePath-absoluteLocalPath-- Returns:
-
downloadFileAsDifferentName
public String downloadFileAsDifferentName(String absoluteRemoteFilePath, String absoluteLocalPath, String newFileName)
-
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
public String uploadFileAsDifferentName(String absoluteLocalPath, String localFileName, String absoluteRemotePath, String newRemoteFileName)
-
uploadFile
public String uploadFile(String absoluteLocalFilePath, String absoluteRemotePath)
Upload the local file on remote location. Returns the remote file path where it got uploaded.- Parameters:
absoluteLocalFilePath-absoluteRemotePath-- Returns:
-
uploadFileAsDifferentName
public String uploadFileAsDifferentName(String absoluteLocalFilePath, String absoluteRemotePath, String newRemoteFileName)
-
disconnect
public void disconnect()
- Specified by:
disconnectin interfaceRemoteMachineConnectionProvider
-
clone
public AbstractRemoteMachineActionHandler clone()
-
disconnect
protected abstract void disconnect(RemoteMachineConnection connection)
-
-