serviceproviders/sapi_mediamanagement/tsrc/testing/tmediaprovidertesting/conf/tmediamgmttest_image.cfg
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 Aug 2009 07:43:07 +0300
changeset 22 fc9cf246af83
parent 19 989d2f495d90
permissions -rw-r--r--
Revision: 200931 Kit: 200935

 /*  ===========================================================================
 *  Copyright © 2006-2007 Nokia Corporation.
 *  This material, including documentation and any related
 *  computer programs, is protected by copyright controlled by
 *  Nokia Corporation. All rights are reserved. Copying,
 *  including reproducing, storing, adapting or translating, any
 *  or all of this material requires the prior written consent of
 *  Nokia Corporation. This material also contains confidential
 *  information which may not be disclosed to others without the
 *  prior written consent of Nokia Corporation.
 * ============================================================================
 Expected aaaa aaaa aaaa aaaa aaaa aaaa aaaa Next Bbbb bbb bbb bbb bbb bbb bbb End 
 
 */

/*key startRange endRange sortKey sortOrder errorcode 
[Expected type fileName fileExtension drive fileSize fileDate fileNameAndPath mimeType
[Next "next map data" End]].
*/
################################################## Image ###################################################
/*
NOTE:
1. NULL input means not passing any value for the placeholder
2. NULLVALUE means a NULL is passed as value to the placeholder
3. "NULL" as input to a parameter means a Null string or a string of value "NULL" is passed as input
4. All the fields in input is mandatory, if no value is to be passed for any field, a value NULL can be passed. And if NULL is to be passed as value, then 
	value "NULLVALUE" needs to be passed.
5. The key-value pair in Expected output can be in any order and all are optional.


Requirements:
The following image files are expected to be present at the mentioned locations. All the cases below are written based on this assumption. 
The expected output is as per this list.

The Expected output is of the form where all fields of each map is written in between two keys StartMap and EndMap 
All the maps are written between two key words ExpectedStart and ExpectedEnd, as shown below

FileNameAndPath:											Expected o/p for the file in format mentioned below:
c:\data\Images\a.jpg          				StartMap Type Media FileName a FileExtension .jpg Drive c: FileSize 31097 FileDate 20070920:053905 FileNameAndPath c:\data\Images\a.jpg MimeType image/jpeg EndMap
c:\data\Images\ant.jpg								StartMap Type Media FileName ant FileExtension .jpg Drive c: FileSize 8474 FileDate 20060819:102426 FileNameAndPath c:\data\Images\ant.jpg MimeType image/jpeg EndMap
c:\data\Images\blue.png 							StartMap Type Media FileName blue FileExtension .png Drive c: FileSize 4796 FileDate 20070302:120443 FileNameAndPath c:\data\Images\blue.png MimeType image/png EndMap
c:\data\Images\pictures\dreams.bmp 		StartMap Type Media FileName dreams FileExtension .bmp Drive c: FileSize 73105 FileDate 20070108:015537 FileNameAndPath c:\data\Images\pictures\dreams.bmp MimeType image/bmp EndMap
e:\data\Images\stars.jpg 							StartMap Type Media FIleName stars FileExtension .jpg Drive e: FileSize 24790 FileDate 20081019:033638 FileNameAndPath e:\data\Images\stars.jpg MimeType image/jpeg EndMap



//Testcase format:
//Description of the testcase
//Input: Input values
//Expected:(+ve/-ve case) Expected output or behaviour 
[Test]
title Sample
create tmediaprovidertesting foobar
//foobar GetFilesListL <Type> <FileType> <Key> <StartRange> <EndRange> <SortKey> <SortOrder> <expected error code> ExpectedStart StartMap Type <Type value> FileName <filename value FileExtension <FileExtension value> Drive <Drive value> FileSize <FileSize value> FileDate <FileDate value> FileNameAndPath <FileNameAndPath value> MimeType <MimeType value> EndMap ExpectedEnd
foobar GetFilesListL FileInfo Image FileName a NULL NULL NULL 0 ExpectedStart StartMap Type Media FileName a FileExtension .jpg Drive c: FileSize 31097 FileDate 20070920:053905 FileNameAndPath c:\data\Images\a.jpg MimeType image/jpeg EndMap ExpectedEnd 
delete foobar
[Endtest]

*/
############################################### Test cases starts ###############################################

