os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-FindFile-PublicApi-REM.script
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
//
sl@0
     2
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description: 
sl@0
    15
//
sl@0
    16
//! @file
sl@0
    17
//! @SYMTestSuiteName			pbase-f32-sfsrv-publicapi-rem
sl@0
    18
//! @SYMScriptTestEnvironment		This test script requires a basic ROM.
sl@0
    19
//! @SYMScriptAuthor 			Dmitri Trofimov
sl@0
    20
//! @SYMScriptDescription		The test script contains API tests for the following functions of TFindFile class:
sl@0
    21
//! @SYMCreationDate			17/12/2006 
sl@0
    22
//! TFindFile(RFs &aFs);
sl@0
    23
//! TInt FindByDir(const TDesC &aFileName, const TDesC &aDirPath);
sl@0
    24
//! TInt FindWildByDir(const TDesC &aFileName, const TDesC &aDirPath, CDir *&aDir);
sl@0
    25
//! TInt Find();
sl@0
    26
//! TInt FindWild(CDir *&aDirList);
sl@0
    27
//! const TDesC &File() const;
sl@0
    28
//! TInt SetFindMask(TUint aMask);
sl@0
    29
sl@0
    30
LOAD_SUITE				T_SfSrv
sl@0
    31
DELAY					5000
sl@0
    32
sl@0
    33
sl@0
    34
START_TESTCASE				SETUP_FILES
sl@0
    35
	START_TEST_BLOCK	100		T_SfSrv		\base\PBASE-F32-FindFile-PublicApi.ini
sl@0
    36
		CREATE_OBJECT	RFs		RFs1
sl@0
    37
		CREATE_OBJECT	CFileMan	CFileMan1
sl@0
    38
		COMMAND		RFs1		new
sl@0
    39
		COMMAND		RFs1		Connect
sl@0
    40
		COMMAND		RFs1		MkDirAll	test_dir
sl@0
    41
		COMMAND		RFs1		MkDirAll	test_dir1
sl@0
    42
		COMMAND		RFs1		MkDirAll	test_rem_dir
sl@0
    43
		COMMAND		RFs1		MkDirAll	test_rem_dir1
sl@0
    44
		COMMAND		CFileMan1	NewL		fileman_fs
sl@0
    45
		COMMAND		CFileMan1	Copy		test_file1
sl@0
    46
		COMMAND		CFileMan1	Close
sl@0
    47
		COMMAND		CFileMan1	Copy		test_rem_file1
sl@0
    48
		COMMAND		CFileMan1	Close
sl@0
    49
		COMMAND		CFileMan1	~
sl@0
    50
		COMMAND		RFs1	~
sl@0
    51
	END_TEST_BLOCK
sl@0
    52
END_TESTCASE				SETUP_FILES
sl@0
    53
sl@0
    54
sl@0
    55
START_TESTCASE 				PBASE-F32-FindFile-PublicApi-0019
sl@0
    56
//! @SYMTestCaseID			PBASE-F32-FindFile-PublicApi-0019
sl@0
    57
//! @SYMAPI				TFindFile
sl@0
    58
//! @SYMTestCaseDesc			Find() test. This tests for successful finding of file after FindByDir() call.
sl@0
    59
//!					Uses API elements: FindByDir(), Find(), File()
sl@0
    60
//! @SYMTestActions			1. Create RFs object.
sl@0
    61
//!					2. Create RDir object.
sl@0
    62
//!					3. Create TFindFile object passing a reference to the connected file session as a parameter.
sl@0
    63
//!					4. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
sl@0
    64
//!					5. Call File() with checking that value is '\base\t_sfsrv\t_findfile\test1\Test1.txt'
sl@0
    65
//!					60.Call Find().
sl@0
    66
//!					71.Call File() with checking that value is 'x:\base\t_sfsrv\t_findfile\test1\Test1.txt'
sl@0
    67
//!
sl@0
    68
//! @SYMTestStatus			Implemented
sl@0
    69
//! @SYMTestPriority			Critical
sl@0
    70
//! @SYMTestExpectedResults		Find() returns KErrNone.
sl@0
    71
