//
// Copyright (c) 20006-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_csiprefresh
//! @SYMScriptTestEnvironment This test script requires a basic ROM.

///////////////////////////////////////////////////////////////////////////////
// t_csiprefresh.script

LOAD_SUITE      t_sipclientapi
DELAY           2000

// ****************************************************************************
// CSIPRefresh class
// ****************************************************************************
START_TESTCASE t_csiprefresh-0001 
//! @SYMTestCaseID          t_csiprefresh_0001
//! @SYMAPI                 CSIPrefresh::NewL and CSIPrefresh::~CSIPRefresh()
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIPRefresh and delete it.
//! @SYMTestActions         1.Create a SIPrefresh.
//!                         2.Destruct object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: Create a SIPrefresh successfully and delete it successfully. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT		CSIPRefresh				  refresh
		COMMAND				refresh					  NewL
        COMMAND				refresh					  ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0001

START_TESTCASE t_csiprefresh-0002 
//! @SYMTestCaseID          t_csiprefresh_0002
//! @SYMAPI                 CSIPrefresh::NewLC and CSIPrefresh::~CSIPRefresh()
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIPRefresh and delete it.
//! @SYMTestActions         1.Create a SIPrefresh.
//!                         2.Destruct object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: Create a SIPrefresh successfully and delete it successfully. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT		CSIPRefresh				  refresh
		COMMAND				refresh					  NewLC
        COMMAND				refresh					  ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0002

START_TESTCASE t_csiprefresh-0003 
//! @SYMTestCaseID          t_csiprefresh_0003
//! @SYMAPI                 CSIPrefresh::NewLC and CSIPrefresh::~CSIPRefresh()
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIPRefresh and delete it.
//! @SYMTestActions         1.Create a SIPrefresh.
//!							2.Query refresh state.
//!                         3.Destruct object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: Create a SIPrefresh successfully and delete it successfully. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT		CSIPRefresh				  refresh
		COMMAND				refresh					  NewLC
		COMMAND				refresh					  State
        COMMAND				refresh					  ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0003

START_TESTCASE t_csiprefresh-0004 
//! @SYMTestCaseID          t_csiprefresh_0004
//! @SYMAPI                 CSIPrefresh::NewLC and CSIPrefresh::~CSIPRefresh()
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIPRefresh and delete it.
//! @SYMTestActions         1.Create a SIPrefresh.
//!							2.Query standalone state.
//!                         3.Destruct object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: Create a SIPrefresh successfully and delete it successfully. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT		CSIPRefresh				  refresh
		COMMAND				refresh					  NewLC
		COMMAND				refresh					  IsStandAlone
        COMMAND				refresh					  ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0004

START_TESTCASE t_csiprefresh-0005 
//! @SYMTestCaseID          t_csiprefresh-0005
//! @SYMAPI                 Set Credentials to the sip server
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIP Set Credentials request.
//! @SYMTestActions         1.Create object for CSIPToHeader, CSIPRouteHeader, CSIPAddress, CSIPContactHeader, CSIPRefresh, 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.Create a SIPHttpDigest using MSIPHttpDigestChallengeObserver2.
//!							10.Send registration request.
//!							11.Wait for server call back ChallengeReceived()
//!							12.SetCredentialsL with an outbound proxy ,servers's realm, user's name, and user's password
//!                         13.Wait for the incoming response
//!                         14.Query the interval time.
//!							15.Set interval time.
//!                         16.Destruct objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: SIP setting credentials is successful. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT       CSIPToHeader                  toheader
	  	CREATE_OBJECT       CSIPRouteHeader               routeheader
        CREATE_OBJECT       CSIPAddress                   address
	  	CREATE_OBJECT       CSIPAddress                   address2
        CREATE_OBJECT       CSIPContactHeader             contactheader
        CREATE_OBJECT       CSIPRefresh                   refresh
        CREATE_OBJECT       CSIPRegistrationBinding       binding
        CREATE_OBJECT       CSIPMessageElements           messageelements
        CREATE_OBJECT       CSIPConnection                sipconnection
        CREATE_OBJECT       CSIP                          sip
        CREATE_OBJECT       CSIPClientTransaction         clienttransaction
        CREATE_OBJECT		CSIPHttpDigest				  httpdigest
        COMMAND             sip                           NewL                      t_csiprefresh_0005-NewL_command01                          
        COMMAND             sipconnection                 NewL                      t_csiprefresh_0005-NewL_command02
        OUTSTANDING    
        COMMAND             toheader                      DecodeL                   t_csiprefresh_0005-DecodeL_command03
        COMMAND             address                       DecodeL                   t_csiprefresh_0005-DecodeL_command04 
        COMMAND             contactheader                 NewL                      t_csiprefresh_0005-NewL_command05 
        COMMAND             address2                      DecodeL                   t_csiprefresh_0005-DecodeL_command06
        COMMAND             routeheader                   NewL                      t_csiprefresh_0005-NewL_command07 
        COMMAND             refresh                       NewL    
        COMMAND             binding                       NewL                      t_csiprefresh_0005-NewL_command09
        COMMAND				httpdigest					  NewL						t_csiprefresh_0005-NewL_command10
        COMMAND             binding                       RegisterL                 t_csiprefresh_0005-RegisterL_command11
        COMMAND             httpdigest                    WaitForChallengeReceived  t_csiprefresh_0005-WaitForChallengeReceived_command12
        OUTSTANDING
        COMMAND				httpdigest					  SetCredentialsL			t_csiprefresh_0005-SetCredentialsL_command13
        COMMAND             sipconnection                 WaitForIncomingResponse   t_csiprefresh_0005-WaitForIncomingResponse_command14
        OUTSTANDING
        COMMAND				refresh						  IntervalL
        COMMAND				refresh						  SetIntervalL				t_csiprefresh_0005-SetIntervalL_command16			
        COMMAND				refresh						  IntervalL
        COMMAND             binding                       ~
        COMMAND				httpdigest					  ~
        COMMAND             clienttransaction             ~
        COMMAND             refresh                       ~
        COMMAND             sipconnection                 ~
        COMMAND             sip                           ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0005

