//
// 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_csipreferdialogassoc-ne
//! @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_csipreferdialogassoc-ne
//
// Tests all public elements of the CSIPReferDialogAssoc
// 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 CSIPReferDialogAssoc
// The tests are fully automated.
/////////////////////////////////////////////////////////////////////

LOAD_SUITE	t_sipclientapi
DELAY		2000

START_TESTCASE              t_csipreferdialogassoc-ne-0001
//! @SYMTestCaseID          t_csipreferdialogassoc-ne-0001
//! @SYMAuthor              Felix Rao
//! @SYMCreationDate        01/09/2009
//! @SYMAPI                 CSIPReferDialogAssoc::NewLC(CSIPConnection{ref},CSIPFromHeader{prt},CUri8{prt},CSIPReferToHeader{prt},CSIPToHeader{prt},CSIPContactHeader{ptr})
//! @SYMTestCaseDesc        Create a Refer to dialog from a CSIPDialog object and a refer to header.
//! @SYMTestActions         1. Create wrapper objects of CSIPConnection, CSIPReferToHeader, CSIPContactHeader, CSIPToHeader, CSIP, CSIPReferDialogAssoc and CSIPFromHeader.
//!                         2. Initialize objects of CSIP and CSIPConnection.
//!                         3. Initialize objects of CSIPFromHeader, CSIPToHeader, CSIPContactHeader and CSIPReferToHeader.
//!                         4. Initialize object of CSIPReferDialogAssoc.
//!                         5. Destroy all objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults KErrArgument is returned.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipclientapi                     \SIP\sipclient\t_csipreferdialogassoc-ne.ini
        CREATE_OBJECT       CSIP                    sip
        CREATE_OBJECT       CSIPConnection          sipconnection
        CREATE_OBJECT       CSIPReferToHeader       refertoheader
        CREATE_OBJECT       CSIPToHeader            toheader
        CREATE_OBJECT       CSIPFromHeader          fromheader
        CREATE_OBJECT       CSIPReferDialogAssoc    referdialogassoc
        COMMAND             sip                     NewL            t_csipreferdialogassoc-ne-0001-NewL_command01
        COMMAND             sipconnection           NewL            t_csipreferdialogassoc-ne-0001-NewL_command02
        OUTSTANDING
        COMMAND             toheader                DecodeL         t_csipreferdialogassoc-ne-0001-DecodeL_command03
        COMMAND             refertoheader           DecodeL         t_csipreferdialogassoc-ne-0001-DecodeL_command04
        COMMAND  !Error=-6  referdialogassoc        NewLC           t_csipreferdialogassoc-ne-0001-NewLC_command05
        COMMAND             referdialogassoc        ~
        COMMAND             sipconnection           ~
        COMMAND             sip                     ~
    END_TEST_BLOCK
END_TESTCASE			t_csipreferdialogassoc-ne-0001

