installationservices/swtransactionservices/test/source/tststestsuiteserverrollbackall.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2008-2009 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 the License "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  @file
       
    21  @test
       
    22  @internalComponent
       
    23 */
       
    24 #include "tststestsuiteserverrollbackall.h"
       
    25 #include "tststestsuitesteprollbackall.h"
       
    26 
       
    27 LOCAL_C void MainL()
       
    28 	{
       
    29 	CActiveScheduler* sched=NULL;
       
    30 	sched=new(ELeave) CActiveScheduler;
       
    31 	CActiveScheduler::Install(sched);
       
    32 	CStsTestServerRollbackAll* server = NULL;
       
    33 	// Create the CTestServer derived server
       
    34 	TRAPD(err,server = CStsTestServerRollbackAll::NewL());
       
    35 	if(!err)
       
    36 		{
       
    37 		// Sync with the client and enter the active scheduler
       
    38 		RProcess::Rendezvous(KErrNone);
       
    39 		sched->Start();
       
    40 		}
       
    41 	delete server;
       
    42 	delete sched;
       
    43 	}
       
    44 
       
    45 
       
    46 TInt E32Main()
       
    47 /**
       
    48  @return - Standard Epoc error code on process exit
       
    49  Process entry point. Called by client using RProcess API
       
    50  */
       
    51 	{
       
    52 	__UHEAP_MARK;
       
    53 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    54 	if(cleanup == NULL)
       
    55 		{
       
    56 		return KErrNoMemory;
       
    57 		}
       
    58 	TRAPD(err,MainL());
       
    59 	delete cleanup;
       
    60 	__UHEAP_MARKEND;
       
    61 	return err;
       
    62 	}
       
    63 
       
    64 _LIT(KServerName,"tststestserverrollbackall");
       
    65 
       
    66 CStsTestServerRollbackAll* CStsTestServerRollbackAll::NewL()
       
    67 /**
       
    68  @return - Instance of the test server
       
    69  Called inside the MainL() function to create and start the
       
    70  CTestServer derived server.
       
    71  */
       
    72 	{
       
    73 	CStsTestServerRollbackAll * server = new (ELeave) CStsTestServerRollbackAll();
       
    74 	CleanupStack::PushL(server);
       
    75 	server-> ConstructL();
       
    76 	CleanupStack::Pop(server);
       
    77 	return server;
       
    78 	}
       
    79 
       
    80 void CStsTestServerRollbackAll::ConstructL()
       
    81 	{
       
    82 	CTestServer::ConstructL(KServerName);
       
    83 	}
       
    84 
       
    85 CTestStep* CStsTestServerRollbackAll::CreateTestStep(const TDesC& aStepName)
       
    86 /**
       
    87  @return - A CTestStep derived instance
       
    88  Implementation of CTestServer pure virtual
       
    89  */
       
    90 	{
       
    91 	CTestStep* testStep = NULL;
       
    92 
       
    93 	if(aStepName == KRollbackAllPendingStep)
       
    94 		testStep = new CRollbackAllPendingStep();
       
    95 	return testStep;
       
    96 	}