//GetList with value "FileInfo" for Type input and no other input parameters
//Input: FileInfo as Type, other inputs are NULL
//Expected: errorcode 1003- MissingArgumentType error as the mandatory FileType input is missing
[Test]
title ImgNeg_FileInfoType_NoFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo NULL NULL NULL NULL NULL NULL 1003
delete foobar
[Endtest]


//GetList with value other than "FileInfo" for Type input
//Input: FolderInfo inplace of Type input where valid value to be passed is FileInfo
//Expected: errorcode 1004- ServiceNotSupported
[Test]
title ImgNeg_FolderInfoType
create tmediaprovidertesting foobar
foobar GetFilesListL FolderInfo Image FileName a NULL NULL NULL 1004 
delete foobar
[Endtest]


//GetList with "FileInfo" as value for Type with a FileType input
//Input: "FileInfo" as value for Type and Image as value for FileType, FileName as Key, "a" as startrange
//Expected: list of details of all image files named 'a' are returned
[Test]
title Img_NoOptionalInputs
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image NULL NULL NULL NULL NULL 0 ExpectedStart StartMap FileName a EndMap StartMap FileName ant EndMap StartMap FileName blue EndMap StartMap FileName dreams EndMap StartMap FileName stars EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with lower case "fileinfo" as value for Type input
//Input: lowercase "fileinfo" as value for Type
//Expected: image list based on the filter key and value
[Test]
title Img_fileinfoType
create tmediaprovidertesting foobar
foobar GetFilesListL fileinfo Image FileName a NULL NULL NULL 0 ExpectedStart StartMap Type Media FileName a FileExtension .jpg Drive c: FileSize 31097 FileDate 20070920:053905 FileNameAndPath c:\data\Images\a.jpg MimeType image/jpeg EndMap ExpectedEnd 
delete foobar
[Endtest]

//GetList with NULL as Type input
//Input: NULLVALUE as value for Type(Note: Passing NULLVALUE means that a value null is passed as input to Type), Image as FileType
//Expected: errorcode 1004- ServiceNotSupported error is expected as the value FileInfo is expected as input for Type and not NULLVALUE
[Test]
title ImgNeg_NullType
create tmediaprovidertesting foobar
foobar GetFilesListL NULLVALUE Image NULL NULL NULL NULL NULL 1004
delete foobar
[Endtest]


//GetList with no input for Type 
//Input: NULL as value for Type(Note: Passing NULL means that no input is passed), Image as FileType 
//Expected: errorcode 1003- MissingArgument error is expected as the Type is mandatory input
[Test]
title ImgNeg_NoType
create tmediaprovidertesting foobar
foobar GetFilesListL NULL Image NULL NULL NULL NULL NULL 1003
delete foobar
[Endtest]


//GetList with integer value for Type input
//Input: integer value 12 for Type, Image as FileType
//Expected: errorcode 1004- ServiceNotSupported
[Test]
title ImgNeg_IntegerType
create tmediaprovidertesting foobar
foobar GetFilesListL 12 Image NULL NULL NULL NULL NULL 1004
delete foobar
[Endtest]

#############################################################################################################################################################

################################################################### Testcases relating the FileType input ##########################################################################################


//GetList with lowercase value "image" for FileType input
//Input: "image"(1st letter lowercase) as value for FileType, FileName as Key and a as value for startrange
//Expected: list of image files filtered based on Filter Key and Value. The list of all files with name a is returned. The expected result has all the details of the expected file named a
//The output is in terms of a map starting and ending with keywords StartMap and EndMap respectively
[Test]
title Img_imageFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo image FileName a NULL NULL NULL 0 ExpectedStart StartMap Type Media FileName a FileExtension .jpg Drive c: FileSize 31097 FileDate 20070920:053905 FileNameAndPath c:\data\Images\a.jpg MimeType image/jpeg EndMap ExpectedEnd 
delete foobar
[Endtest]

