commonutilities/common/test/t_tcommandparser/t_tcommandparser.h
changeset 23 74c9f037fd5d
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     1 /*
       
     2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __T_TCOMMANDPARSER_H__
       
    21 #define __T_TCOMMANDPARSER_H__
       
    22 
       
    23 //  EXTERNAL INCLUDES
       
    24 #include <CEUnitTestSuiteClass.h>
       
    25 #include <EUnitDecorators.h>
       
    26 
       
    27 #include <glxmediageneraldefs.h>
       
    28 //  INTERNAL INCLUDES
       
    29 #include "glxcommandparser.h"
       
    30 
       
    31 //  FORWARD DECLARATIONS
       
    32 
       
    33 class CMPXCollectionPath;
       
    34 //  CLASS DEFINITION
       
    35 /**
       
    36  * TODO Auto-generated EUnit test suite
       
    37  *
       
    38  */
       
    39 NONSHARABLE_CLASS( t_tcommandparser )
       
    40 	: public CEUnitTestSuiteClass, public MGlxCommandParserCallback
       
    41     {
       
    42     public:
       
    43         enum TTest
       
    44     	{
       
    45     	ENoTest,
       
    46     	ETestRemove1,
       
    47     	ETestRemove2,
       
    48     	ETestAdd1,
       
    49     	ETestAdd2,
       
    50     	ETestAdd3,
       
    51     	ETestAdd4,
       
    52     	ETestSet1,
       
    53     	ETestSet2,
       
    54     	ETestSet3,
       
    55         ETestSet4,
       
    56         ETestSet5
       
    57     	};
       
    58     public:     // Constructors and destructors
       
    59 
       
    60     	/**
       
    61          * Two phase construction
       
    62          */
       
    63         static t_tcommandparser* NewL();
       
    64         static t_tcommandparser* NewLC();
       
    65         /**
       
    66          * Destructor
       
    67          */
       
    68         ~t_tcommandparser();
       
    69 
       
    70     public: // from MGlxCommandParserCallback
       
    71     	
       
    72   
       
    73     	    void AddToContainerL(const RArray<TGlxMediaId>& aSourceIds, const RArray<TGlxMediaId>& aTargetContainers);
       
    74     	
       
    75     	    void AddContainerL(const TDesC& aContainerName);
       
    76     	      
       
    77     	    void AddToContainerL(const TDesC& aSourceUri, const RArray<TGlxMediaId>& aTargetContainers);    
       
    78     
       
    79     	    void CopyL(const RArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive);
       
    80     
       
    81     	    void MoveL(const RArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive);
       
    82   
       
    83     	    void RemoveFromContainerL(const RArray<TGlxMediaId>& aItemIds, const TGlxMediaId& aContainerId);
       
    84     
       
    85     	    void DeleteL(const RArray<TGlxMediaId>& aItemIds);
       
    86     	    
       
    87     	    void RenameL(const TGlxMediaId& aSourceItemId, const TDesC& aTitle);
       
    88    
       
    89     	    void SetDescriptionL(const RArray<TGlxMediaId>& aItemIds, const TDesC& aDescription);    
       
    90  	    
       
    91     	    void SetCaptureLocationL(const RArray<TGlxMediaId>& aItemIds, const TCoordinate& aCoordinate);
       
    92     	    
       
    93     	    void ThumbnailCleanupL() {} ;
       
    94 	private:    // Constructors and destructors
       
    95         t_tcommandparser();
       
    96         void ConstructL();
       
    97 
       
    98     
       
    99    private:    // New methods
       
   100 
       
   101 	     void TestRemove1L();
       
   102 	     void TestRemove2L();
       
   103 	     void TestAdd1L();
       
   104 	     void TestAdd2L();
       
   105 	     void TestAdd3L();
       
   106 	     void TestAdd4L();
       
   107 	     void TestSet1L();
       
   108 	     void TestSet2L();
       
   109 	     void TestSet3L();
       
   110          void TestSet4L();
       
   111          void TestSet5L();
       
   112          
       
   113 	     void SetupL();
       
   114          void Teardown();
       
   115         
       
   116          void T_TCommandParser_ParseLL();
       
   117           
       
   118          CMPXCommand* CommandFactoryLC();
       
   119          
       
   120          CMPXCollectionPath* PathFactoryLC(const RArray<TGlxMediaId>& aArray);
       
   121          
       
   122          void PopulateArrayL(RArray<TGlxMediaId>& aArray);
       
   123          void PopulateArrayAltL(RArray<TGlxMediaId>& aArray);
       
   124          
       
   125          TBool CompareArray(const RArray<TGlxMediaId>& aArray1, const RArray<TGlxMediaId>& aArray2);
       
   126     private:    // Data
       
   127 		
       
   128     	// Test data
       
   129     	RArray<TGlxMediaId> iArray1;
       
   130     	RArray<TGlxMediaId> iArray2;
       
   131     	TGlxMediaId iId1;
       
   132     	TUid iUid1;
       
   133     	TUint iUint1;
       
   134     	HBufC* iDesc1;
       
   135         TCoordinate iCoordinate;        
       
   136     	TBool iCallbackCalled;    	
       
   137     	TTest iCurrentTest;
       
   138         EUNIT_DECLARE_TEST_TABLE; 
       
   139 
       
   140     };
       
   141 
       
   142 #endif      //  __T_TCOMMANDPARSER_H__
       
   143 
       
   144 // End of file