START_TESTCASE t_csiprefresh-0006 
//! @SYMTestCaseID          t_csiprefresh-0006
//! @SYMAPI                 Set Credentials to the sip server
//! @SYMAuthor              Simon Zhang
//! @SYMCreationDate        10/09/2009
//! @SYMTestCaseDesc        Creates SIP Set Credentials request.
//! @SYMTestActions         1.Create object for CSIPToHeader, CSIPRouteHeader, CSIPAddress, CSIPContactHeader, CSIPRefresh, 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.Create a SIPHttpDigest using MSIPHttpDigestChallengeObserver2.
//!							10.Send registration request.
//!							11.Wait for server call back ChallengeReceived()
//!							12.SetCredentialsL with an outbound proxy ,servers's realm, user's name, and user's password
//!                         13.Wait for the incoming response
//!                         14.Call CSIPRefresh::SIPTransaction().
//!                         15.Destruct objects.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults: SIP setting credentials is successful. 
//! @SYMTestType            CIT

    START_TEST_BLOCK        300   t_sipclientapi          \sip\sipclient\t_csiprefresh.ini
        CREATE_OBJECT       CSIPToHeader                  toheader
	  	CREATE_OBJECT       CSIPRouteHeader               routeheader
        CREATE_OBJECT       CSIPAddress                   address
	  	CREATE_OBJECT       CSIPAddress                   address2
        CREATE_OBJECT       CSIPContactHeader             contactheader
        CREATE_OBJECT       CSIPRefresh                   refresh
        CREATE_OBJECT       CSIPRegistrationBinding       binding
        CREATE_OBJECT       CSIPMessageElements           messageelements
        CREATE_OBJECT       CSIPConnection                sipconnection
        CREATE_OBJECT       CSIP                          sip
        CREATE_OBJECT       CSIPClientTransaction         clienttransaction
        CREATE_OBJECT		CSIPHttpDigest				  httpdigest
        COMMAND             sip                           NewL                      t_csiprefresh_0006-NewL_command01                          
        COMMAND             sipconnection                 NewL                      t_csiprefresh_0006-NewL_command02
        OUTSTANDING    
        COMMAND             toheader                      DecodeL                   t_csiprefresh_0006-DecodeL_command03
        COMMAND             address                       DecodeL                   t_csiprefresh_0006-DecodeL_command04 
        COMMAND             contactheader                 NewL                      t_csiprefresh_0006-NewL_command05 
        COMMAND             address2                      DecodeL                   t_csiprefresh_0006-DecodeL_command06
        COMMAND             routeheader                   NewL                      t_csiprefresh_0006-NewL_command07 
        COMMAND             refresh                       NewL    
        COMMAND             binding                       NewL                      t_csiprefresh_0006-NewL_command09
        COMMAND				httpdigest					  NewL						t_csiprefresh_0006-NewL_command10
        COMMAND             binding                       RegisterL                 t_csiprefresh_0006-RegisterL_command11
        COMMAND             httpdigest                    WaitForChallengeReceived  t_csiprefresh_0006-WaitForChallengeReceived_command12
        OUTSTANDING
        COMMAND				httpdigest					  SetCredentialsL			t_csiprefresh_0006-SetCredentialsL_command13
        COMMAND             sipconnection                 WaitForIncomingResponse   t_csiprefresh_0006-WaitForIncomingResponse_command14
        OUTSTANDING
        COMMAND				refresh						  SIPTransaction			t_csiprefresh_0006-SIPTransaction_command15
        COMMAND             binding                       ~
        COMMAND				httpdigest					  ~
        COMMAND             clienttransaction             ~
        COMMAND             refresh                       ~
        COMMAND             sipconnection                 ~
        COMMAND             sip                           ~
    END_TEST_BLOCK
END_TESTCASE t_csiprefresh-0006
