linklayercontrol/nullagt/TS_AgentAdapter/src/csdAgent_ConnectionFailure.cpp
changeset 68 1697cc2ba93d
equal deleted inserted replaced
62:2f37ef12b43e 68:1697cc2ba93d
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contain the implementation of the class for generic CSD agent test
       
    15 // 
       
    16 //
       
    17 #include "CsdAgentTestSteps.h"
       
    18 #include "es_sock.h"
       
    19 #include "in_sock.h"
       
    20 
       
    21 
       
    22 CTestStepCsdAgtConnectionFailure::CTestStepCsdAgtConnectionFailure(TPtrC aName)
       
    23 {
       
    24 	iTestStepName=aName;
       
    25 }
       
    26 
       
    27 enum TVerdict CTestStepCsdAgtConnectionFailure::doTestStepL(void)
       
    28 	{
       
    29 	__UHEAP_MARK;
       
    30 	TInt err;
       
    31 	RSocketServ server;
       
    32 	RConnection connection;
       
    33 	TRequestStatus status;
       
    34 		
       
    35 	err = server.Connect();
       
    36 	TESTEL(err == KErrNone, err);
       
    37 	CleanupClosePushL(server);
       
    38 		
       
    39 	err = connection.Open(server,KAfInet);
       
    40 	TESTEL(err == KErrNone, err);
       
    41 	 CleanupClosePushL(connection);
       
    42 		
       
    43 	// Connection_Start_Failure.script
       
    44 	// Test Case2: Start the connection (outgoing) which results in a -1 Failure, it pulls pppLcp record from cedout.cfg
       
    45 	// It verifies AgentAdapter State transition from EConnecting to EDisconnecting state 
       
    46 	connection.Start(status);
       
    47 	User::WaitForRequest(status);
       
    48 	TESTEL(status.Int() == KErrNotFound, status.Int());
       
    49     
       
    50 	// Verifies the AgentAdapter State is in EDisconnecting State, Upon Agent Start ending in  a failure
       
    51     // Try to stop connection that failed to start
       
    52 	err = connection.Stop();
       
    53 	TESTEL(err == KErrNotReady, err);
       
    54 	CleanupStack::Pop();
       
    55 
       
    56 	// close the socket server
       
    57 	server.Close();
       
    58 	CleanupStack::Pop();
       
    59 
       
    60 	__UHEAP_MARKEND;
       
    61 
       
    62 	return iTestStepResult;
       
    63 	}
       
    64 
       
    65 
       
    66