//GetList with img as value to FileType input
//Input: img as value for FileType and no values(NULL) for all other inputs
//Expected errorcode 1002- BadArgumentType error
[Test]
title ImgNeg_imgFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo img NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with Nokia as input to FileType input
//Input: Nokia as value for FileType and no values(NULL) for all other inputs
//Expected: errorcode 1002- BadArgumentType error
[Test]
title ImgNeg_NokiaFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Nokia NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with E:\Image as value to FileType input
//Input: E:\Image as FIleType and no value (NULL) for all other values
/Expected: errorcode 1002- BadArgumentType error
[Test]
title ImgNeg_E:\ImageFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo E:\Image NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]



//GetList with empty string as FileType
//Input: empty string as FileType and no values(NULL) for all other inputs
/Expected: errorcode 1002- BadArgumentType error
[Test]
title ImgNeg_EmptyStringFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo "" NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with NULL as FileType
//Input: NULLVALUE as FileType(Note this means that we are passing NULL as input to FileType),all other inputs are not passed
/Expected: errorcode 1002- BadArgumentType error
[Test]
title ImgNeg_NullFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo NULLVALUE NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with integer value input to FileType
//Input: 12 as value for FileType and no values for all other inputs
/Expected: errorcode 1002- BadArgumentType error as invalid value is passed for FileType
[Test]
title ImgNeg_IntegerFileType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo 12 NULL NULL NULL NULL NULL 1002
delete foobar
[Endtest]

###############################################################################################################################################

###################################################################Type==“FileInfo” + Passing Filter Map with FileType==Image + [Key]############################################################################

//GetList with FileName as key, no StartRange
//Input: FileName as key, all other values are not passed
/Expected: errorcode 1003- MissingArgumentType
[Test]
title ImgNeg_FileNameKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName NULL NULL NULL NULL 1003 
delete foobar
[Endtest]

//GetList with no FilterKey
//Input:  NULL(means no value being passed) as Key ,all other inputs are not passed
//Expected: list of all images present in the device, The expected output has the FileName of all files expected to be retrieved.
[Test]
title Img_NoOptionalFields
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image NULL NULL NULL NULL NULL 0 ExpectedStart StartMap FileName a EndMap StartMap FileName ant EndMap StartMap FileName blue EndMap StartMap FileName dreams EndMap StartMap FileName stars EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with FileExtension as key, but no StartRange
//Input: FileExtension as Key and no value for all other keys
//Expected: errorcode 1003- MissingArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_FileExtensionKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileExtension NULL NULL NULL NULL 1003 
delete foobar
[Endtest]

//GetList with Drive as key and no startrange
//Input: Drive as Key and no input for all other input parameters
//Expected: errorcode 1003- MissingArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_DriveKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive NULL NULL NULL NULL 1003 
delete foobar
[Endtest]


//GetList with FileSize as key and no startrange
//Input: FileSize as Key and no input for all other input parameters
//Expected: errorcode 1002- BadArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_FileSizeKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize NULL NULL NULL NULL 1002 
delete foobar
[Endtest]


//GetList with FileDate as key and no startrange
//Input: FileDate as Key and no input for all other input parameters
//Expected: errorcode 1002- BadArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_FileDateKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate NULL NULL NULL NULL 1002 
delete foobar
[Endtest]


//GetList with MimeType as key and no startrange
//Input: MimeType as Key and no input for all other input parameters
//Expected: errorcode 1003- MissingArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_MimeTypeKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image MimeType NULL NULL NULL NULL 1003 
delete foobar
[Endtest]


//GetList with FileNameAndPath as key and no startrange
//Input: FileNameAndPath as Key and no input for all other input parameters
//Expected: errorcode 1003- MissingArgumentType as the StartRange is mandatory when Key is mentioned
[Test]
title ImgNeg_FileNameAndPathKey_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileNameAndPath NULL NULL NULL NULL 1003
delete foobar
[Endtest]