//! @SYMTestType			CIT
sl@0
    72
	START_TEST_BLOCK	100		T_SfSrv		\base\PBASE-F32-FindFile-PublicApi.ini
sl@0
    73
		CREATE_OBJECT	RFs		RFs1
sl@0
    74
		CREATE_OBJECT	RDir		RDir1		
sl@0
    75
		CREATE_OBJECT	TFindFile	TFindFile1	
sl@0
    76
		COMMAND		RFs1		new
sl@0
    77
		COMMAND		RDir1		new
sl@0
    78
		COMMAND		RFs1		Connect
sl@0
    79
		COMMAND		TFindFile1	new		PBASE-F32-FindFile-PublicApi-0019-command4new
sl@0
    80
		COMMAND		TFindFile1	FindByDir	PBASE-F32-FindFile-PublicApi-0019-command5FindByDir
sl@0
    81
		COMMAND		TFindFile1	File		correct_file_path
sl@0
    82
		COMMAND		TFindFile1	Find		
sl@0
    83
		COMMAND		TFindFile1	File		rem_correct_file_path
sl@0
    84
		COMMAND		TFindFile1	~
sl@0
    85
		COMMAND		RDir1		~
sl@0
    86
		COMMAND		RFs1		~
sl@0
    87
	END_TEST_BLOCK
sl@0
    88
END_TESTCASE				PBASE-F32-FindFile-PublicApi-0019
sl@0
    89
sl@0
    90
START_TESTCASE 				PBASE-F32-FindFile-PublicApi-0023
sl@0
    91
//! @SYMTestCaseID			PBASE-F32-FindFile-PublicApi-0023
sl@0
    92
//! @SYMAPI				TFindFile
sl@0
    93
//! @SYMTestCaseDesc			FindWild() test. This test for successful finding of file ather FindWildByDir() call.
sl@0
    94
//!					Uses API elements: FindWildByDir(), FindWild()
sl@0
    95
//! @SYMTestActions			1. Create RFs object.
sl@0
    96
//!					2. Call Connect().
sl@0
    97
//!					3. Create TFindFile object passing a reference to the connected file session as a parameter.
sl@0
    98
//!					4. Call FindWildByDir() passing file name "Test1.*" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
sl@0
    99
//!					5. Call FindWild().
sl@0
   100
//!
sl@0
   101
//! @SYMTestStatus			Implemented
sl@0
   102
//! @SYMTestPriority			Critical
sl@0
   103
//! @SYMTestExpectedResults		FindWild() returns KErrNone. FindWild find file on another RAM drive.
sl@0
   104
//! @SYMTestType			CIT
sl@0
   105
	START_TEST_BLOCK	100		T_SfSrv		\base\PBASE-F32-FindFile-PublicApi.ini
sl@0
   106
		CREATE_OBJECT	RFs		RFs1	
sl@0
   107
		CREATE_OBJECT	TFindFile	TFindFile1
sl@0
   108
		CREATE_OBJECT	TEntry		TEntry1
sl@0
   109
		CREATE_OBJECT	CDir		CDir1
sl@0
   110
		COMMAND		RFs1		new		
sl@0
   111
		COMMAND		RFs1		Connect		
sl@0
   112
		COMMAND		TFindFile1	new		PBASE-F32-FindFile-PublicApi-0023-command4new
sl@0
   113
		COMMAND		TFindFile1	FindWildByDir	PBASE-F32-FindFile-PublicApi-0023-command5FindWildByDir
sl@0
   114
		COMMAND		TFindFile1	FindWild	common_dir_wrapper
sl@0
   115
		COMMAND		TFindFile1	~		
sl@0
   116
		COMMAND		RFs1		~
sl@0
   117
	END_TEST_BLOCK
sl@0
   118
END_TESTCASE				PBASE-F32-FindFile-PublicApi-0023
sl@0
   119
sl@0
   120
START_TESTCASE 				PBASE-F32-FindFile-PublicApi-0026
sl@0
   121
//! @SYMTestCaseID			PBASE-F32-FindFile-PublicApi-0026
sl@0
   122
