You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2014/05/11 00:11:20 UTC

[jira] [Created] (CB-6657) 3 FileTransfer tests have false negatives

Shazron Abdullah created CB-6657:
------------------------------------

             Summary: 3 FileTransfer tests have false negatives
                 Key: CB-6657
                 URL: https://issues.apache.org/jira/browse/CB-6657
             Project: Apache Cordova
          Issue Type: Bug
          Components: mobile-spec
         Environment: iOS
            Reporter: Shazron Abdullah


{code}
FileTransfer upload method filetransfer.spec.18 should be able to upload a file.
Expected 'received upload: { fields: { value2: 'param', value1: 'test' }, files: { file: { domain: null, _events: {}, _maxListeners: 10, size: 24, path: '/opt/run/snapshot/.tmp/063652c9321b9a2cd50672f52d0adc26', name: 'upload.txt', type: 'text/plain', hash: false, lastModifiedDate: Thu May 08 2014 16:21:59 GMT+0000 (UTC), _writeStream: [Object] } } } ' to match /fields:\s*{\s*value1.*/.

FileTransfer upload method filetransfer.spec.19 should be able to upload a file with http basic auth.
Expected 'received upload: { fields: { value2: 'param', value1: 'test' }, files: { file: { domain: null, _events: {}, _maxListeners: 10, size: 24, path: '/opt/run/snapshot/.tmp/4dff830d6b803401635cfcdfc911b739', name: 'upload.txt', type: 'text/plain', hash: false, lastModifiedDate: Thu May 08 2014 16:22:00 GMT+0000 (UTC), _writeStream: [Object] } } } ' to match /fields:\s*{\s*value1.*/.

FileTransfer Backwards compatibility filetransfer.spec.29 should be able to upload a file using local paths.
Expected 'received upload: { fields: { value2: 'param', value1: 'test' }, files: { file: { domain: null, _events: {}, _maxListeners: 10, size: 24, path: '/opt/run/snapshot/.tmp/4d10d1826c6b8307bc382f8217ea6a10', name: 'upload.txt', type: 'text/plain', hash: false, lastModifiedDate: Thu May 08 2014 16:22:01 GMT+0000 (UTC), _writeStream: [Object] } } } ' to match /fields:\s*{\s*value1.*/.
{code}

The false negatives are from a regex assumption that the first item in the fields object is "value1". Since the test server now outputs "value2" as the first item, the regex fails.

The simple fix is to update the regex so that this passes, but that will not hold up to future changes of the output by the server.

The better fix is to actually convert the result back to JSON, and test for the property and/or properties.



--
This message was sent by Atlassian JIRA
(v6.2#6252)