START_TESTCASE              t_csipreferdialogassoc-ne-0002
//! @SYMTestCaseID          t_csipreferdialogassoc-ne-0002
//! @SYMAuthor              Felix Rao
//! @SYMCreationDate        02/09/2009
//! @SYMAPI                 CSIPReferDialogAssoc::NewLC(CSIPConnection{ref}, CUri8{ptr}, const MSIPRegistrationContext{ref}, CSIPReferToHeader{ptr}, CSIPFromHeader{ptr}, CSIPToHeader{ptr}, CSIPContactHeader{ptr})
//! @SYMTestCaseDesc        Create a Refer to dialog from a CSIPDialog object and a refer to header.
//! @SYMTestActions         1.Create object for CSIPToHeader, CSIPRouteHeader, CSIPAddress, CSIPContactHeader, CSIPRefresh, CSIP,
//!                           CSIPConnection, CSIPClientTransaction, CSIPMessageElements, CSIPRegistrationBinding
//!                         2.Instantiate a new CSIP object with UID.
//!                         3.Instantiate a new CSIPConnection object with CSIP object and IAP name.
//!                         4.Create a SIPToHeader.
//!                         5.Create a SIPContactHeader.
//!                         6.Create a SIPRouteHeader.
//!                         7.Create a SIPRefresh.
//!                         8.Create SIP registration binding using SIPToHeader, SIPContactHeader, SIPRouteHeader, SIPRefresh and SIPConnection
//!                         9.Send registration request.
//!                         10.Wait for the registration response from SIP stack
//!                         11.Query the registration state
//!                         12.Create objects of CSIPReferToHeader and CSIPFromHeader.
//!                         13.Create object of CSIPReferDialogAssoc.
//!                         14.Destruct objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults KErrArgument is returned.
//! @SYMTestType            CIT
    START_TEST_BLOCK        100   t_sipclientapi          \sip\sipclient\t_csipreferdialogassoc-ne.ini
        CREATE_OBJECT       CSIPManagedProfileRegistry    managedprofileregistry
        CREATE_OBJECT       CSIPManagedProfile            managedprofile 
        CREATE_OBJECT       CSIPProfileRegistry           profileregistry
        CREATE_OBJECT       CSIP                          sip
        CREATE_OBJECT       CSIPProfile                   profile
        CREATE_OBJECT       CSIPConnection                sipconnection
        CREATE_OBJECT       CSIPClientTransaction         clienttransaction
        CREATE_OBJECT       CSIPResponseElements          responseelements
        CREATE_OBJECT       CSIPRequestElements           requestelements
        CREATE_OBJECT       CSIPToHeader                  toheader
        CREATE_OBJECT       CSIPFromHeader                fromheader
        CREATE_OBJECT       CSIPReferToHeader             refertoheader
        CREATE_OBJECT       CSIPMessageElements           messageelements
        CREATE_OBJECT       CSIPContentTypeHeader         contenttypeheader
        CREATE_OBJECT       CSIPReferDialogAssoc          referdialogassoc
        COMMAND             sip                           NewL                      t_csipreferdialogassoc-ne-0002-NewL_command01
        COMMAND             profileregistry               NewL                      t_csipreferdialogassoc-ne-0002-NewL_command02     
        COMMAND             managedprofileregistry        NewL                      
        COMMAND             sipconnection                 NewL                      t_csipreferdialogassoc-ne-0002-NewL_command04
        OUTSTANDING                                                                 
        COMMAND             managedprofileregistry        CreateL                   t_csipreferdialogassoc-ne-0002-CreateL_command05
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command06
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command07
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command08
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command09
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command10
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command11
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command12
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command13
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command14
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command15
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0002-SetParameter_command16
        COMMAND             managedprofileregistry        SaveL                     t_csipreferdialogassoc-ne-0002-SaveL_command17
        OUTSTANDING                                                                 
        COMMAND             profileregistry               DefaultProfileL           t_csipreferdialogassoc-ne-0002-DefaultProfileL_command18
        COMMAND             profileregistry               EnableL                   t_csipreferdialogassoc-ne-0002-EnableL_command19
        OUTSTANDING
        COMMAND             refertoheader                 DecodeL                   t_csipreferdialogassoc-ne-0002-DecodeL_command20
        COMMAND             fromheader                    DecodeL                   t_csipreferdialogassoc-ne-0002-DecodeL_command21
        COMMAND !Error=-6   referdialogassoc              NewLC                     t_csipreferdialogassoc-ne-0002-NewLC_command22
        COMMAND             profileregistry               Disable                   t_csipreferdialogassoc-ne-0002-Disable_command23
        OUTSTANDING                                                                 
        COMMAND             managedprofileregistry        DestroyL                  t_csipreferdialogassoc-ne-0002-DestroyL_command24
        OUTSTANDING
        COMMAND             sipconnection                 ~
        COMMAND             clienttransaction             ~
        COMMAND             contenttypeheader             ~
        COMMAND             responseelements              ~
        COMMAND             requestelements               ~
        COMMAND             contenttypeheader             ~
        COMMAND             toheader                      ~
        COMMAND             referdialogassoc              ~
        COMMAND             profile                       ~
        COMMAND             sip                           ~
        COMMAND             profileregistry               ~
        COMMAND             managedprofileregistry        ~
        COMMAND             managedprofile                ~
    END_TEST_BLOCK
END_TESTCASE			t_csipreferdialogassoc-ne-0002