//GetList with Nokia as key
//Input: Nokia as key and a valid value c:\data\Images\a.jpg as value for startrange, and no input for all other parameters
//Expected: errorcode 1002- BadArgumentType is expected as the value for key is invalid
[Test]
title ImgNeg_NokiaKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Nokia c:\data\Images\a.jpg NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with NULL value as key
//Input: NULLVALUE as input for Key(means a value NULL is input to Key),and a valid c:\data\Images\a.jpg as value for startrange and no value for other inputs
//Expected: 1002-BadArgumentType errorcode is returned as NULL is invalid value for Key
[Test]
title Img_NullKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image NULLVALUE c:\data\Images\a.jpg NULL NULL NULL 0 ExpectedStart StartMap FileName a EndMap StartMap FileName ant EndMap StartMap FileName blue EndMap StartMap FileName dreams EndMap StartMap FileName stars EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with Empty string as key
//Input: empty string "" as value for Key and a valid value "c:\data\Images\a.jpg" as value for startrange and other inputs are not passed
//Expected: errorcode 1002- BadArgumentType 
[Test]
title ImgNeg_EmptyStringKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image "" c:\data\Images\a.jpg NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with invalid case as key
//Input: filename(1st letter lowercase) as Key and a as value for startrange
//returns list of images based on the filter key and value. details of files named a is expected as output
[Test]
title Img_filenameKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image filename a NULL NULL NULL 0 ExpectedStart StartMap FileName a EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with Sapi as value for filter key
//Input: Sapi as Key and a valid c:\data\Images\a.jpg as value for startrange
//Expected: errorcode 1002- BadArgumentType as Sapi is invalid key
[Test]
title ImgNeg_SapiKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Sapi c:\data\Images\a.jpg NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with integer value for Filter key
//Input: 12 as Key, and a valid value "c:\data\Images\a.jpg" as value for startrange
//Expected: errorcode 1002- BadArgumentType as the value expected is out of type string and integer is input
[Test]
title ImgNeg_IntegerKey
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image 12 c:\data\Images\a.jpg NULL NULL NULL 1002
delete foobar
[Endtest]

##########################Type==“FileInfo” + Passing Filter Map with FileType==Image + Key+Start Range###############################
//GetList with NULL StartRange
//Input: FileName as Key and NULLVALUE as startrange(means we are passing NULL as value for startrange)
//Expected: errorcode- 1003 MissingArgumenterror, as the startrange is mandatory when key is input
[Test]
title ImgNeg_NoStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName NULLVALUE NULL NULL NULL 1003
delete foobar
[Endtest]

//GetList with FileName StartRange
//Input: FileName as Key and value a as startrange
//Expected list of images filtered based on FileName. Details of all files named a is expected output
[Test]
title Img_FileNameKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName a NULL NULL NULL 0 ExpectedStart StartMap FileName a EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with FileExtension StartRange
//Input: FileExtension as Key and .jpg as value for startrange
//Expected  list of images filtered based on FileExtension. details of all files with extension .jpg is the expected output
[Test]
title Img_FileExtensionKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileExtension .jpg NULL NULL NULL 0 ExpectedStart StartMap FileName a FileExtension .jpg EndMap StartMap FileName ant FileExtension .jpg EndMap StartMap FileName stars FileExtension .jpg EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with Drive StartRange
//Input: Drive as Key and c: as value for startrange
//Expected list of images filtered based on Drive. details of all files with drive value c: is expected
[Test]
title Img_DriveKey_c:StartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL NULL NULL 0 ExpectedStart StartMap FileName a Drive c: EndMap StartMap FileName ant Drive c: EndMap StartMap FileName blue Drive c: EndMap StartMap FileName dreams Drive c: EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with FileSize StartRange
//Input: FileSize as Key and 70000 as value for startrange
//Expected: list of images filtered based on FileSize. details of all files with size 70000 is expected
[Test]
title Img_FileSizeKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 70000 NULL NULL NULL 0 ExpectedStart StartMap FileSize dreams FileSize 73105 EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with FileDate StartRange
//Input: FileDate as Key and 20081019:033638 as value for startrange
//Expected: list of images filtered based on FileDate 20081019:033638. The details of all files with date 20081019:033638 is the output
[Test]
title Img_FileDateKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate 20081019:033638 NULL NULL NULL 0 ExpectedStart StartMap FileName stars FileDate 20081019:033638 EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with MimeType StartRange
//Input: MimeType as Key and image/jpeg as value for startrange
//Expected: list of images filtered based on MimeType image/jpeg. 
[Test]
title Img_MimeTypeKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image MimeType image/jpeg NULL NULL NULL 0 ExpectedStart StartMap FileName a MimeType image/jpeg EndMap StartMap FileName ant MimeType image/jpeg EndMap StartMap FileName stars MimeType image/jpeg EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList with FileNameAndPath StartRange
//Input: FileNameAndPath as StartRange and c:\data\Images\a.jpg as value for startrange
//Expected: list of images filtered based on FileNameAndPath, i.e., returns the details about file a.jpg at c:\data\Images\a.jpg
[Test]
title Img_FileNameAndPathKeyWithStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileNameAndPath c:\data\Images\a.jpg NULL NULL NULL 0 ExpectedStart StartMap FileNameAndPath c:\data\Images\a.jpg EndMap ExpectedEnd
delete foobar
[Endtest]

