//
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description: 
//
//
//! @file
//! @SYMTestSuiteName   t_sipcodecapi
//! @SYMScriptTestEnvironment This test script requires a basic ROM. An SIP server listening on ports 5060.
//        The communicaion to the server is established using the default connection.
//        The supplied commsdat is set up to use NTRAS on Emulator as well as on H/W.
//! @SYMScriptAutomation  The test suites are fully automated using TestDriver and Testexecute

/////////////////////////////////////////////////////////////////////
// t_csipcontentencodingheader
//
// Tests all public elements of the t_csipcontentencodingheader
// classes as a means of confidence that the APIs work as expected.
//
// The purpose is to provide a regression test suite of PublishedAll APIs for CSIPContentEncodingHeader
// The tests are fully automated.
/////////////////////////////////////////////////////////////////////

LOAD_SUITE  t_sipcodecapi
DELAY   2000

START_TESTCASE              t_csipcontentencodingheader-0001
//! @SYMTestCaseID          t_csipcontentencodingheader-0001
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::NewL(RStringF) 
//! @SYMTestCaseDesc        Construct and destruct CSIPContentEncodingHeader object.
//! @SYMTestActions         1. Create a CSIP object and a CSIPContentEncodingHeader object.
//!                         2. Construct CSIP and CSIPContentEncodingHeader object.
//!                         3. Delete the CSIPContentEncodingHeader object.
//!                         4. Delete the CSIP object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults The SIP Codec can start and close successfully without causing any panic
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi                      \SIP\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIP                        sip
        CREATE_OBJECT       CSIPContentEncodingHeader   contentencodingheader
        COMMAND             sip                         NewL            t_csipcontentencodingheader-0001-NewL_Command01
        COMMAND             contentencodingheader       NewL            t_csipcontentencodingheader-0001-NewL_Command02
        COMMAND             contentencodingheader       ~
        COMMAND             sip                         ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0001

START_TESTCASE              t_csipcontentencodingheader-0002
//! @SYMTestCaseID          t_csipcontentencodingheader-0002
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::NewLC(RStringF)
//! @SYMTestCaseDesc        Constructs a CSIPContentEncodingHeader object by using NewLC.
//! @SYMTestActions         1. Create a CSIP object and a CSIPContentEncodingHeader object.
//!                         2. Construct CSIP, and construct CSIPContentEncodingHeader object.
//!                         3. Delete the CSIPContentEncodingHeader object.
//!                         4. Delete the CSIP object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults The SIP Codec can start and close successfully without causing any panic
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi                      \SIP\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIP                        sip
        CREATE_OBJECT       CSIPContentEncodingHeader   contentencodingheader
        COMMAND             sip                         NewL            t_csipcontentencodingheader-0002-NewL_Command01
        COMMAND             contentencodingheader       NewLC           t_csipcontentencodingheader-0002-NewLC_Command02
        COMMAND             contentencodingheader       ~
        COMMAND             sip                         ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0002

START_TESTCASE              t_csipcontentencodingheader-0003
//! @SYMTestCaseID          t_csipcontentencodingheader-0003
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::DecodeL(const TDesC8{ref})
//! @SYMTestCaseDesc        Constructs a CSIPContentEncodingHeader object from textual presentation.
//! @SYMTestActions         1. Create a CSIP object and 2 CSIPContentEncodingHeader objects.
//!                         2. Construct CSIP object.
//!                         3. Construct 2 CSIPContentEncodingHeader objects from textual presentation by using DecodeL.
//!                         4. Check the second validation of CSIPContentEncodingHeader object.
//!                         5. Delete all objects
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults The CSIPContentEncodingHeader can be decoded successfully.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi                      \SIP\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIP                         sip
        CREATE_OBJECT       CSIPContentEncodingHeader    contentencodingheader
        CREATE_OBJECT       CSIPContentEncodingHeader    contentencodingheader1
        COMMAND             sip                          NewL                     t_csipcontentencodingheader-0003-NewL_Command01
        COMMAND             contentencodingheader        DecodeL                  t_csipcontentencodingheader-0003-DecodeL_Command02
        COMMAND             contentencodingheader1       Name                     t_csipcontentencodingheader-0003-Name_Command03
        COMMAND             contentencodingheader        ~
        COMMAND             contentencodingheader1       ~
        COMMAND             sip                          ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0003