START_TESTCASE              t_csipreferdialogassoc-ne-0003
//! @SYMTestCaseID          t_csipreferdialogassoc-ne-0003
//! @SYMAuthor              Felix Rao
//! @SYMCreationDate        02/09/2009
//! @SYMAPI                 CSIPReferDialogAssoc::NewLC(CSIPConnection{ref}, CUri8{ptr}, const MSIPRegistrationContext{ref}, CSIPReferToHeader{ptr}, CSIPFromHeader{ptr}, CSIPToHeader{ptr}, CSIPContactHeader{ptr})
//! @SYMTestCaseDesc        Create a Refer to dialog from a CSIPDialog object and a refer to header.
//! @SYMTestActions         1.Create object for CSIPToHeader, CSIPRouteHeader, CSIPAddress, CSIPContactHeader, CSIPRefresh, CSIP,
//!                           CSIPConnection, CSIPClientTransaction, CSIPMessageElements, CSIPRegistrationBinding
//!                         2.Instantiate a new CSIP object with UID.
//!                         3.Instantiate a new CSIPConnection object with CSIP object and IAP name.
//!                         4.Create a SIPToHeader.
//!                         5.Create a SIPContactHeader.
//!                         6.Create a SIPRouteHeader.
//!                         7.Create a SIPRefresh.
//!                         8.Create SIP registration binding using SIPToHeader, SIPContactHeader, SIPRouteHeader, SIPRefresh and SIPConnection
//!                         9.Send registration request.
//!                         10.Wait for the registration response from SIP stack
//!                         11.Query the registration state
//!                         12.Create objects of CSIPReferToHeader and CSIPFromHeader.
//!                         13.Create object of CSIPReferDialogAssoc.
//!                         14.Destruct objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults KErrArgument is returned.
//! @SYMTestType            CIT
    START_TEST_BLOCK        100   t_sipclientapi          \sip\sipclient\t_csipreferdialogassoc-ne.ini
        CREATE_OBJECT       CSIPManagedProfileRegistry    managedprofileregistry
        CREATE_OBJECT       CSIPManagedProfile            managedprofile 
        CREATE_OBJECT       CSIPProfileRegistry           profileregistry
        CREATE_OBJECT       CSIP                          sip
        CREATE_OBJECT       CSIPProfile                   profile
        CREATE_OBJECT       CSIPConnection                sipconnection
        CREATE_OBJECT       CSIPClientTransaction         clienttransaction
        CREATE_OBJECT       CSIPResponseElements          responseelements
        CREATE_OBJECT       CSIPRequestElements           requestelements
        CREATE_OBJECT       CSIPToHeader                  toheader
        CREATE_OBJECT       CSIPFromHeader                fromheader
        CREATE_OBJECT       CSIPReferToHeader             refertoheader
        CREATE_OBJECT       CSIPMessageElements           messageelements
        CREATE_OBJECT       CSIPContentTypeHeader         contenttypeheader
        CREATE_OBJECT       CSIPReferDialogAssoc          referdialogassoc
        COMMAND             sip                           NewL                      t_csipreferdialogassoc-ne-0003-NewL_command01
        COMMAND             profileregistry               NewL                      t_csipreferdialogassoc-ne-0003-NewL_command02     
        COMMAND             managedprofileregistry        NewL                      
        COMMAND             sipconnection                 NewL                      t_csipreferdialogassoc-ne-0003-NewL_command04
        OUTSTANDING                                                                 
        COMMAND             managedprofileregistry        CreateL                   t_csipreferdialogassoc-ne-0003-CreateL_command05
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command06
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command07
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command08
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command09
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command10
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command11
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command12
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command13
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command14
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command15
        COMMAND             managedprofile                SetParameter              t_csipreferdialogassoc-ne-0003-SetParameter_command16
        COMMAND             managedprofileregistry        SaveL                     t_csipreferdialogassoc-ne-0003-SaveL_command17
        OUTSTANDING                                                                 
        COMMAND             profileregistry               DefaultProfileL           t_csipreferdialogassoc-ne-0003-DefaultProfileL_command18
        COMMAND             profileregistry               EnableL                   t_csipreferdialogassoc-ne-0003-EnableL_command19
        OUTSTANDING
        COMMAND             fromheader                    DecodeL                   t_csipreferdialogassoc-ne-0003-DecodeL_command21
        COMMAND  !Error=-6  referdialogassoc              NewLC                     t_csipreferdialogassoc-ne-0003-NewLC_command22
        COMMAND             profileregistry               Disable                   t_csipreferdialogassoc-ne-0003-Disable_command23
        OUTSTANDING                                                                 
        COMMAND             managedprofileregistry        DestroyL                  t_csipreferdialogassoc-ne-0003-DestroyL_command24
        OUTSTANDING
        COMMAND             sipconnection                 ~
        COMMAND             clienttransaction             ~
        COMMAND             contenttypeheader             ~
        COMMAND             responseelements              ~
        COMMAND             requestelements               ~
        COMMAND             contenttypeheader             ~
        COMMAND             toheader                      ~
        COMMAND             referdialogassoc              ~
        COMMAND             profile                       ~
        COMMAND             sip                           ~
        COMMAND             profileregistry               ~
        COMMAND             managedprofileregistry        ~
        COMMAND             managedprofile                ~
    END_TEST_BLOCK