//FIleSize startrange with value greater than the values of a file
//Input: FileSize as Key and 95000 as startrange
//Expected: should return errocode as 0 and empty list
[Test]
title Img_FileSizeKeyWithStartRange_NoExpectedo/p
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 95000 NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with FileDate StartRange
//Input: FileDate as Key and 20091019:033638 as value for startrange
//Expected: should return errocode as 0 and empty list
[Test]
title Img_FileDateWithStartRange_NoExpectedo/p
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate 20091019:033638 NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with negative FileSize StartRange
//Input: FileSize as Key and -12 as value for StartRange
//Expected: errorcode 1002- BadArgumentType as the value is out of range
[Test]
title ImgNeg_NegativeFileSize
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize -12 NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with negative FileDate StartRange
//Input: FileDate as Key and -12 as value for StartRange
//Expected: errorcode 1002- BadArgumentType as the value is out of range
[Test]
title Img_NegativeFileDate
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate -12 NULL NULL NULL 1002
delete foobar
[Endtest]


//GetList with FileDate StartRange
//Input: FileDate as Key and an invalid value 20093045:450990 as startrange
//Expected: errorcode 1002- BadArgumentType as the value is invalid
[Test]
title Img_InvalidFileDate
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate 20093045:450990 NULL NULL NULL 1002
delete foobar
[Endtest]

//GetList with no Key input, but with values for start and endrange
//Input: NULL as Key(no input for Key) and 70000 as StartRange and 80000 as endrange
//Expected: list of all image files
[Test]
title Img_NoFilterKeyWithStartRangeValues
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image NULL 70000 80000 NULL NULL 0
delete foobar
[Endtest]

//GetList with empty string StartRange for FileName
//Input: FileName as Key and empty string as value for StartRange
//Expected: 0 as errorcode and empty list
[Test]
title Img_EmptyStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName "" NULL NULL NULL 0 
delete foobar
[Endtest]


//GetList with integer StartRange for FileName
//Input: FileName as Key and integer value 23 as value for StartRange
//Expected: 0 errocode and empty list is returned
[Test]
title Img_IntegerStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName 23 NULL NULL NULL 0
delete foobar
[Endtest]


//GetList with Null string as value for FileName
//Input: FileName as Key and null string "NULL" as value for startrange
//Expected: 0 errorcode and empty list
[Test]
title Img_FileNameKey_NullStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName "NULL" NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with Null string as value for FileExtension
//Input: FileExtension as Key and null string "NULL" as value for startrange
//Expected: 0 errorcode and empty list
[Test]
title Img_FileExtensionKey_NullStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileExtension "NULL" NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with Null string as value for Drive
//Input: Drive as Key and null string "NULL" as value for startrange
//Expected: 0 errorcode and empty list
[Test]
title Img_DriveKey_NullStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive "NULL" NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with Null string as value for MimeType
//Input: MimeType as Key and null string "NULL" as value for startrange
//Expected: 0 errorcode and empty list
[Test]
title Img_MimeTypeKey_NullStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image MimeType "NULL" NULL NULL NULL 0 
delete foobar
[Endtest]

