xml/xmldomandxpath/test/tef/xmlengdomutils_tef/src/CXmlEngNodeTestSetValue.cpp
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 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 //
       
    15 
       
    16 /**
       
    17  @file CXmlEngNodeTestSetValue.cpp
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 #include "CXmlEngNodeTestSetValue.h"
       
    22 
       
    23 #include <xml/dom/xmlengdomutils.h>
       
    24 #include <xml/dom/xmlengdomimplementation.h>
       
    25 #include <xml/dom/xmlengdocument.h>
       
    26 
       
    27 /**
       
    28  * Class CXmlEngDOMUtilStep1 Implementation
       
    29  */
       
    30 CXmlEngNodeTestSetValue::CXmlEngNodeTestSetValue(const TDesC& aStepName)
       
    31 	{
       
    32 	//Set the test step name in the base class
       
    33 	SetTestStepName(aStepName);
       
    34 	} 
       
    35 
       
    36 TVerdict CXmlEngNodeTestSetValue::doTestStepL(void)
       
    37 	{
       
    38 	if (TestStepName() == KXmlEngNodeTestSetValueStep)
       
    39 		{
       
    40 		INFO_PRINTF1(KXmlEngNodeTestSetValueStep);
       
    41 		SetTestStepResult(TestKXmlEngTestSetValue());
       
    42 		}
       
    43 			
       
    44 	return TestStepResult();
       
    45 	}
       
    46 
       
    47 
       
    48 TVerdict CXmlEngNodeTestSetValue::TestKXmlEngTestSetValue()
       
    49 	{
       
    50 	TInt err = KErrNone; 
       
    51 	_LIT8(KLit1, "asdfds");
       
    52 	_LIT8(KLit2, "xzcvcv");
       
    53 	_LIT8(KLit3, "lklklk");
       
    54 	TBufC8<30> aLocalName(KLit1);
       
    55 	TBufC8<30> aNamespaceUri(KLit2);
       
    56 	TBufC8<30> aPrefix(KLit3);
       
    57 	
       
    58 	RXmlEngDOMImplementation domImpl;
       
    59 	domImpl.OpenL(); 
       
    60 		
       
    61 	RXmlEngDocument doc;
       
    62 	doc.OpenL(domImpl);
       
    63 
       
    64 	TXmlEngElement aElement = doc.CreateElementL(aLocalName, aNamespaceUri, aPrefix);
       
    65 	
       
    66 	//For code coverage
       
    67 	TRAP(err, aElement.SetValueL(aPrefix));
       
    68 	
       
    69 	
       
    70 	doc.Close();               
       
    71 	domImpl.Close();
       
    72 		
       
    73 	if (KErrNone != err)
       
    74 	{
       
    75 		return EFail;
       
    76 	}
       
    77 	
       
    78 	return EPass;
       
    79 	}