Step 8. Upload File
The eighth test validates the upload of a file from the agent via the eMessage Connector to the ThingWorx Platform.
If this test throws an exception, the smoke test checks the setting of the isFailFast flag. For this test, this flag is set to false. so the next validation test in the chain executes. In addition, the exception is logged (with a stack trace of the exception).
The steps for this test are as follows:
1. Send an eMessage upload request from the agent to the Connector.
2. Validate that the Connector returns a status of success in the eMessage response.
3. Send an eMessage ping request from the agent to the Connector.
4. Validate that the Connector returns a status of success in the eMessage response and that a FileTransfer.Upload SOAP response was included.
5. Validate that the FileTransfer.Upload SOAP response contains the name of the file that was used in the first upload request sent from the agent to the Connector.
6. Send a message from the agent with a PackageStatus of started to the Connector.
7. Validate posting all upload chunks to the Connector, using the field attributes in the FileTransferUpload object (url, chunkSize, and so forth.)
8. Validate that the file was uploaded to the ThingWorx Platform by retrieving the file MD5 checksum from the ThingWorx Platform and then comparing that checksum against the local file checksum.
9. Validate that an active transfer job exists in the File Transfer Subsystem of the ThingWorx Platform.
10. Send a message with a PackageStatus of success from the agent to the Connector to complete the transfer.
11. Validate that the active transfer job was removed from the File Transfer Subsystem of the ThingWorx Platform.
12. Perform cleanup:
a. Remove transfer jobs from both the active and offline queues (in case of failures in the preceding steps).
b. Clear the upload file cache from the Connector by sending a ClearCacheEntryEvent to the Connection Services Hub (cacheName=UploadFileMetadataCache cacheKey=transferJobId)
c. Delete the directory named for the Remote Thing from the System File Repository.
i. The name of the repository is parsed from value of the upload file repository that is specified in the Connector configuration.
Was this helpful?