//GetList with Null string for FileNameAndPath
//Input: FileNameAndPath as Key and "Null" as value for StartRange
//Expected: 0 errorcode and empty list
[Test]
title Img_FileNameAndPathKey_NullStringStartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileNameAndPath "NULL" NULL NULL NULL 0 
delete foobar
[Endtest]

#########################Type==“FileInfo” + Passing Filter Map with FileType==Image + Key+Start Range + End Range#############################

//GetList with FileSize end range less than start range
//Input: FileSize as key, 40000 as StartRange and 20000 as EndRange 
//Expected: 1002-BadArgumentType 
[Test]
title ImgNeg_StartRangeGTEndRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 40000 20000 NULL NULL 1002
delete foobar
[Endtest]

//GetList with Negative end range for FileSize 
//Input: FileSize as key, valid value of 200 for StartRange and a value -400 as value for EndRange
//Expected: 1002-BadArgumentType as the value of endrange is invalid and not within the range
[Test]
title ImgNeg_NegativeFileSizeEndRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 20000 -40000 NULL NULL 1002
delete foobar
[Endtest]

//GetList with Negative end range for FileDate 
//Input: FileDate as key, valid startrange and a value -400 as value for EndRange
//Expected: 1002-BadArgumentType as the value of endrange is invalid and not within the range
[Test]
title ImgNeg_NegativeFileDateEndRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate 20070920:053905 -400 NULL NULL 1002
delete foobar
[Endtest]

//GetList of images filtered by FileName with EndRange being mentioned
//Input: FileName as Key, value a as StartRange and value z as EndRange
//Expected: returns list based on StartRange alone and ignores the EndRange
[Test]
title Img_FileNameKeyWithStartAndEndRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileName a z NULL NULL 0 ExpectedStart StartMap FileName a EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with valid start and end range for FileSize 
//Input: FileSize as key, valid value of 30000 for StartRange and a value 40000 as value for EndRange
//Expected: file with size in the range 30000 to 40000 is expected. FileName and FileSize is verified in the result
[Test]
title Img_FileSizeKeyWithValidRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 30000 40000 NULL NULL 0 ExpectedStart StartMap FileName a FileSize 31097 EndMap ExpectedEnd 
delete foobar
[Endtest]

//GetList with Negative end range for FileDate 
//Input: FileDate as key, valid startrange and a value -400 as value for EndRange
//Expected: 1002-BadArgumentType as the value of endrange is invalid and not within the range
[Test]
title Img_FileDateKeyWithValidRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileDate 20070920:053905 20071020:060000 NULL NULL 0 ExpectedStart StartMap FileName a FileDate 20070920:053905 EndMap ExpectedEnd 
delete foobar
[Endtest]

//GetList with valid start and end range for FileSize, but no such file is present in the expected list
//Input: FileSize as key, valid value of 95000 for StartRange and a value 98000 as value for EndRange
//Expected: file with size in the range 30000 to 40000 is expected.But no such file exists in the expected list
[Test]
title Img_FileSizeWithValidRange_WithNoExpectedOutput
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 95000 98000 NULL NULL 0 
delete foobar
[Endtest]

######################### Type==“FileInfo” + Passing Filter Map with FileType==Image + Sort Map#########################