//! @SYMAPI				TFindFile
sl@0
   123
//! @SYMTestCaseDesc			FindByDir() test. This tests for function to return correct data.
sl@0
   124
//!					Uses API elements: FindByDir(), SetFindMask(), File()
sl@0
   125
//! @SYMTestActions			1. Create RFs object.
sl@0
   126
//!					2. Call Connect().
sl@0
   127
//!					3. Call SetFindMask() with invalid parameter .
sl@0
   128
//!                 4. Call SetFindMask() KDriveAttRemovable as passed parameter.
sl@0
   129
//!					5. Create TFindFile object passing a reference to the connected file session as a parameter.
sl@0
   130
//!					6. Call FindByDir() passing file name "Test1.txt" and path "\base\t_sfsrv\t_findfile\test1\" as arguments.
sl@0
   131
//!					7. Call Find() to switch path to removable drive
sl@0
   132
//!					8. Call File() with checking that value is 'X:\base\t_sfsrv\t_findfile\test1\Test1.txt'
sl@0
   133
//!
sl@0
   134
//! @SYMTestStatus			Implemented
sl@0
   135
//! @SYMTestPriority			Critical
sl@0
   136
//! @SYMTestExpectedResults		SetFindMask() with invalid parameter returns KErrArgument. and File returns a path on removable drive.
sl@0
   137
//! @SYMTestType			CIT
sl@0
   138
	START_TEST_BLOCK	100	T_SfSrv		\base\PBASE-F32-FindFile-PublicApi.ini
sl@0
   139
		CREATE_OBJECT		RFs		RFs1	
sl@0
   140
		CREATE_OBJECT		TFindFile	TFindFile1	
sl@0
   141
		CREATE_OBJECT		TEntry		TEntry1
sl@0
   142
		CREATE_OBJECT		CDir		CDir1
sl@0
   143
		COMMAND			RFs1		new			
sl@0
   144
		COMMAND			RFs1		Connect		
sl@0
   145
		COMMAND			TFindFile1	new		PBASE-F32-FindFile-PublicApi-0026-command4new
sl@0
   146
		COMMAND	!Error=-6	TFindFile1	SetFindMask     PBASE-F32-FindFile-PublicApi-0026__mask_params
sl@0
   147
		COMMAND			TFindFile1	SetFindMask	find_mask_params
sl@0
   148
		COMMAND			TFindFile1	FindByDir	PBASE-F32-FindFile-PublicApi-0026-command5FindByDir
sl@0
   149
		COMMAND			TFindFile1	Find			
sl@0
   150
		COMMAND			TFindFile1	~		
sl@0
   151
		COMMAND			RFs1		~		
sl@0
   152
	END_TEST_BLOCK
sl@0
   153
END_TESTCASE				PBASE-F32-FindFile-PublicApi-0026
sl@0
   154
sl@0
   155
sl@0
   156
START_TESTCASE				REMOVE_FILES
sl@0
   157
	START_TEST_BLOCK	100		T_SfSrv		\base\PBASE-F32-FindFile-PublicApi.ini
sl@0
   158
		CREATE_OBJECT	RFs		RFs1
sl@0
   159
		CREATE_OBJECT	CFileMan	CFileMan1
sl@0
   160
		COMMAND		RFs1		new
sl@0
   161
		COMMAND		RFs1		Connect
sl@0
   162
		COMMAND		CFileMan1	NewL		fileman_fs
sl@0
   163
		COMMAND		CFileMan1	Delete		all_files1
sl@0
   164
		COMMAND		CFileMan1	Delete		all_rem_files1
sl@0
   165
		COMMAND		RFs1		RmDir		test_dir1
sl@0
   166
		COMMAND		RFs1		RmDir		test_dir
sl@0
   167
		COMMAND		RFs1		RmDir		test_rem_dir1
sl@0
   168
		COMMAND		RFs1		RmDir		test_rem_dir
sl@0
   169
		COMMAND		CFileMan1	~
sl@0
   170
		COMMAND		RFs1		~
sl@0
   171
	END_TEST_BLOCK
sl@0
   172
END_TESTCASE				REMOVE_FILES