START_TESTCASE              t_csipcontentencodingheader-0004
//! @SYMTestCaseID          t_csipcontentencodingheader-0004
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::InternalizeValueL()
//! @SYMTestCaseDesc        Constructs an instance of a CSIPContentEncodingHeader from a RReadStream.
//! @SYMTestActions         1. Create a CSIP object and 2 CSIPContentEncodingHeader objects.
//!                         2. Construct CSIP and CSIPContentEncodingHeader object.
//!                         3. Set the 1st CSIPContentEncodingHeader object's header value as a token. 
//!                         4. Externalize 1st CSIPContentEncodingHeader object
//!                         5. Constructs an instance of a CSIPContentEncodingHeader from a RReadStream by using InternalizeValueL.
//!                         6. Get the header value as a token to check whether they are same with 1st CSIPContentEncodingHeader object set. 
//!                         7. Delete all objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults A CSIPContentEncodingHeader object can be created by internalizing from a file. The new one is same as the original one which externalizes to a file.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi             \sip\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIPContentEncodingHeader     contentencodingheader
        CREATE_OBJECT       CSIPContentEncodingHeader     contentencodingheader1
        CREATE_OBJECT       CSIP                          sip
        COMMAND             sip                           NewL            t_csipcontentencodingheader-0004-NewL_command01
        COMMAND             contentencodingheader         NewL            t_csipcontentencodingheader-0004-NewL_command02
        COMMAND             contentencodingheader         SetValueL       t_csipcontentencodingheader-0004-SetValueL_Command03
        COMMAND             contentencodingheader         ExternalizeL    t_csipcontentencodingheader-0004-ExternalizeL_command04
        COMMAND             contentencodingheader1        InternalizeValueL  t_csipcontentencodingheader-0004-InternalizeValueL_command05
        COMMAND             contentencodingheader1        Value           t_csipcontentencodingheader-0004-Value_command06
        COMMAND             contentencodingheader         ~
        COMMAND             contentencodingheader1        ~
        COMMAND             sip                           ~ 
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0004


START_TESTCASE              t_csipcontentencodingheader-0005
//! @SYMTestCaseID          t_csipcontentencodingheader-0005
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::Name()
//! @SYMTestCaseDesc        Gets the full name of the header.
//! @SYMTestActions         1. Create a CSIP object and a CSIPContentEncodingHeader object.
//!                         2. Construct CSIP and CSIPContentEncodingHeader object.
//!                         3. Get name of the CSIPContentEncodingHeader object.
//!                         4. Delete all objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults Name() can be called successfully.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi                      \SIP\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIP                        sip
        CREATE_OBJECT       CSIPContentEncodingHeader   contentencodingheader
        COMMAND             sip                         NewL            t_csipcontentencodingheader-0005-NewL_Command01
        COMMAND             contentencodingheader       NewL            t_csipcontentencodingheader-0005-NewL_Command02
        COMMAND             contentencodingheader       Name
        COMMAND             contentencodingheader       ~
        COMMAND             sip                         ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0005


START_TESTCASE              t_csipcontentencodingheader-0006
//! @SYMTestCaseID          t_csipcontentencodingheader-0006
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::CloneL()
//! @SYMTestCaseDesc        Creates a deep-copy of this header object.
//! @SYMTestActions         1. Create a CSIP object and 2 CSIPContentEncodingHeader objects.
//!                         2. Construct CSIP and CSIPContentEncodingHeader object.
//!                         3. Clone the CSIPContentEncodingHeader object to 2nd one and check the 2nd one is same as 1st one.
//!                         4. Delete all objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults CloneL can be called successfully and the clone is same as original one.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi             \sip\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIPContentEncodingHeader     contentencodingheader
        CREATE_OBJECT       CSIPContentEncodingHeader     contentencodingheader1
        CREATE_OBJECT       CSIP                          sip
        COMMAND             sip                           NewL           t_csipcontentencodingheader-0006-NewL_Command01
        COMMAND             contentencodingheader         NewL           t_csipcontentencodingheader-0006-NewL_Command02
        COMMAND             contentencodingheader         SetValueL t_csipcontentencodingheader-0006-SetValueL_Command03
        COMMAND             contentencodingheader         CloneL         t_csipcontentencodingheader-0006-CloneL_command04
        COMMAND             contentencodingheader1        Value          t_csipcontentencodingheader-0006-Value_command05
        COMMAND             contentencodingheader         ~
        COMMAND             contentencodingheader1        ~
        COMMAND             sip                           ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0006

START_TESTCASE              t_csipcontentencodingheader-0007
//! @SYMTestCaseID          t_csipcontentencodingheader-0007
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        12/11/2009
//! @SYMAPI                 CSIPContentEncodingHeader::DecodeL()
//! @SYMTestCaseDesc        Negative case,constructs a CSIPContentEncodingHeader object from abnormal textual presentation.
//! @SYMTestActions         1. Create a CSIP object and CSIPContentEncodingHeader objects.
//!                         2. Construct CSIP object.
//!                         3. Construct CSIPContentEncodingHeader objects from an abnormal textual presentation by using DecodeL.
//!                         4. Delete all objects
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults The CSIPContentEncodingHeader DecodeL leaves with error KErrSipCodecTokenBaseHeader(-17789).
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipcodecapi                      \SIP\sipcodec\t_csipcontentencodingheader.ini
        CREATE_OBJECT       CSIP                    sip
        CREATE_OBJECT       CSIPContentEncodingHeader    contentencodingheader
        COMMAND             sip                          NewL        t_csipcontentencodingheader-0007-NewL_Command01
        COMMAND  !Error=-17789 contentencodingheader     DecodeL     t_csipcontentencodingheader-0007-DecodeL_Command02
        COMMAND             contentencodingheader        ~
        COMMAND             sip                          ~
    END_TEST_BLOCK
END_TESTCASE      t_csipcontentencodingheader-0007