//GetList of image file sorted in Ascending order of Drive
//Input: Drive as SortKey and Ascending as SortOrder, FileSize as Key with startrange of 20000 and 40000 as end range 
//Expected: list of images in ascending order of drive
[Test]
title Img_SortAscendingOnDrive
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 20000 40000 Drive Ascending 0 ExpectedStart StartMap FileName a Drive c: EndMap StartMap FileName stars Drive e: EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image file sorted in Descending order of Drive
//Input: Drive as SortKey and Descending as SortOrder, FileSize as Key with startrange of 20000 and 40000 as end range 
//Expected: list of images in descending order of drive
[Test]
title Img_SortDescendingOnDrive
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 20000 40000 Drive Descending 0 ExpectedStart StartMap FileName stars Drive e: EndMap StartMap FileName a Drive c: EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image file sorted in Ascending order of FileExtension
//Input: FileExtension as SortKey and Ascending as SortOrder, FileSize as Key with 4000 and 9000 start and end range values respectively
//Expected: list of images in ascending order of FileExtension
[Test]
title Img_SortAscendingOnFileExtension
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 4000 9000 FileExtension Ascending 0 ExpectedStart StartMap FileName ant FileExtension .jpg EndMap StartMap FileName blue FileExtension .png EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image file sorted in Descending order of FileExtension
//Input: FileExtension as SortKey and Descending as SortOrder, FileSize as Key with 4000 and 9000 start and end range values respectively
//Expected: list of images in descending order of FileExtension
[Test]
title Img_DescendingOnFileExtension
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 4000 9000 FileExtension Descending 0 ExpectedStart StartMap FileName blue FileExtension .png EndMap StartMap FileName ant FileExtension .jpg EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image files in Ascending order of MimeType
//Input: MimeType as SortKey and Ascending as SortOrder, FileSize as Key with 4000 and 9000 start and end range values respectively
//Expected: list of images in ascending order of MimeType
[Test]
title Img_SortAscendingOnMimeType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 4000 9000 MimeType Ascending 0  ExpectedStart StartMap FileName ant MimeType image/jpeg EndMap StartMap FileName blue MimeType image/png EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image files in Descending order of MimeType
//Input: MimeType as SortKey and Descending as SortOrder, FileSize as Key with 4000 and 9000 start and end range values respectively
//Expected: list of images in descending order of MimeType
[Test]
title Img_SortDescendingOnMimeType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image FileSize 4000 9000 MimeType Descending 0 ExpectedStart StartMap FileName blue MimeType image/png EndMap StartMap FileName ant MimeType image/jpeg EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image files in Ascending order of FileSize 
//Input: FileSize as SortKey and Ascending as SortOrder
//Expected: list of images in ascending order of FileSize
[Test]
title Img_SortAscendingOnFileSize
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileSize Ascending 0 ExpectedStart StartMap FileName blue FileSize 4796 EndMap StartMap FileName ant FileSize 8474 EndMap StartMap FileName a FileSize 31097 EndMap StartMap FileName dreams FileSize 73105 EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image files in Descending order of FileSize 
//Input: FileSize as SortKey and Descending as SortOrder
//Expected: list of images in descending order of FileSize
[Test]
title Img_SortDescendingOnFileSize
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileSize Descending 0 ExpectedStart StartMap FileName dreams FileSize 73105 EndMap StartMap FileName a FileSize 31097 EndMap StartMap FileName ant FileSize 8474 EndMap StartMap FileName blue FileSize 4796 EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of image files sorted in Ascending order of FileDate
//Input: FileDate as SortKey and Ascending as SortOrder,MimeType as FilterKey and image/jpeg as startvalue
//Expected: list of images in ascending order of FileDate
[Test]
title Img_SortAscendingOnMimeType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image MimeType image/jpeg NULL FileDate Ascending 0 ExpectedStart StartMap FileName ant FileDate 20060819:102426 EndMap StartMap FileName a FileDate 20070920:053905 EndMap StartMap FileName stars FileDate 20081019:033638 EndMap ExpectedEnd
delete foobar
[Endtest]

//GetList of images sorted in Descending order based on FileDate
//Input: FileDate as SortKey and Descending as SortOrder
//Expected: list of images in descending order of FileDate,MimeType as FilterKey and image/jpeg as startvalue
[Test]
title Img_SortDescendingOnMimeType
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image MimeType image/jpeg NULL FileDate Descending 0 ExpectedStart StartMap FileName stars FileDate 20081019:033638 EndMap StartMap FileName a FileDate 20070920:053905 EndMap StartMap FileName ant FileDate 20060819:102426 EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with no SortOrder
//Input: Pass NULL as SortOrder and any valid SortKey like FileName
//Expected list of images in ascending order(default) based on SortKey(FileName) mentioned. The list is sorted in ascending order as Ascending is the default order
[Test]
title Img_NoSortOrder
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileName NULL 0 ExpectedStart StartMap FileName a EndMap StartMap FileName ant EndMap StartMap FileName blue EndMap StartMap FileName dreams EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with Nokia as SortOrder
//Input: Nokia as value for SortOrder and any valid value eg.FileDate as value for SortKey
//Expected: 1002-BadArgumentType as Nokia is not a valid SortOrder
[Test]
title Img_NokiaSortOrder
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image NULL NULL NULL FileDate Nokia 1002
delete foobar
[Endtest]


