1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/referencedrmagent/tcaf/source/ManagerStep.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,586 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +#if (!defined __MANAGER_STEP_H__)
1.25 +#define __MANAGER_STEP_H__
1.26 +#include <test/testexecutestepbase.h>
1.27 +
1.28 +#include "cafstep.h"
1.29 +#include <caf/dirstreamable.h>
1.30 +#include "contentIterator.h"
1.31 +
1.32 +// Constants used to name test cases
1.33 +_LIT(KCAFDeleteStep,"CAFDeleteStep");
1.34 +_LIT(KCAFCopyFileStep,"CAFCopyFileStep");
1.35 +_LIT(KCAFRenameFileStep,"CAFRenameFileStep");
1.36 +_LIT(KCAFMkDirStep,"CAFMkDirStep");
1.37 +_LIT(KCAFMkDirAllStep,"CAFMkDirAllStep");
1.38 +_LIT(KCAFRmDirStep,"CAFRmDirStep");
1.39 +_LIT(KCAFGetDirStep,"CAFGetDirStep");
1.40 +_LIT(KCAFManagerNotifyStep,"CAFManagerNotifyStep");
1.41 +_LIT(KCAFManagerSetPropertyStep,"CAFManagerSetPropertyStep");
1.42 +_LIT(KCAFManagerDisplayInfoStep,"CAFManagerDisplayInfoStep");
1.43 +_LIT(KCAFManagerListAgentsStep,"CAFManagerListAgentsStep");
1.44 +_LIT(KCAFManagerAgentSpecificStep,"CAFManagerAgentSpecificStep");
1.45 +_LIT(KCAFManagerDisplayConfigStep,"CAFManagerDisplayConfigStep");
1.46 +_LIT(KCAFManagerAttributeStep,"CAFManagerAttributeStep");
1.47 +_LIT(KCAFManagerAttributeSetStep,"CAFManagerAttributeSetStep");
1.48 +_LIT(KCAFManagerStringAttributeStep,"CAFManagerStringAttributeStep");
1.49 +_LIT(KCAFManagerStringAttributeSetStep,"CAFManagerStringAttributeSetStep");
1.50 +_LIT(KCAFManagerDisplayInfoByFileHandleStep,"CAFManagerDisplayInfoByFileHandleStep");
1.51 +_LIT(KCAFManagerAttributeByFileHandleStep,"CAFManagerAttributeByFileHandleStep");
1.52 +_LIT(KCAFManagerAttributeSetByFileHandleStep,"CAFManagerAttributeSetByFileHandleStep");
1.53 +_LIT(KCAFManagerStringAttributeByFileHandleStep,"CAFManagerStringAttributeByFileHandleStep");
1.54 +_LIT(KCAFManagerStringAttributeSetByFileHandleStep,"CAFManagerStringAttributeSetByFileHandleStep");
1.55 +
1.56 +
1.57 +class CCAFServer;
1.58 +
1.59 +
1.60 +/*
1.61 +* Used to test CManager::DeleteFile()
1.62 +* The INI file specifies the file to delete and the expected return code.
1.63 +* For instance this can be used to try and delete a file that does not exist or a file
1.64 +* that is read-only or has rights that don't allow it to be deleted
1.65 +* INI file paramerters
1.66 +*
1.67 +* filename - the file to delete
1.68 +*
1.69 +* result - the expected return code
1.70 +*
1.71 +* @internalComponent Exposure internally
1.72 +*/
1.73 +class CCAFDeleteStep : public CCAFStep
1.74 + {
1.75 +public:
1.76 + CCAFDeleteStep(CCAFServer& aParent);
1.77 + ~CCAFDeleteStep();
1.78 + virtual TVerdict doTestStepL();
1.79 +private:
1.80 + CCAFServer& iParent;
1.81 + };
1.82 +
1.83 +/*
1.84 +* Used to test CManager::CopyFile()
1.85 +* The INI file specifies the file to delete and the expected return code.
1.86 +* For instance this can be used to try and delete a file that does not exist or a file
1.87 +* that is read-only or has rights that don't allow it to be deleted
1.88 +* INI file paramerters
1.89 +*
1.90 + source - the source file
1.91 + destination - the destination file
1.92 + result - the expected return code
1.93 +*
1.94 +* @internalComponent Exposure internally
1.95 +*/
1.96 +class CCAFCopyFileStep : public CCAFStep
1.97 + {
1.98 +public:
1.99 + CCAFCopyFileStep(CCAFServer& aParent);
1.100 + ~CCAFCopyFileStep();
1.101 + virtual TVerdict doTestStepL();
1.102 +private:
1.103 + CCAFServer& iParent;
1.104 + };
1.105 +
1.106 +/*
1.107 +* Used to test CManager::RenameFile()
1.108 +* The INI file specifies the file to delete and the expected return code.
1.109 +* For instance this can be used to try and delete a file that does not exist or a file
1.110 +* that is read-only or has rights that don't allow it to be deleted
1.111 +* INI file paramerters
1.112 +*
1.113 + source - the source file
1.114 + destination - the destination file
1.115 + result - the expected return code
1.116 +*
1.117 +* @internalComponent Exposure internally
1.118 +*/
1.119 +class CCAFRenameFileStep : public CCAFStep
1.120 + {
1.121 +public:
1.122 + CCAFRenameFileStep(CCAFServer& aParent);
1.123 + ~CCAFRenameFileStep();
1.124 + virtual TVerdict doTestStepL();
1.125 +private:
1.126 + CCAFServer& iParent;
1.127 + };
1.128 +
1.129 +/*
1.130 +* Used to test CManager::MkDir()
1.131 +* The INI file specifies the file to delete and the expected return code.
1.132 +* For instance this can be used to try and delete a file that does not exist or a file
1.133 +* that is read-only or has rights that don't allow it to be deleted
1.134 +* INI file paramerters
1.135 +*
1.136 + path - the directory to create
1.137 + result - the expected return code
1.138 +*
1.139 +* @internalComponent Exposure internally
1.140 +*/
1.141 +class CCAFMkDirStep : public CCAFStep
1.142 + {
1.143 +public:
1.144 + CCAFMkDirStep(CCAFServer& aParent);
1.145 + ~CCAFMkDirStep();
1.146 + virtual TVerdict doTestStepL();
1.147 +private:
1.148 + CCAFServer& iParent;
1.149 + };
1.150 +
1.151 +/*
1.152 +* Used to test CManager::MkDirAll()
1.153 +* The INI file specifies the file to delete and the expected return code.
1.154 +* For instance this can be used to try and delete a file that does not exist or a file
1.155 +* that is read-only or has rights that don't allow it to be deleted
1.156 +* INI file paramerters
1.157 +*
1.158 + path - the directory to create
1.159 + result - the expected return code
1.160 +*
1.161 +* @internalComponent Exposure internally
1.162 +*/
1.163 +class CCAFMkDirAllStep : public CCAFStep
1.164 + {
1.165 +public:
1.166 + CCAFMkDirAllStep(CCAFServer& aParent);
1.167 + ~CCAFMkDirAllStep();
1.168 + virtual TVerdict doTestStepL();
1.169 +private:
1.170 + CCAFServer& iParent;
1.171 + };
1.172 +
1.173 +/*
1.174 +* Used to test CManager::RmDir()
1.175 +* The INI file specifies the file to delete and the expected return code.
1.176 +* For instance this can be used to try and delete a file that does not exist or a file
1.177 +* that is read-only or has rights that don't allow it to be deleted
1.178 +* INI file paramerters
1.179 +*
1.180 + path - the directory to create
1.181 + result - the expected return code
1.182 +*
1.183 +* @internalComponent Exposure internally
1.184 +*/
1.185 +class CCAFRmDirStep : public CCAFStep
1.186 + {
1.187 +public:
1.188 + CCAFRmDirStep(CCAFServer& aParent);
1.189 + ~CCAFRmDirStep();
1.190 + virtual TVerdict doTestStepL();
1.191 +private:
1.192 + CCAFServer& iParent;
1.193 + };
1.194 +
1.195 +/*
1.196 +* Used to test CManager::GetDir()
1.197 +* The INI file specifies the file to delete and the expected return code.
1.198 +* For instance this can be used to try and delete a file that does not exist or a file
1.199 +* that is read-only or has rights that don't allow it to be deleted
1.200 +* INI file paramerters
1.201 +*
1.202 + path - the directory to list
1.203 + result - the expected return code
1.204 +*
1.205 +* @internalComponent Exposure internally
1.206 +*/
1.207 +class CCAFGetDirStep : public CCAFStep
1.208 + {
1.209 +public:
1.210 + CCAFGetDirStep(CCAFServer& aParent);
1.211 + ~CCAFGetDirStep();
1.212 + virtual TVerdict doTestStepL();
1.213 +private:
1.214 + void DisplayList(CDir& aDir);
1.215 + CCAFServer& iParent;
1.216 + };
1.217 +
1.218 +
1.219 +/*
1.220 +* Used to test CManager::NotifyStatusChange()
1.221 +* The INI file specifies the file to delete and the expected return code.
1.222 +* For instance this can be used to try and delete a file that does not exist or a file
1.223 +* that is read-only or has rights that don't allow it to be deleted
1.224 +* INI file paramerters
1.225 +*
1.226 +
1.227 +
1.228 +*
1.229 +* @internalComponent Exposure internally
1.230 +*/
1.231 +class CCAFManagerNotifyStep : public CCAFStep
1.232 + {
1.233 +public:
1.234 + CCAFManagerNotifyStep(CCAFServer& aParent);
1.235 + ~CCAFManagerNotifyStep();
1.236 + virtual TVerdict doTestStepL();
1.237 +private:
1.238 + CCAFServer& iParent;
1.239 + };
1.240 +
1.241 +/*
1.242 +* Used to test CManager::SetProperty()
1.243 +* The INI file specifies the file to delete and the expected return code.
1.244 +* For instance this can be used to try and delete a file that does not exist or a file
1.245 +* that is read-only or has rights that don't allow it to be deleted
1.246 +* INI file paramerters
1.247 +*
1.248 +
1.249 +
1.250 +*
1.251 +* @internalComponent Exposure internally
1.252 +*/
1.253 +class CCAFManagerSetPropertyStep : public CCAFStep
1.254 + {
1.255 +public:
1.256 + CCAFManagerSetPropertyStep(CCAFServer& aParent);
1.257 + ~CCAFManagerSetPropertyStep();
1.258 + virtual TVerdict doTestStepL();
1.259 +private:
1.260 + CCAFServer& iParent;
1.261 + };
1.262 +
1.263 +/*
1.264 +* Used to test CManager::DisplayInfo()
1.265 +* The INI file specifies the file to delete and the expected return code.
1.266 +* For instance this can be used to try and delete a file that does not exist or a file
1.267 +* that is read-only or has rights that don't allow it to be deleted
1.268 +* INI file paramerters
1.269 +*
1.270 +
1.271 +
1.272 +*
1.273 +* @internalComponent Exposure internally
1.274 +*/
1.275 +class CCAFManagerDisplayInfoStep : public CCAFStep
1.276 + {
1.277 +public:
1.278 + CCAFManagerDisplayInfoStep(CCAFServer& aParent);
1.279 + ~CCAFManagerDisplayInfoStep();
1.280 + virtual TVerdict doTestStepL();
1.281 +private:
1.282 + CCAFServer& iParent;
1.283 + };
1.284 +
1.285 +
1.286 +/*
1.287 +* Used to test CManager::ListAgents()
1.288 +* The INI file specifies the file to delete and the expected return code.
1.289 +* For instance this can be used to try and delete a file that does not exist or a file
1.290 +* that is read-only or has rights that don't allow it to be deleted
1.291 +* INI file paramerters
1.292 +*
1.293 +
1.294 +
1.295 +*
1.296 +* @internalComponent Exposure internally
1.297 +*/
1.298 +class CCAFManagerListAgentsStep : public CCAFStep
1.299 + {
1.300 +public:
1.301 + CCAFManagerListAgentsStep(CCAFServer& aParent);
1.302 + ~CCAFManagerListAgentsStep();
1.303 + virtual TVerdict doTestStepL();
1.304 +private:
1.305 + CCAFServer& iParent;
1.306 + };
1.307 +
1.308 +
1.309 +
1.310 +/*
1.311 +* Used to test CManager::AgentSpecificCommand()
1.312 +* The INI file specifies the file to delete and the expected return code.
1.313 +* For instance this can be used to try and delete a file that does not exist or a file
1.314 +* that is read-only or has rights that don't allow it to be deleted
1.315 +* INI file paramerters
1.316 +*
1.317 +
1.318 +
1.319 +*
1.320 +* @internalComponent Exposure internally
1.321 +*/
1.322 +class CCAFManagerAgentSpecificStep : public CCAFStep
1.323 + {
1.324 +public:
1.325 + CCAFManagerAgentSpecificStep(CCAFServer& aParent);
1.326 + ~CCAFManagerAgentSpecificStep();
1.327 + virtual TVerdict doTestStepL();
1.328 +private:
1.329 + CCAFServer& iParent;
1.330 + };
1.331 +
1.332 +
1.333 +/*
1.334 +* Used to test CManager::DisplayManagentInfoL()
1.335 +* The INI file specifies the file to delete and the expected return code.
1.336 +* For instance this can be used to try and delete a file that does not exist or a file
1.337 +* that is read-only or has rights that don't allow it to be deleted
1.338 +* INI file paramerters
1.339 +*
1.340 +
1.341 +
1.342 +*
1.343 +* @internalComponent Exposure internally
1.344 +*/
1.345 +class CCAFManagerDisplayConfigStep : public CCAFStep
1.346 + {
1.347 +public:
1.348 + CCAFManagerDisplayConfigStep(CCAFServer& aParent);
1.349 + ~CCAFManagerDisplayConfigStep();
1.350 + virtual TVerdict doTestStepL();
1.351 +private:
1.352 + CCAFServer& iParent;
1.353 + };
1.354 +
1.355 +
1.356 +/*
1.357 +* Used to test CManager::GetAttribute()
1.358 +* The INI file specifies the file to delete and the expected return code.
1.359 +* For instance this can be used to try and delete a file that does not exist or a file
1.360 +* that is read-only or has rights that don't allow it to be deleted
1.361 +* INI file paramerters
1.362 +*
1.363 +
1.364 +
1.365 +*
1.366 +* @internalComponent Exposure internally
1.367 +*/
1.368 +class CCAFManagerAttributeStep : public CCAFStep
1.369 + {
1.370 +public:
1.371 + CCAFManagerAttributeStep(CCAFServer& aParent);
1.372 + ~CCAFManagerAttributeStep();
1.373 + virtual TVerdict doTestStepL();
1.374 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.375 + TVerdict doWmdrmTestStepL();
1.376 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.377 +private:
1.378 + CCAFServer& iParent;
1.379 + };
1.380 +
1.381 +/*
1.382 +* Used to test CManager::GetAttributeSet()
1.383 +* The INI file specifies the file to delete and the expected return code.
1.384 +* For instance this can be used to try and delete a file that does not exist or a file
1.385 +* that is read-only or has rights that don't allow it to be deleted
1.386 +* INI file paramerters
1.387 +*
1.388 +
1.389 +
1.390 +*
1.391 +* @internalComponent Exposure internally
1.392 +*/
1.393 +class CCAFManagerAttributeSetStep : public CCAFStep
1.394 + {
1.395 +public:
1.396 + CCAFManagerAttributeSetStep(CCAFServer& aParent);
1.397 + ~CCAFManagerAttributeSetStep();
1.398 + virtual TVerdict doTestStepL();
1.399 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.400 + TVerdict doWmdrmTestStepL();
1.401 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.402 +
1.403 +private:
1.404 + CCAFServer& iParent;
1.405 + };
1.406 +
1.407 +/*
1.408 +* Used to test CManager::GetAttribute()
1.409 +* The INI file specifies the file to delete and the expected return code.
1.410 +* For instance this can be used to try and delete a file that does not exist or a file
1.411 +* that is read-only or has rights that don't allow it to be deleted
1.412 +* INI file paramerters
1.413 +*
1.414 +
1.415 +
1.416 +*
1.417 +* @internalComponent Exposure internally
1.418 +*/
1.419 +class CCAFManagerStringAttributeStep : public CCAFStep
1.420 + {
1.421 +public:
1.422 + CCAFManagerStringAttributeStep(CCAFServer& aParent);
1.423 + ~CCAFManagerStringAttributeStep();
1.424 + virtual TVerdict doTestStepL();
1.425 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.426 + TVerdict doWmdrmTestStepL();
1.427 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.428 +
1.429 +private:
1.430 + CCAFServer& iParent;
1.431 + };
1.432 +
1.433 +/*
1.434 +* Used to test CManager::GetStringAttributeSet()
1.435 +* The INI file specifies the file to delete and the expected return code.
1.436 +* For instance this can be used to try and delete a file that does not exist or a file
1.437 +* that is read-only or has rights that don't allow it to be deleted
1.438 +* INI file paramerters
1.439 +*
1.440 +
1.441 +
1.442 +*
1.443 +* @internalComponent Exposure internally
1.444 +*/
1.445 +class CCAFManagerStringAttributeSetStep : public CCAFStep
1.446 + {
1.447 +public:
1.448 + CCAFManagerStringAttributeSetStep(CCAFServer& aParent);
1.449 + ~CCAFManagerStringAttributeSetStep();
1.450 + virtual TVerdict doTestStepL();
1.451 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.452 + TVerdict doWmdrmTestStepL();
1.453 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.454 +
1.455 +private:
1.456 + CCAFServer& iParent;
1.457 + };
1.458 +
1.459 +
1.460 +_LIT(KCAFContentIteratorStep,"CAFContentIteratorStep");
1.461 +
1.462 +
1.463 +/*
1.464 +* Used to test CContentIterator
1.465 +* The INI file specifies the file to delete and the expected return code.
1.466 +* For instance this can be used to try and delete a file that does not exist or a file
1.467 +* that is read-only or has rights that don't allow it to be deleted
1.468 +* INI file paramerters
1.469 +*
1.470 +
1.471 +
1.472 +*
1.473 +* @internalComponent Exposure internally
1.474 +*/
1.475 +class CCAFContentIteratorStep : public CCAFStep
1.476 + {
1.477 +public:
1.478 + CCAFContentIteratorStep(CCAFServer& aParent);
1.479 + ~CCAFContentIteratorStep();
1.480 + virtual TVerdict doTestStepL();
1.481 + void PrintResult(const TDesC& aFileName, const TDesC& aUniqueId, const TDesC& aMimeType);
1.482 +
1.483 +private:
1.484 + CCAFServer& iParent;
1.485 + };
1.486 +
1.487 +
1.488 +/** Used by CCAFContentIteratorStep
1.489 +*/
1.490 +class CIteratorTestStateMachine : public CActive
1.491 + {
1.492 +public:
1.493 + CIteratorTestStateMachine(CCAFContentIteratorStep *aParent);
1.494 + virtual ~CIteratorTestStateMachine();
1.495 +
1.496 + void RunTestL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType);
1.497 +
1.498 + // From CActive
1.499 + virtual void RunL();
1.500 + virtual void DoCancel();
1.501 +
1.502 +
1.503 +private:
1.504 + HBufC *iPath;
1.505 + HBufC8 *iMimeType;
1.506 + TBool iRecursive;
1.507 + ContentAccess::CContentIterator *iter;
1.508 + CCAFContentIteratorStep *iParent;
1.509 + TInt iState;
1.510 + };
1.511 +
1.512 +
1.513 +/*
1.514 +* Used to test CManager::DisplayInfo() (file handle overload)
1.515 +*
1.516 +* @internalComponent
1.517 +*/
1.518 +class CCAFManagerDisplayInfoByFileHandleStep : public CCAFStep
1.519 + {
1.520 +public:
1.521 + CCAFManagerDisplayInfoByFileHandleStep(CCAFServer& aParent);
1.522 + ~CCAFManagerDisplayInfoByFileHandleStep();
1.523 + virtual TVerdict doTestStepL();
1.524 +private:
1.525 + CCAFServer& iParent;
1.526 + };
1.527 +
1.528 +/*
1.529 +* Used to test CManager::GetAttribute() (file handle overload)
1.530 +*
1.531 +* @internalComponent Exposure internally
1.532 +*/
1.533 +class CCAFManagerAttributeByFileHandleStep : public CCAFStep
1.534 + {
1.535 +public:
1.536 + CCAFManagerAttributeByFileHandleStep(CCAFServer& aParent);
1.537 + ~CCAFManagerAttributeByFileHandleStep();
1.538 + virtual TVerdict doTestStepL();
1.539 +private:
1.540 + CCAFServer& iParent;
1.541 + };
1.542 +
1.543 +/*
1.544 +* Used to test CManager::GetAttributeSet() (file handle overload)
1.545 +*
1.546 +* @internalComponent Exposure internally
1.547 +*/
1.548 +class CCAFManagerAttributeSetByFileHandleStep : public CCAFStep
1.549 + {
1.550 +public:
1.551 + CCAFManagerAttributeSetByFileHandleStep(CCAFServer& aParent);
1.552 + ~CCAFManagerAttributeSetByFileHandleStep();
1.553 + virtual TVerdict doTestStepL();
1.554 +private:
1.555 + CCAFServer& iParent;
1.556 + };
1.557 +
1.558 +/*
1.559 +* Used to test CManager::GetAttribute() (file handle overload)
1.560 +*
1.561 +* @internalComponent Exposure internally
1.562 +*/
1.563 +class CCAFManagerStringAttributeByFileHandleStep : public CCAFStep
1.564 + {
1.565 +public:
1.566 + CCAFManagerStringAttributeByFileHandleStep(CCAFServer& aParent);
1.567 + ~CCAFManagerStringAttributeByFileHandleStep();
1.568 + virtual TVerdict doTestStepL();
1.569 +private:
1.570 + CCAFServer& iParent;
1.571 + };
1.572 +
1.573 +/*
1.574 +* Used to test CManager::GetStringAttributeSet() (file handle overload)
1.575 +*
1.576 +* @internalComponent Exposure internally
1.577 +*/
1.578 +class CCAFManagerStringAttributeSetByFileHandleStep : public CCAFStep
1.579 + {
1.580 +public:
1.581 + CCAFManagerStringAttributeSetByFileHandleStep(CCAFServer& aParent);
1.582 + ~CCAFManagerStringAttributeSetByFileHandleStep();
1.583 + virtual TVerdict doTestStepL();
1.584 +private:
1.585 + CCAFServer& iParent;
1.586 + };
1.587 +
1.588 +#endif
1.589 +