END_TESTCASE			t_csipreferdialogassoc-ne-0003

START_TESTCASE              t_csipreferdialogassoc-ne-0004
//! @SYMTestCaseID          t_csipreferdialogassoc-ne-0004
//! @SYMAuthor              Felix Rao
//! @SYMCreationDate        01/09/2009
//! @SYMAPI                 CSIPReferDialogAssoc::NewLC(CSIPDialog{ref},CSIPReferToHeader{prt})
//! @SYMTestCaseDesc        Create a Refer to dialog from a CSIPDialog object and a refer to header.
//! @SYMTestActions         1. Create wrapper objects of CSIPConnection, CSIPReferToHeader, CSIPContactHeader, CSIPToHeader, CSIP, CSIPReferDialogAssoc and CSIPFromHeader.
//!                         2. Initialize objects of CSIP and CSIPConnection.
//!                         3. Initialize objects of CSIPFromHeader, CSIPToHeader, CSIPContactHeader and CSIPReferToHeader.
//!                         4. Initialize object of CSIPReferDialogAssoc.
//!                         4. Initialize object of CSIPReferDialogAssoc using CSIPDialog object and CSIPReferToHeader object.
//!                         5. Destroy all objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults Panic with KErrArgument.
//! @SYMTestType            CIT
    START_TEST_BLOCK    100 t_sipclientapi                     \SIP\sipclient\t_csipreferdialogassoc-ne.ini
        CREATE_OBJECT       CSIP                    sip
        CREATE_OBJECT       CSIPConnection          sipconnection
        CREATE_OBJECT       CSIPReferToHeader       refertoheader
        CREATE_OBJECT       CSIPReferToHeader       refertoheader2
        CREATE_OBJECT       CSIPToHeader            toheader
        CREATE_OBJECT       CSIPFromHeader          fromheader
        CREATE_OBJECT       CSIPReferDialogAssoc    referdialogassoc
        CREATE_OBJECT       CSIPReferDialogAssoc    referdialogassoc2
        CREATE_OBJECT       CSIPDialog              sipdialog
        COMMAND             sip                     NewL            t_csipreferdialogassoc-ne-0004-NewL_command01
        COMMAND             sipconnection           NewL            t_csipreferdialogassoc-ne-0004-NewL_command02
        OUTSTANDING
        COMMAND             toheader                DecodeL         t_csipreferdialogassoc-ne-0004-DecodeL_command03
        COMMAND             fromheader              DecodeL         t_csipreferdialogassoc-ne-0004-DecodeL_command04
        COMMAND             refertoheader           DecodeL         t_csipreferdialogassoc-ne-0004-DecodeL_command05
        COMMAND             referdialogassoc        NewL            t_csipreferdialogassoc-ne-0004-NewL_command07
        COMMAND             referdialogassoc        Dialog          t_csipreferdialogassoc-ne-0004-Dialog_command09
        COMMAND  !Error=-6  referdialogassoc2       NewLC           t_csipreferdialogassoc-ne-0004-NewLC_command10
        COMMAND             referdialogassoc2       ~
        COMMAND             referdialogassoc        ~
        COMMAND             sipconnection           ~
        COMMAND             sip                     ~
    END_TEST_BLOCK
END_TESTCASE			t_csipreferdialogassoc-ne-0004