//GetList ascending(case sensitive) as sort order
//Input: lowercase "ascending" as value for SortOrder and FIleSize as value for SortKey
//Expected: list of images in ascending order, sorted based on Filesize
[Test]
title Img_ascendingSortOrder
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileSize ascending 0 ExpectedStart StartMap FileName blue FileSize 4796 EndMap StartMap FileName ant FileSize 8474 EndMap StartMap FileName a FileSize 31097 EndMap StartMap FileName dreams FileSize 73105 EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with Ascending sort order for FileNameAndPath
//Input: FileNameAndPath as SortKey and Ascending as SortOrder
//Expected: list of image files in ascending order sorted based on FileNameAndPath
[Test]
title Img_SortAscendingOnFileNameAndPath
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileNameAndPath Ascending 0 ExpectedStart StartMap FileNameAndPath c:\data\Images\a.jpg EndMap StartMap FileNameAndPath c:\data\Images\ant.jpg EndMap StartMap FileNameAndPath c:\data\Images\blue.png EndMap StartMap FileNameAndPath c:\data\Images\pictures\dreams.bmp EndMap ExpectedEnd
delete foobar
[Endtest]


//GetList with Descending order of files sorted based on FileName
//Input: FileName as SortKey and Descending as SortOrder
//Expected: list of images sorted in descending order based on FileName
[Test]
title Img_SortDescendingOnFileName
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL FileName Descending 0 ExpectedStart StartMap FileName dreams XPixels 800 YPixels 600 EndMap StartMap FileName blue XPixels 318 YPixels 301 EndMap StartMap FileName ant XPixels 329 YPixels 220 EndMap StartMap FileName a XPixels 1152 YPixels 864 EndMap ExpectedEnd
delete foobar
[Endtest]


//Case to check for all fields in output
//Input: Drive as FilterKey, e: as startrange
//Expected: list of all images files in e: drive
[Test]
title Img_DriveKey_e:StartRange
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive e: NULL NULL NULL 0 ExpectedStart StartMap Type Media FileName stars FileExtension .jpg Drive e: FileSize 24790 FileDate 20081019:033638 FileNameAndPath e:\data\Images\stars.jpg MimeType image/jpeg EndMap ExpectedEnd
delete foobar
[Endtest]


//Case to check for the new output field resolution for Images only added for CJSE 2.0
//Input: Image as FileType
//Expected: list of all images files with Resolution map as output
[Test]
title Img_Resolution
create tmediaprovidertesting foobar
foobar GetFilesListL FileInfo Image Drive c: NULL NULL NULL 0 ExpectedStart StartMap Type Media FileName a FileExtension .jpg Drive c: FileSize 31097 FileDate 20070920:053905 FileNameAndPath c:\data\Images\a.jpg MimeType image/jpeg XPixels 1152 YPixels 864 EndMap StartMap Type Media FileName ant FileExtension .jpg Drive c: FileSize 8474 FileDate 20060819:102426 FileNameAndPath c:\data\Images\ant.jpg MimeType image/jpeg XPixels 329 YPixels 220 EndMap StartMap Type Media FileName blue FileExtension .png Drive c: FileSize 4796 FileDate 20070302:120443 FileNameAndPath c:\data\Images\blue.png MimeType image/png XPixels 318 YPixels 301 EndMap StartMap Type Media FileName dreams FileExtension .bmp Drive c: FileSize 73105 FileDate 20070108:015537 FileNameAndPath c:\data\Images\pictures\dreams.bmp MimeType image/bmp XPixels 800 YPixels 600 EndMap ExpectedEnd
delete foobar
[Endtest]

################################################################    Image Ends     ####################################################