--- a/commsfwsupport/commselements/meshmachine/src/mm_node.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/commsfwsupport/commselements/meshmachine/src/mm_node.cpp Tue May 11 17:20:19 2010 +0300
@@ -458,25 +458,31 @@
TInt idx = aContext.iNodeActivity->FindOriginator(aCommsId);
if (KErrNotFound!=idx)
{
+ TBool canSend = ETrue;
if(aContext.iNodeActivity->iOriginators.Count() == 1) // only if this is the final originator
{
aContext.iNodeActivity->SetError(KErrAbort);
aContext.iNodeActivity->Cancel(aContext);
+ //This is a workaround for CCommsBinderRequest. The proper fix is to abolish the concept of aborting activities.
+ //Aborting activities is a bad idea as an aborted activity isn't given a chance to perform graceful cleanup.
+ //Today activities get aborted because their orinators urgently leave. I.e.: they are trully leaving now! Last orders!
+ //It is then incorrect to leave the activity d'tor to finish the wrap up - because the node will be gone by then.
+ //So whether and when to send an error must be decided here, by this generic code that has no clue on the subtleties
+ //of individual activities. If there is no abort - there is urgent leavers. They send TLeaveRequest and they politely
+ //wait for the completion and all this code is unnecessary.
+ canSend = (aContext.iNodeActivity->Error() != KErrNone);
}
-
-
+
//In the "quiet mode", when the hosting node is being destroyed, we can not afford sending
//an error to the node as it would hit void.
TNodePeerId& originator = aContext.iNodeActivity->iOriginators[idx];
- TBool canSend = !((aIsNodeBeingDestroyed && originator == aContext.NodeId())
- || aContext.iMessage.IsMessage<TEChild::TLeft>());
+ canSend &= !((aIsNodeBeingDestroyed && originator == aContext.NodeId())
+ || aContext.iMessage.IsMessage<TEChild::TLeft>());
if (canSend)
{
aContext.iNodeActivity->PostToOriginator(originator, TEBase::TError(aContext.iMessage.MessageId(), KErrAbort).CRef());
}
-
-
- aContext.iNodeActivity->RemoveOriginator(idx);
+ aContext.iNodeActivity->RemoveOriginator(idx);
}
}
}
--- a/datacommsserver/esockserver/MobilityCoreProviders/src/mobilitycpractivities.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/MobilityCoreProviders/src/mobilitycpractivities.cpp Tue May 11 17:20:19 2010 +0300
@@ -197,7 +197,8 @@
TErrResponse& resp = message_cast<TEErrorRecovery::TErrorRecoveryResponse>(iContext.iMessage).iErrResponse;
if (resp.iAction == TErrResponse::ERetry)
{
- return KNoTag | NetStateMachine::EBackward;
+ iContext.Activity()->SetError(KErrNone);
+ return KNoTag | NetStateMachine::EBackward;
}
else if (resp.iAction == TErrResponse::EPropagate || resp.iError == KErrCancel)
{
--- a/datacommsserver/esockserver/bwins/esocksvrU.DEF Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/bwins/esocksvrU.DEF Tue May 11 17:20:19 2010 +0300
@@ -903,7 +903,7 @@
?TransitionTag@TBearerPresent@CoreNetStates@@UAEHXZ @ 902 NONAME ; int CoreNetStates::TBearerPresent::TransitionTag(void)
?TransitionTag@TBearerReady@CoreNetStates@@UAEHXZ @ 903 NONAME ABSENT ; int CoreNetStates::TBearerReady::TransitionTag(void)
?TransitionTag@TDataClientPresent@CoreNetStates@@UAEHXZ @ 904 NONAME ABSENT ; int CoreNetStates::TDataClientPresent::TransitionTag(void)
- ?TransitionTag@TLayerCompleted@CoreNetStates@@UAEHXZ @ 905 NONAME ABSENT ; int CoreNetStates::TLayerCompleted::TransitionTag(void)
+ ?Cancel@CCommsBinderActivity@PRActivities@@UAEXAAVTNodeContextBase@MeshMachine@@@Z @ 905 NONAME ; void PRActivities::CCommsBinderActivity::Cancel(class MeshMachine::TNodeContextBase &)
?TransitionTag@TNoTagBackwardsOrProviderStopped@CoreNetStates@@UAEHXZ @ 906 NONAME ; int CoreNetStates::TNoTagBackwardsOrProviderStopped::TransitionTag(void)
?TransitionTag@TNoTagOrBearerPresent@CNoBearer@PRActivities@@UAEHXZ @ 907 NONAME ; int PRActivities::CNoBearer::TNoTagOrBearerPresent::TransitionTag(void)
?FetchNodeInterfaceControlL@CTierManagerBase@ESock@@MAEPAVTInterfaceControl@NetInterfaces@@H@Z @ 908 NONAME ; class NetInterfaces::TInterfaceControl * ESock::CTierManagerBase::FetchNodeInterfaceControlL(int)
--- a/datacommsserver/esockserver/core_states/ss_corepractivities.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/core_states/ss_corepractivities.cpp Tue May 11 17:20:19 2010 +0300
@@ -1701,6 +1701,27 @@
iPendingBinder->SetFlags(TCFClientType::EActivating);
}
+EXPORT_C void CCommsBinderActivity::Cancel(TNodeContextBase& aContext)
+ {
+ if (iPendingBinder)
+ {
+ //iPendingBinder is set when CCommsBinderActivity decides which of its dataclients it
+ //wishes to send along with its TCommsBinderResponse and promptly (on the same stack) as
+ //this response is sent. After TCommsBinderResponse, the error handling of CCommsBinderActivity
+ //changes in that it should not flag any errors back to the recpient of TCommsBinderResponse.
+ //Such response may be when:
+ //(1) the recipient responds to TCommsBinderResponse with TError - the activity is finished, the recipients doesn't wait for anything (certainly not for an error)
+ //(2) the recipients explicitly cancels (or implicitly cancells by leaving the local node) - the activity is finished, the recipient doesn't wait for anything (certainly not for an error)
+ SetError(KErrNone);
+ BindToComplete();
+ SetIdle();
+ }
+ else
+ {
+ CNodeRetryParallelActivity::Cancel(aContext);
+ }
+ }
+
void CCommsBinderActivity::BindToComplete()
{
__ASSERT_DEBUG(iPendingBinder, User::Panic(KSpecAssert_ESockCrStaCPRAC, 23));
--- a/datacommsserver/esockserver/core_states/ss_corepractivities.h Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/core_states/ss_corepractivities.h Tue May 11 17:20:19 2010 +0300
@@ -685,6 +685,8 @@
public:
static const TInt KInterfaceId = 0x102864DE;
+ IMPORT_C virtual void Cancel(MeshMachine::TNodeContextBase& aContext);
+
IMPORT_C static Messages::RNodeInterface* IsDataClientPresent(MeshMachine::TNodeContextBase& aContext, TUint aClientFlags = 0);
IMPORT_C void StoreBinder(Messages::RNodeInterface* aDataClient);
--- a/datacommsserver/esockserver/core_states/ss_coreprstates.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/core_states/ss_coreprstates.cpp Tue May 11 17:20:19 2010 +0300
@@ -1333,28 +1333,42 @@
EXPORT_DEFINE_SMELEMENT(TAwaitingStarted, NetStateMachine::MState, CoreNetStates::TContext)
EXPORT_C TBool TAwaitingStarted::Accept()
- {
+ {
if (iContext.iMessage.IsMessage<TCFServiceProvider::TStarted>())
{
- if (iContext.iPeer)
- {
- iContext.iPeer->ClearFlags(TCFClientType::EStarting);
- iContext.iPeer->SetFlags(TCFClientType::EStarted);
- }
- return ETrue;
+ if (iContext.iPeer)
+ {
+ iContext.iPeer->ClearFlags(TCFClientType::EStarting);
+ iContext.iPeer->SetFlags(TCFClientType::EStarted);
+ }
+ if (iContext.iNodeActivity)
+ {//The node has responded. Core providers doesn't support the notion of multiple service providers,
+ //therefore this code has been written to expect that TCFServiceProvider::TStart would only ever be
+ //sent to one service provider as a simple request<>response handshake. The client has now responded
+ //and its job is now done. ClearPostedTo so that TCancels aren't forwarded.
+ iContext.iNodeActivity->ClearPostedTo();
+ }
+ return ETrue;
}
- //If this is TError, clean the EStarting flag but do not accept, clean or otherwise process
- if (iContext.iMessage.IsMessage<TEBase::TError>())
- {
- if (iContext.iPeer)
- {
- iContext.iPeer->ClearFlags(TCFClientType::EStarting);
- }
- }
+ //If this is TError, clean the EStarting flag but do not accept, clean or otherwise process
+ if (iContext.iMessage.IsMessage<TEBase::TError>())
+ {
+ if (iContext.iPeer)
+ {
+ iContext.iPeer->ClearFlags(TCFClientType::EStarting);
+ }
+ if (iContext.iNodeActivity)
+ {//The node has responded. Core providers doesn't support the notion of multiple service providers,
+ //therefore this code has been written to expect that TCFServiceProvider::TStart would only ever be
+ //sent to one service provider as a simple request<>response handshake. The client has now responded
+ //and its job is now done. ClearPostedTo so that TCancels aren't forwarded.
+ iContext.iNodeActivity->ClearPostedTo();
+ }
+ }
- return EFalse;
- }
+ return EFalse;
+ }
EXPORT_DEFINE_SMELEMENT(TSendBindToComplete, NetStateMachine::MStateTransition, CoreNetStates::TContext)
EXPORT_C void TSendBindToComplete::DoL()
@@ -1891,7 +1905,16 @@
EXPORT_DEFINE_SMELEMENT(TForwardStateChange, NetStateMachine::MStateTransition, PRStates::TContext)
EXPORT_C void TForwardStateChange::DoL()
{
- //Forward to control clients if there are any
+ //In some cirumstances a node can have more than one TCFClientType::EServProvider peer (for instance MCPRs can have more than one potential service provider),
+ //but within the coreprovider code there is no concept of multiple service providers per-se. There is only one service provider and it is the TCFClientType::EServProvider
+ //with TCFClientType::EActive flag set. If a progress comes from a TCFClientType::EServProvider that is not a service provider, the progress will be ignored here.
+
+ if (iContext.iPeer &&
+ iContext.iPeer->Type() == TCFClientType::EServProvider &&
+ !(iContext.iPeer->Flags() & TCFClientType::EActive) )
+ {
+ return;
+ }
TInt ctrlClientCount = iContext.Node().PostToClients<TDefaultClientMatchPolicy>(TNodeCtxId(iContext.ActivityId(), iContext.NodeId()), iContext.iMessage, TClientType(TCFClientType::ECtrl));
if (0==ctrlClientCount)
{ //If there are no control clients any more, forward to the control provider
--- a/datacommsserver/esockserver/eabi/esocksvrU.DEF Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/eabi/esocksvrU.DEF Tue May 11 17:20:19 2010 +0300
@@ -1712,7 +1712,7 @@
_ZN13CoreNetStates15TAwaitingBindTo6AcceptEv @ 1711 NONAME
_ZN13CoreNetStates15TLayerCompleted13TransitionTagEv @ 1712 NONAME ABSENT
_ZN13CoreNetStates18TAwaitingProvision6AcceptEv @ 1713 NONAME
- _ZN13CoreNetStates18TDataClientPresent13TransitionTagEv @ 1714 NONAME ABSENT
+ _ZN12PRActivities20CCommsBinderActivity6CancelERN11MeshMachine16TNodeContextBaseE @ 1714 NONAME
_ZN13CoreNetStates21TNoTagOrNoDataClients13TransitionTagEv @ 1715 NONAME
_ZN13CoreNetStates25TNoTagOrDataClientPresent13TransitionTagEv @ 1716 NONAME
_ZN13CoreNetStates25TNoTagOrDataClientsToStop13TransitionTagEv @ 1717 NONAME
--- a/datacommsserver/esockserver/ssock/ss_sapshim.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/ssock/ss_sapshim.cpp Tue May 11 17:20:19 2010 +0300
@@ -1369,6 +1369,17 @@
{
iHostResolverNotify->Error(KErrDisconnected);
}
+ else
+ if (iFlowParams.iFlowRequestType == TFlowParams::EExplicitConnection)
+ {
+ // Re-issue explicit host resolver requests here rather than later on in StartFlowL(). This is
+ // to accomodate the HotSpot server and Internet Connectivity Test (ICT). The ICT hooks into the
+ // NetCfgExtensionBase mechanism, blocks the interface startup at 8400 and performs a host resolver
+ // request. However, the TransportFlowShim will only receive StartFlowL() after the interface has
+ // fully come up, so chicken and egg. Implicit host resolver requests must still be re-issued in
+ // StartFlowL().
+ iHostResolverNotify->StartSending();
+ }
}
}
@@ -1409,8 +1420,9 @@
SetStarted();
ClearStopped();
- // A held-over resolution request will now work (if it ever will)
- if (iHostResolverNotify)
+ // A held-over implicit resolution request will now work (if it ever will).
+ // Explicit host resolver requests have already been re-issued in BindToL().
+ if (iHostResolverNotify && (iFlowParams.iFlowRequestType != TFlowParams::EExplicitConnection))
{
iHostResolverNotify->StartSending();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/configs/te_dummyprovider_006.ini Tue May 11 17:20:19 2010 +0300
@@ -0,0 +1,28 @@
+[CreateSockSvr1]
+SocketServName=SockSvr1
+
+[CreateConn1]
+ConnName=Conn1
+
+[ConnectSockSvr1]
+SocketServName=SockSvr1
+
+[OpenConn1]
+ConnName=Conn1
+SocketServName=SockSvr1
+ConnType=271069227
+
+[StartConn1]
+ConnName=Conn1
+SocketServName=SockSvr0
+SNAP=60
+
+[StopConn1]
+ConnName=Conn1
+ConnStopType=EStopNormal
+
+[CloseConn1]
+ConnName=Conn1
+
+[CloseSockSvr1]
+SocketServName=SockSvr1
\ No newline at end of file
--- a/datacommsserver/esockserver/test/TE_DummyProvider/configs/te_dummyproviders.cfg Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/configs/te_dummyproviders.cfg Tue May 11 17:20:19 2010 +0300
@@ -108,6 +108,33 @@
FIELD_COUNT=8
END_ADD
## CASE005 END ##
+#############################################################
+## CASE006 BEGIN ##
+ADD_SECTION
+# COMMDB_ID = 7
+ Id=60
+ Name=DummyVanillaWithNextVanillaLayer
+ Tier=Link.TierTable.0x1028302B
+ MCpr=MCprTable.1
+ AccessPointSelectionPolicy=Link.APPrioritySelectionPolicyTable.4
+ Cpr=CprTable.2
+ SCpr=SCprTable.2
+ Protocol=ProtocolTable.1
+ FIELD_COUNT=8
+END_ADD
+
+ADD_SECTION
+# COMMDB_ID = 8
+ Id=61
+ Name=DummyVanillaWithNoNextLayer
+ Tier=Link.TierTable.0x1028302B
+ MCpr=MCprTable.1
+ Cpr=CprTable.2
+ SCpr=SCprTable.2
+ Protocol=ProtocolTable.1
+ FIELD_COUNT=7
+END_ADD
+## CASE005 END ##
############################################################
## APPrioritySelectionPolicyTable
@@ -115,7 +142,7 @@
[APPrioritySelectionPolicyTable]
ADD_SECTION
# COMMDB_ID = 1
- Id=1
+ Id=1
Name=SelectionPolicyCase001
AP1=Link.AccessPointTable.11
APCOUNT=1
@@ -124,7 +151,7 @@
ADD_SECTION
# COMMDB_ID = 2
- Id=2
+ Id=2
Name=SelectionPolicyCase002
AP1=Link.AccessPointTable.21
APCOUNT=1
@@ -133,7 +160,7 @@
ADD_SECTION
# COMMDB_ID = 3
- Id=3
+ Id=3
Name=SelectionPolicyCase003
AP1=Link.AccessPointTable.21
AP2=Link.AccessPointTable.11
@@ -141,6 +168,15 @@
FIELD_COUNT=5
END_ADD
+ADD_SECTION
+# COMMDB_ID = 4
+ Id=4
+ Name=SelectionPolicyCase002
+ AP1=Link.AccessPointTable.61
+ APCOUNT=1
+ FIELD_COUNT=4
+END_ADD
+
############################################################
## TierTable
@@ -173,6 +209,9 @@
############################################################
## CprTable
##
+# The cpr below is:
+# The corecpr with some of its activities overriden in order to test the production code executed by the
+# peers of the cpr. See code.
[CprTable]
ADD_SECTION
# COMMDB_ID = 1
@@ -181,10 +220,23 @@
FIELD_COUNT=2
END_ADD
+# The cpr below is:
+# The corecpr with local test activities designed to test the production code on the local node.
+# It is important than that the production code (to be tested) is unpolluted by the test code.
+ADD_SECTION
+# COMMDB_ID = 2
+ Name=dummyvanillacpr
+ CprUid=0x10283030
+ FIELD_COUNT=2
+END_ADD
+
############################################################
## SCprTable
##
[SCprTable]
+# The scpr below is:
+# The corescpr with some of its activities overriden in order to test the production code executed by the
+# peers of the scpr. See code.
ADD_SECTION
# COMMDB_ID = 1
Name=dummyscpr
@@ -192,6 +244,16 @@
FIELD_COUNT=2
END_ADD
+# The scpr below is:
+# The corescpr with local test activities designed to test the production code on the local node.
+# It is important than that the production code (to be tested) is unpolluted by the test code.
+ADD_SECTION
+# COMMDB_ID = 2
+ Name=dummyscprvanilla
+ SCprUid=0x10283031
+ FIELD_COUNT=2
+END_ADD
+
############################################################
## ProtocolTable
##
--- a/datacommsserver/esockserver/test/TE_DummyProvider/group/TE_DummyProvider.iby Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/group/TE_DummyProvider.iby Tue May 11 17:20:19 2010 +0300
@@ -26,6 +26,7 @@
data=EPOCROOT##epoc32\data\z\TestData\scripts\te_dummyprovider_003.script TestData\scripts\te_dummyprovider_003.script
data=EPOCROOT##epoc32\data\z\TestData\scripts\te_dummyprovider_004.script TestData\scripts\te_dummyprovider_004.script
data=EPOCROOT##epoc32\data\z\TestData\scripts\te_dummyprovider_005.script TestData\scripts\te_dummyprovider_005.script
+data=EPOCROOT##epoc32\data\z\TestData\scripts\te_dummyprovider_006.script TestData\scripts\te_dummyprovider_006.script
data=EPOCROOT##epoc32\data\z\TestData\scripts\te_dummyprovider_incomingSCPR.script TestData\scripts\te_dummyprovider_incomingSCPR.script
data=EPOCROOT##epoc32\data\z\TestData\configs\te_dummyproviders.cfg TestData\configs\te_dummyproviders.cfg
@@ -34,6 +35,7 @@
data=EPOCROOT##epoc32\data\z\TestData\configs\te_dummyprovider_003.ini TestData\configs\te_dummyprovider_003.ini
data=EPOCROOT##epoc32\data\z\TestData\configs\te_dummyprovider_004.ini TestData\configs\te_dummyprovider_004.ini
data=EPOCROOT##epoc32\data\z\TestData\configs\te_dummyprovider_005.ini TestData\configs\te_dummyprovider_005.ini
+data=EPOCROOT##epoc32\data\z\TestData\configs\te_dummyprovider_006.ini TestData\configs\te_dummyprovider_006.ini
#endif // __TE_DummyProviders_IBY__
--- a/datacommsserver/esockserver/test/TE_DummyProvider/group/bld.inf Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/group/bld.inf Tue May 11 17:20:19 2010 +0300
@@ -27,6 +27,7 @@
../scripts/te_dummyprovider_003.script z:/testdata/scripts/te_dummyprovider_003.script
../scripts/te_dummyprovider_004.script z:/testdata/scripts/te_dummyprovider_004.script
../scripts/te_dummyprovider_005.script z:/testdata/scripts/te_dummyprovider_005.script
+../scripts/te_dummyprovider_006.script z:/testdata/scripts/te_dummyprovider_006.script
../scripts/te_dummyprovider_incomingSCPR.script z:/testdata/scripts/te_dummyprovider_incomingSCPR.script
../configs/te_dummyproviders.cfg z:/testdata/configs/te_dummyproviders.cfg
@@ -35,4 +36,5 @@
../configs/te_dummyprovider_003.ini z:/testdata/configs/te_dummyprovider_003.ini
../configs/te_dummyprovider_004.ini z:/testdata/configs/te_dummyprovider_004.ini
../configs/te_dummyprovider_005.ini z:/testdata/configs/te_dummyprovider_005.ini
+../configs/te_dummyprovider_006.ini z:/testdata/configs/te_dummyprovider_006.ini
--- a/datacommsserver/esockserver/test/TE_DummyProvider/scripts/te_dummyprovider.script Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/scripts/te_dummyprovider.script Tue May 11 17:20:19 2010 +0300
@@ -31,6 +31,7 @@
RUN_SCRIPT z:\testdata\scripts\te_dummyprovider_003.script
RUN_SCRIPT z:\testdata\scripts\te_dummyprovider_004.script
RUN_SCRIPT z:\testdata\scripts\te_dummyprovider_005.script
+RUN_SCRIPT z:\testdata\scripts\te_dummyprovider_006.script
RUN_SCRIPT z:\testdata\scripts\te_esock_test_unloadesockForced.script
RUN_SCRIPT z:\testdata\scripts\te_esock_test_remove_config_files.script
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/datacommsserver/esockserver/test/TE_DummyProvider/scripts/te_dummyprovider_006.script Tue May 11 17:20:19 2010 +0300
@@ -0,0 +1,51 @@
+//
+// Copyright (c) 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:
+//
+
+PRINT Running CASE001
+PRINT Two dummy vanilla layers starting successfully.
+PRINT vanilla layers will test progressive cancel on a number of activities
+
+//
+LOAD_SUITE te_esockteststepsSuite -SharedData
+RUN_SCRIPT z:\TestData\scripts\te_esock_test_loadesock.script
+
+
+START_TESTCASE COMINF-ESOCK-DummyProviders-006
+//! @SYMTestCaseID COMINF-ESOCK-DummyProviders-006
+//! @SYMTestCaseDesc Tests the resiliance of the TBindTo activity to progressive TCancel.
+//! @SYMTestActions The app level starts an access point consisting of two dummy (corepr) layers. The layers (cpr and scpr) are modified to test the TBindTo activity using CancelTestBindToActivity
+//! @SYMTestExpectedResults The access point is expected to start with success. The test case assumes the layers are armed (with CancelTestBindToActivity), but will do nothin to verify that progressive cancel took place.
+//! @SYMTestPriority Critical
+//! @SYMTestType CT
+//! @SYMComponent comms-infras_esock
+
+RUN_TEST_STEP 100 te_esockteststepsSuite creatersocketservStep z:\testdata\configs\te_dummyprovider_006.ini CreateSockSvr1
+RUN_TEST_STEP 100 te_esockteststepsSuite createrconnectionStep z:\testdata\configs\te_dummyprovider_006.ini CreateConn1
+RUN_TEST_STEP 100 te_esockteststepsSuite connectrsocketservStep z:\testdata\configs\te_dummyprovider_006.ini ConnectSockSvr1
+RUN_TEST_STEP 100 te_esockteststepsSuite openrconnectionStep z:\testdata\configs\te_dummyprovider_006.ini OpenConn1
+RUN_TEST_STEP 100 te_esockteststepsSuite startrconnectionStep z:\testdata\configs\te_dummyprovider_006.ini StartConn1
+RUN_TEST_STEP 100 te_esockteststepsSuite stoprconnectionStep z:\testdata\configs\te_dummyprovider_006.ini StopConn1
+RUN_TEST_STEP 100 te_esockteststepsSuite closerconnectionStep z:\testdata\configs\te_dummyprovider_006.ini CloseConn1
+RUN_TEST_STEP 100 te_esockteststepsSuite closersocketservStep z:\testdata\configs\te_dummyprovider_006.ini CloseSockSvr1
+RUN_TEST_STEP 100 te_esockteststepsSuite cleanallStep
+END_TESTCASE COMINF-ESOCK-DummyProviders-006
+
+RUN_SCRIPT Z:\TestData\scripts\te_esock_test_unloadesockForced.script
+
+PRINT Completed CASE001
+
+END_TESTCASE COMINF-ESOCK-DummyProviders-006
+
--- a/datacommsserver/esockserver/test/TE_EsockTestSteps/src/Connections.TestSteps.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_EsockTestSteps/src/Connections.TestSteps.cpp Tue May 11 17:20:19 2010 +0300
@@ -952,8 +952,12 @@
}
TPtrC eventName;
-
- if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
+ TInt event;
+ if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
+ {
+ iParams.iEventMask = event;
+ }
+ else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
{
if (eventName.Compare(KTe_LinkLayerOpen)==0)
{ iParams.iEventMask = KLinkLayerOpen; }
@@ -1009,8 +1013,12 @@
return KErrNotFound;
TPtrC eventName;
-
- if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
+ TInt event;
+ if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
+ {
+ iParams.iEventMask = event;
+ }
+ else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
{
if (eventName.Compare(KTe_LinkLayerOpen)==0)
{ iParams.iEventMask = KLinkLayerOpen; }
@@ -1111,24 +1119,28 @@
return KErrNotFound;
TPtrC eventName;
-
- if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
- {
- if (eventName.Compare(KTe_LinkLayerOpen)==0)
- { iParams.iEventMask = KLinkLayerOpen; }
- else if (eventName.Compare(KTe_LinkLayerClosed)==0)
- { iParams.iEventMask = KLinkLayerClosed; }
- else
- {
- INFO_PRINTF3(_L("%S: Event type (%S) not recognised."),&iParams.iEventName,&eventName);
- return KErrNotFound;
- }
- }
- else
- {
- INFO_PRINTF1(_L("Event type missing."));
- return KErrNotFound;
- }
+ TInt event;
+ if (GetIntFromConfig(iSection,KTe_SelectedProgress, event)==1)
+ {
+ iParams.iEventMask = event;
+ }
+ else if (GetStringFromConfig(iSection,KTe_SelectedProgress,eventName)==1)
+ {
+ if (eventName.Compare(KTe_LinkLayerOpen)==0)
+ { iParams.iEventMask = KLinkLayerOpen; }
+ else if (eventName.Compare(KTe_LinkLayerClosed)==0)
+ { iParams.iEventMask = KLinkLayerClosed; }
+ else
+ {
+ INFO_PRINTF3(_L("%S: Event type (%S) not recognised."),&iParams.iEventName,&eventName);
+ return KErrNotFound;
+ }
+ }
+ else
+ {
+ INFO_PRINTF1(_L("Event type missing."));
+ return KErrNotFound;
+ }
if (!GetIntFromConfig(iSection, KExpectedError, iExpectedError))
{
@@ -1157,18 +1169,17 @@
TNifProgress* event = NULL;
TInt err = iEsockTest->ReceiveProgressNotificationEvent(event, iParams.iEventName, iParams.iTimeoutMiliSecs);
- if (event == NULL || err == KErrNone)
+ if (event == NULL && err == KErrNone)
{
INFO_PRINTF2(_L("%S: Did not receive any event."),&iParams.iEventName);
-
return EPass;
}
- else if (event == NULL || err != KErrNone)
- {
- INFO_PRINTF2(_L("%S: Did not receive any event but error condiction detected !"),&iParams.iEventName);
- INFO_PRINTF2(_L("The error code returned was %d."),err);
- return EFail;
- }
+ else if (event == NULL || err != KErrNone)
+ {
+ INFO_PRINTF2(_L("%S: Did not receive any event but error condiction detected !"),&iParams.iEventName);
+ INFO_PRINTF2(_L("The error code returned was %d."),err);
+ return EFail;
+ }
TInt eventId = event->iStage;
--- a/datacommsserver/esockserver/test/TE_EsockTestSteps/src/EsockTestBase.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_EsockTestSteps/src/EsockTestBase.cpp Tue May 11 17:20:19 2010 +0300
@@ -1483,7 +1483,7 @@
User::WaitForRequest(ec->iEventReceived);
}
aNifProgress = (ec->iEventReceived.Int()==KErrNone)? &ec->iProgressBuf() : NULL;
- return ec->iEventReceived.Int();
+ return ec->iEventReceived.Int() == KRequestPending ? KErrNone : ec->iEventReceived.Int();
}
--- a/datacommsserver/esockserver/test/TE_RConnection/configs/Mobility/Mobility_760640.ini Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_RConnection/configs/Mobility/Mobility_760640.ini Tue May 11 17:20:19 2010 +0300
@@ -44,6 +44,16 @@
Expected0NewAP=5
Expected0OldAP=4
+[ProgressNotificationEvent1]
+ConnEventsName=Conn1Events
+ConnName=Conn1
+SelectedProgress=4500
+
+[CheckNegativeProgressNotificationEvent1]
+ConnEventsName=Conn1Events
+SelectedProgress=4500
+TimeoutInMilliSeconds=11000
+
[MigrateToPreferredCarrier]
MobilityExtName=MobExt1
--- a/datacommsserver/esockserver/test/TE_RConnection/scripts/Mobility/Mobility_760640.script Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/TE_RConnection/scripts/Mobility/Mobility_760640.script Tue May 11 17:20:19 2010 +0300
@@ -24,6 +24,7 @@
PRINT Receive PreferredCarierAvailable
PRINT Do not register (no call to RCommsMobilityApiExt::RegisterForMobilityNotification()),
PRINT RCommsMobilityApiExt::MigrateToPreferredCarrier(),
+PRINT Check to see if the progresses from the abanonded AP don't perculate to the app.
PRINT RCommsMobilityApiExt::Close()
// Load the test suite
@@ -75,6 +76,11 @@
//Migrate to preferred carrier
RUN_TEST_STEP 150 te_esockteststepsSuite migratercommsmobilityapiextStep z:\testdata\configs\BearerMobility\Mobility_760640.ini MigrateToPreferredCarrier
+//Check absence of progress from the abandoned IAP4
+RUN_TEST_STEP 100 te_esockteststepsSuite RegisterProgressNotificationStep z:\testdata\configs\BearerMobility\Mobility_760640.ini ProgressNotificationEvent1
+RUN_TEST_STEP 100 te_esockteststepsSuite CheckNegativeProgressNotificationStep z:\testdata\configs\BearerMobility\Mobility_760640.ini CheckNegativeProgressNotificationEvent1
+
+
// Clean up what we used
RUN_TEST_STEP 150 te_esockteststepsSuite CloseRCommsMobilityAPIExtStep z:\testdata\configs\BearerMobility\Mobility_760640.ini CloseMobilityExtension
RUN_TEST_STEP 150 te_esockteststepsSuite CloseRConnectionStep z:\testdata\configs\BearerMobility\Mobility_760640.ini CloseConn
--- a/datacommsserver/esockserver/test/providers/dummy/group/dummypr.mmp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/group/dummypr.mmp Tue May 11 17:20:19 2010 +0300
@@ -35,7 +35,8 @@
SOURCE dummypr_mcprpubsubsubscriber.cpp
SOURCE dummypr_metaconnprov.cpp
SOURCE dummypr_tiermanager.cpp
-SOURCE dummypr_network_flow.cpp
+SOURCE dummypr_network_flow.cpp
+SOURCE activityTest.cpp
USERINCLUDE ../inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/datacommsserver/esockserver/test/providers/dummy/inc/activitytest.h Tue May 11 17:20:19 2010 +0300
@@ -0,0 +1,142 @@
+// Copyright (c) 2006-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
+ @internalTechnology
+*/
+
+#include <elements/mm_states.h>
+#include <ss_internal_activities.h>
+
+#ifndef SYMBIAN_ACTIVITYTEST
+#define SYMBIAN_ACTIVITYTEST
+
+namespace CancelTestBindToActivity
+ {
+ DECLARE_NODEACTIVITY(CancelBindTo)
+ }
+
+class CActivityCancelTest : public MeshMachine::CNodeRetryActivity
+
+/**
+@internalTechnology
+*/
+ {
+public:
+ //TODO
+ enum {ECancelTestActivity = ESock::ECFActivityBuildStack };
+ static MeshMachine::CNodeActivityBase* NewL(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode)
+ {
+ CActivityCancelTest* self = new (ELeave) CActivityCancelTest(aActivitySig, aNode);
+ return self;
+ }
+
+ class TProgressiveMutex
+ {
+ public:
+ static TBool IsBlocked(MeshMachine::TNodeContextBase& aContext)
+ {
+ return static_cast<CActivityCancelTest&>(*aContext.iNodeActivity).ProgressiveMutex();
+ }
+ };
+
+ void NextLoop()
+ {
+ iMaxLoopCount++;
+ iCurrentLoopCount = 0;
+ }
+
+ TBool ProgressiveMutex()
+ {
+ return ++iCurrentLoopCount <= iMaxLoopCount;
+ }
+
+protected:
+ CActivityCancelTest(const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode)
+ : CNodeRetryActivity(aActivitySig, aNode)
+ {
+ }
+
+ void StoreRequestL(const Messages::TSignatureBase& aRequest);
+ const Messages::TSignatureBase& StoredRequest()
+ {
+ return *reinterpret_cast<const Messages::TSignatureBase*>(iStoredRequest.Ptr());
+ }
+
+
+private:
+ TBuf8<__Align8(Messages::TSignalBase::KMaxInlineMessageSize + Messages::TSignalBase::KMaxUnstoredOverhead)> iStoredRequest;
+ TInt iMaxLoopCount;
+ TInt iCurrentLoopCount;
+
+public:
+ typedef MeshMachine::TContext TContext;
+
+ template<typename TMESSAGE>
+ class TAwaitingMessageState : public MeshMachine::TState<TContext>
+ {
+ public:
+ NETSM_TPL_DECLARE_CTR(TAwaitingMessageState, NetStateMachine::MState, TContext)
+
+ explicit TAwaitingMessageState(TContext& aContext) :
+ MeshMachine::TState<TContext>(aContext) {}
+
+ virtual TBool Accept()
+ {
+ #ifdef __GCCXML__
+ return EFalse;
+ #else
+ if (Messages::address_cast<const Messages::TNodeCtxId>(iContext.iSender).NodeCtx() != CActivityCancelTest::ECancelTestActivity)
+ {
+ Messages::TNodeSignal& msg = this->iContext.iMessage; //Arm compiler is getting confused otherwise
+ return msg.IsMessage<TMESSAGE>();
+ }
+ #endif
+ return EFalse;
+ }
+ };
+
+ DECLARE_SMELEMENT_HEADER( TNoTagForwardOrActiveTagBackward, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, TContext )
+ virtual TInt TransitionTag();
+ DECLARE_SMELEMENT_FOOTER( TNoTagForwardOrActiveTagBackward )
+
+ DECLARE_SMELEMENT_HEADER( TBeginTest, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext )
+ virtual void DoL();
+ DECLARE_SMELEMENT_FOOTER( TBeginTest )
+
+ DECLARE_SMELEMENT_HEADER( TBeginLoop, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext )
+ virtual void DoL();
+ DECLARE_SMELEMENT_FOOTER( TBeginLoop )
+
+ DECLARE_SMELEMENT_HEADER( TCancel, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext )
+ virtual void DoL();
+ DECLARE_SMELEMENT_FOOTER( TCancel )
+
+ DECLARE_SMELEMENT_HEADER( TEndTest, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext )
+ virtual void DoL();
+ DECLARE_SMELEMENT_FOOTER( TEndTest )
+
+ DECLARE_SERIALIZABLE_TRANSITION(
+ TProgressiveCancel,
+ TProgressiveMutex,
+ TCancel
+ )
+ };
+
+
+#endif //SYMBIAN_ACTIVITYTEST
+
+
--- a/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_connprov.h Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_connprov.h Tue May 11 17:20:19 2010 +0300
@@ -59,7 +59,10 @@
};
static CDummyConnectionProvider* NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus);
- CDummyConnectionProvider(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus);
+ static CDummyConnectionProvider* NewVanillaL(ESock::CConnectionProviderFactoryBase& aFactory);
+
+ CDummyConnectionProvider(ESock::CConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap, TConnType aConnStatus);
+
public:
TConnType iConnStatus;
};
--- a/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_factory.h Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_factory.h Tue May 11 17:20:19 2010 +0300
@@ -30,6 +30,9 @@
#include <comms-infras/ss_connprov.h>
#include <comms-infras/ss_tiermanager.h>
#include <comms-infras/ss_nodemessages.h>
+
+using namespace ESock;
+
//-=========================================================
//
// CDummyTierManagerFactory
@@ -88,6 +91,17 @@
CDummyHangingConnectionProviderFactory(TUid aFactoryId, ESock::CConnectionFactoryContainer& aParentContainer);
virtual ESock::ACommsFactoryNodeId* DoCreateObjectL(ESock::TFactoryQueryBase& aQuery);
};
+
+class CDummyVanillaConnectionProviderFactory : public ESock::CConnectionProviderFactoryBase
+ {
+public:
+ enum { iUid = 0x10283030 };
+ static CDummyVanillaConnectionProviderFactory* NewL(TAny* aParentContainer);
+
+protected:
+ CDummyVanillaConnectionProviderFactory(TUid aFactoryId, ESock::CConnectionFactoryContainer& aParentContainer);
+ virtual ESock::ACommsFactoryNodeId* DoCreateObjectL(ESock::TFactoryQueryBase& aQuery);
+ };
//-=========================================================
//
@@ -111,8 +125,6 @@
// CDummyExtendedSubConnectionProviderFactory
//
//-=========================================================
-namespace ESock
-{
class CDummyExtendedSubConnectionProviderFactory : public ESock::CSubConnectionProviderFactoryBase
{
public:
@@ -123,15 +135,31 @@
CDummyExtendedSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer);
virtual ESock::ACommsFactoryNodeId* DoCreateObjectL(ESock::TFactoryQueryBase& aQuery);
};
-}
+
+
+//-=========================================================
+//
+// CDummyVanillaSubConnectionProviderFactory
+//
+//-=========================================================
+class CDummyVanillaSubConnectionProviderFactory : public ESock::CSubConnectionProviderFactoryBase
+ {
+public:
+ enum { iUid = 0x10283031 };
+ static CDummyVanillaSubConnectionProviderFactory* NewL(TAny* aParentContainer);
+
+protected:
+ CDummyVanillaSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer);
+ virtual ESock::ACommsFactoryNodeId* DoCreateObjectL(ESock::TFactoryQueryBase& aQuery);
+ };
+
+
//-=========================================================
//
// CDummyNetworkFlowFactory
//
//-=========================================================
-namespace ESock
-{
class CDummyNetworkFlowFactory : public ESock::CSubConnectionFlowFactoryBase
{
public:
@@ -147,7 +175,6 @@
virtual ESock::ACommsFactoryNodeId* DoFindOrCreateObjectL(ESock::TFactoryQueryBase& aQuery);
virtual TServerProtocolDesc* DoCreateFlowDescriptionL(TInt aProtocol);
};
-}
#endif // __DummyPR_FACTORY_H__
--- a/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_subconnprov.h Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/inc/dummypr_subconnprov.h Tue May 11 17:20:19 2010 +0300
@@ -30,6 +30,7 @@
#include <comms-infras/ss_corepractivities.h>
class CDummySubConnectionProviderFactory;
+class CDummyVanillaSubConnectionProviderFactory;
//-================================================
//
@@ -49,24 +50,22 @@
}
-namespace ESock
-{
- /* We have to have CDummySubConnectionProvider inside the ESock namespace so it can befriend
- mcfnode_cast - GCC simply doesn't allow befriending something in another template. See
- http://gcc.gnu.org/ml/gcc-prs/2002-10/msg01010.html for Herb Sutter's GOTW column on exactly
- this - it contains this discouraging summary:
+
+/* We have to have CDummySubConnectionProvider inside the ESock namespace so it can befriend
+mcfnode_cast - GCC simply doesn't allow befriending something in another template. See
+http://gcc.gnu.org/ml/gcc-prs/2002-10/msg01010.html for Herb Sutter's GOTW column on exactly
+this - it contains this discouraging summary:
- The reason that I'm writing an article about it is because, alas,
- befriending a template in another namespace is easier said than done:
-
- - The Bad News: There are two perfectly good standards-conforming
- ways to do it, and neither one works on all current compilers.
+The reason that I'm writing an article about it is because, alas,
+befriending a template in another namespace is easier said than done:
- - The Good News: One of the perfectly good standards-conforming ways
- does work on every current compiler I tried except for gcc.
+- The Bad News: There are two perfectly good standards-conforming
+ ways to do it, and neither one works on all current compilers.
- So, since it's only test code & we need it building on GCC, I've hacked around it */
+- The Good News: One of the perfectly good standards-conforming ways
+ does work on every current compiler I tried except for gcc.
+So, since it's only test code & we need it building on GCC, I've hacked around it */
class CDummySubConnectionProvider : public CCoreSubConnectionProvider
/**
@@ -85,7 +84,8 @@
friend CDummySubConnectionProvider* Messages::mnode_cast<CDummySubConnectionProvider>(ANode* aNode);
friend CDummySubConnectionProvider& Messages::mnode_cast<CDummySubConnectionProvider>(ANode& aNode);
#endif
- friend class ::CDummySubConnectionProviderFactory;
+ friend class CDummySubConnectionProviderFactory;
+ friend class CDummyVanillaSubConnectionProviderFactory;
friend class DummySCPRStates::TRaiseGranted;
public:
@@ -94,11 +94,15 @@
protected:
static CDummySubConnectionProvider* NewL(ESock::CSubConnectionProviderFactoryBase& aFactory);
- CDummySubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory);
+ static CDummySubConnectionProvider* NewVanillaL(ESock::CSubConnectionProviderFactoryBase& aFactory);
+
+ CDummySubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap);
private:
TBool incomingStatus;
};
+
+
class CDummyExtendedSubConnectionProvider : public CCoreSubConnectionProvider
/**
This dummy is intended to create flow shim based layer beneath it during its own creation
@@ -134,13 +138,13 @@
private:
TBool incomingStatus;
- TFlowParams iFlowParams;
+ ESock::TFlowParams iFlowParams;
};
-}
+
namespace DummySCPRStates
{
-typedef MeshMachine::TNodeContext<ESock::CDummySubConnectionProvider, SCprStates::TContext> TContext;
+typedef MeshMachine::TNodeContext<CDummySubConnectionProvider, SCprStates::TContext> TContext;
DECLARE_SMELEMENT_HEADER( TRaiseGranted, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, DummySCPRStates::TContext )
virtual void DoL();
@@ -159,7 +163,7 @@
namespace DummyExtendedSCPRStates
{
-typedef MeshMachine::TNodeContext<ESock::CDummyExtendedSubConnectionProvider, SCprStates::TContext> TContext;
+typedef MeshMachine::TNodeContext<CDummyExtendedSubConnectionProvider, SCprStates::TContext> TContext;
DECLARE_SMELEMENT_HEADER( TAwaitingBinderResponse, MeshMachine::TState<TContext>, NetStateMachine::MState, TContext )
virtual TBool Accept();
@@ -219,7 +223,7 @@
}
iFlowParameters.Open(aFlowParameters);
}
- typedef MeshMachine::TNodeContext<ESock::CDummyExtendedSubConnectionProvider, SCprStates::TContext> TContext;
+ typedef MeshMachine::TNodeContext<CDummyExtendedSubConnectionProvider, SCprStates::TContext> TContext;
static MeshMachine::CNodeActivityBase* CDummyBuildStackActivity::NewL( const MeshMachine::TNodeActivity& aActivitySig, MeshMachine::AMMNodeBase& aNode );
--- a/datacommsserver/esockserver/test/providers/dummy/src/1028302A.rss Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/src/1028302A.rss Tue May 11 17:20:19 2010 +0300
@@ -89,6 +89,21 @@
},
INTERFACE_INFO
{
+ interface_uid = 0x102070EE;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x10283030;
+ version_no = 1;
+ display_name = "Dummy Vanilla Connection Provider Factory";
+ default_data = "DummyVanillaConnectionProviderFactory";
+ opaque_data = "";
+ }
+ };
+ },
+ INTERFACE_INFO
+ {
interface_uid = 0x10204301;
implementations =
{
@@ -116,7 +131,22 @@
opaque_data = "";
}
};
- },
+ },
+ INTERFACE_INFO
+ {
+ interface_uid = 0x10204301;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x10283031;
+ version_no = 1;
+ display_name = "Dummy Vanilla SCPR Factory";
+ default_data = "DummyVanillaSCPRFactory";
+ opaque_data = "";
+ }
+ };
+ },
INTERFACE_INFO
{
interface_uid = 0x10281C33;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/datacommsserver/esockserver/test/providers/dummy/src/activitytest.cpp Tue May 11 17:20:19 2010 +0300
@@ -0,0 +1,121 @@
+// 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:
+// TestDummy implementation file for a TierManager
+//
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include <elements/nm_messages_base.h>
+#include <comms-infras/ss_nodemessages_dataclient.h>
+#include <ss_glob.h>
+#include "activityTest.h"
+
+using namespace Messages;
+using namespace MeshMachine;
+using namespace ESock;
+
+void CActivityCancelTest::StoreRequestL(const TSignatureBase& aRequest)
+ {
+ TBuf8<__Align8(TSignalBase::KMaxInlineMessageSize + TSignalBase::KMaxUnstoredOverhead)> msgBuf;
+ aRequest.Store(msgBuf);
+ TPtrC8 messageStore(msgBuf);
+ TlsGlobals::Get().VirtualCtor()->New(messageStore, iStoredRequest);
+ }
+
+
+DEFINE_SMELEMENT(CActivityCancelTest::TNoTagForwardOrActiveTagBackward, NetStateMachine::MStateFork, TContext)
+TInt CActivityCancelTest::TNoTagForwardOrActiveTagBackward::TransitionTag()
+ {
+ if (message_cast<TEBase::TError>(&iContext.iMessage))
+ {
+ return KActiveTag | NetStateMachine::EBackward;
+ }
+ return KNoTag | NetStateMachine::EForward;
+ }
+
+DEFINE_SMELEMENT(CActivityCancelTest::TBeginTest, NetStateMachine::MStateTransition, TContext)
+void CActivityCancelTest::TBeginTest::DoL()
+ {
+ ASSERT(iContext.iNodeActivity);
+ CActivityCancelTest& act = static_cast<CActivityCancelTest&>(*iContext.iNodeActivity);
+ act.StoreRequestL(iContext.iMessage);
+ }
+
+DEFINE_SMELEMENT(CActivityCancelTest::TBeginLoop, NetStateMachine::MStateTransition, TContext)
+void CActivityCancelTest::TBeginLoop::DoL()
+ {
+ ASSERT(iContext.iNodeActivity);
+ CActivityCancelTest& act = static_cast<CActivityCancelTest&>(*iContext.iNodeActivity);
+ act.PostRequestTo(iContext.Node().Id(), act.StoredRequest());
+ act.NextLoop();
+ }
+
+
+DEFINE_SMELEMENT(CActivityCancelTest::TCancel, NetStateMachine::MStateTransition, TContext)
+void CActivityCancelTest::TCancel::DoL()
+ {
+ ASSERT(iContext.iNodeActivity);
+ CActivityCancelTest& act = static_cast<CActivityCancelTest&>(*iContext.iNodeActivity);
+ act.PostRequestTo(iContext.Node().Id(), TEBase::TCancel());
+ }
+
+DEFINE_SMELEMENT(CActivityCancelTest::TEndTest, NetStateMachine::MStateTransition, TContext)
+void CActivityCancelTest::TEndTest::DoL()
+ {
+ ASSERT(iContext.iNodeActivity);
+ CActivityCancelTest& act = static_cast<CActivityCancelTest&>(*iContext.iNodeActivity);
+ act.PostToOriginators(iContext.iMessage);
+ ASSERT(act.Error() != KErrNone); //if the activity has done its job, the activity have been invariably errored;
+ act.SetError(KErrNone); //No point reporting this error though.
+ }
+
+
+namespace CancelTestBindToActivity
+{
+/* This is a largely generic activity written to test cancelling behaviour of another (typically
+ * production code) activity. In this case it is put on top of and to test the TBindTo
+ * activity, by the virtue of awaiting TCFDataClient::TBindTo. In principle though it can be put on
+ * top of any other activity by awaiting for something else instead. CancelTestBindToActivity hijacks
+ * and stores the original request (in this case TCFDataClient::TBindTo). It then goes to perform a
+ * loop:
+ * {
+ * - It forwards the stored request to the overriden activity (in this case the TBindTo activity),
+ * - then follows it with a TCancel
+ * - and awaits for TError.
+ * }
+ * Each loop will send the TCancel slightly later, i.e.: at consecutive ticks triggered by messages
+ * received by the local node (and subsequently resulting in AMMNodeBase::SignalActivities).
+ * If you examine CActivityCancelTest::TProgressiveCancel you will see that it is blocked
+ * (as any other synchronised activity) against gradually increasing number of ticks. It has been
+ * pointed out that the tick resolution may be too small - i.e.: that we may want to tick the
+ * activity with every message sent within the local thread (and thus with every even that can
+ * change the state of the activity peers). This can be done by signalling CActivityCancelTest
+ * from the transport upon every dispatch (or post). This is so far not done. Instead CancelTestBindToActivity
+ * is put against every mm node performing bind to (CPR and SCPR).
+ */
+DEFINE_CUSTOM_NODEACTIVITY(CActivityCancelTest::ECancelTestActivity, CancelBindTo, TCFDataClient::TBindTo, CActivityCancelTest::NewL)
+ FIRST_NODEACTIVITY_ENTRY(CActivityCancelTest::TAwaitingMessageState<TCFDataClient::TBindTo>, MeshMachine::TNoTag)
+ THROUGH_NODEACTIVITY_ENTRY(KNoTag, CActivityCancelTest::TBeginTest, MeshMachine::TTag<KActiveTag>)
+ THROUGH_NODEACTIVITY_ENTRY(KActiveTag, CActivityCancelTest::TBeginLoop, MeshMachine::TNoTag)
+ NODEACTIVITY_ENTRY(KNoTag, CActivityCancelTest::TProgressiveCancel, MeshMachine::TAcceptErrorState<MeshMachine::TAwaitingMessageState<TCFDataClient::TBindToComplete> >, CActivityCancelTest::TNoTagForwardOrActiveTagBackward)
+ LAST_NODEACTIVITY_ENTRY(KNoTag, CActivityCancelTest::TEndTest)
+NODEACTIVITY_END()
+}
+
+
+
--- a/datacommsserver/esockserver/test/providers/dummy/src/dummypr_connprov.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/src/dummypr_connprov.cpp Tue May 11 17:20:19 2010 +0300
@@ -27,6 +27,7 @@
#include "dummypr_metaconnprov.h"
#include "dummypr_connprov.h"
#include "dummypr_subconnprov.h"
+#include "activityTest.h"
#include <elements/sd_mintercept.h>
@@ -136,7 +137,7 @@
NODEACTIVITY_END()
}
-// Activity Map
+// Activity Map For test-code ridden cpr
namespace DummyCPRStates
{
DECLARE_DEFINE_ACTIVITY_MAP(stateMap)
@@ -145,9 +146,26 @@
ACTIVITY_MAP_END_BASE(MobilityCprActivities, mobilityCprActivities)
}
+// Activity Map For vanilla cpr
+namespace VanillaDummyCPRStates
+{
+DECLARE_DEFINE_ACTIVITY_MAP(stateMap)
+ ACTIVITY_MAP_ENTRY(CancelTestBindToActivity, CancelBindTo)
+ACTIVITY_MAP_END_BASE(MobilityCprActivities, mobilityCprActivities)
+}
+
CDummyConnectionProvider* CDummyConnectionProvider::NewL(ESock::CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus)
{
- CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, aConnStatus);
+ CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, DummyCPRStates::stateMap::Self(), aConnStatus);
+ CleanupStack::PushL(self);
+ self->ConstructL(KDummyCPRPreallocatedActivityBufferSize);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDummyConnectionProvider* CDummyConnectionProvider::NewVanillaL(ESock::CConnectionProviderFactoryBase& aFactory)
+ {
+ CDummyConnectionProvider* self = new (ELeave) CDummyConnectionProvider(aFactory, VanillaDummyCPRStates::stateMap::Self(), CDummyConnectionProvider::EConnNoIncoming);
CleanupStack::PushL(self);
self->ConstructL(KDummyCPRPreallocatedActivityBufferSize);
CleanupStack::Pop(self);
@@ -155,8 +173,8 @@
}
-CDummyConnectionProvider::CDummyConnectionProvider(CConnectionProviderFactoryBase& aFactory, TConnType aConnStatus)
-: CMobilityConnectionProvider(aFactory, DummyCPRStates::stateMap::Self()),
+CDummyConnectionProvider::CDummyConnectionProvider(CConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap, TConnType aConnStatus)
+: CMobilityConnectionProvider(aFactory, aActivityMap),
TIfStaticFetcherNearestInHierarchy(this),
iConnStatus(aConnStatus)
{
@@ -189,3 +207,5 @@
+
+
--- a/datacommsserver/esockserver/test/providers/dummy/src/dummypr_factory.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/src/dummypr_factory.cpp Tue May 11 17:20:19 2010 +0300
@@ -61,8 +61,10 @@
IMPLEMENTATION_PROXY_ENTRY(CDummyTierManagerFactory::iUid, CDummyTierManagerFactory::NewL),
IMPLEMENTATION_PROXY_ENTRY(CDummyMetaConnectionProviderFactory::iUid, CDummyMetaConnectionProviderFactory::NewL),
IMPLEMENTATION_PROXY_ENTRY(CDummyConnectionProviderFactory::iUid, CDummyConnectionProviderFactory::NewL),
- IMPLEMENTATION_PROXY_ENTRY(CDummyHangingConnectionProviderFactory::iUid, CDummyHangingConnectionProviderFactory::NewL),
+ IMPLEMENTATION_PROXY_ENTRY(CDummyHangingConnectionProviderFactory::iUid, CDummyHangingConnectionProviderFactory::NewL),
+ IMPLEMENTATION_PROXY_ENTRY(CDummyVanillaConnectionProviderFactory::iUid, CDummyVanillaConnectionProviderFactory::NewL),
IMPLEMENTATION_PROXY_ENTRY(CDummySubConnectionProviderFactory::iUid, CDummySubConnectionProviderFactory::NewL),
+ IMPLEMENTATION_PROXY_ENTRY(CDummyVanillaSubConnectionProviderFactory::iUid, CDummyVanillaSubConnectionProviderFactory::NewL),
IMPLEMENTATION_PROXY_ENTRY(CDummyExtendedSubConnectionProviderFactory::iUid, CDummyExtendedSubConnectionProviderFactory::NewL),
// Flow and flow description
@@ -166,6 +168,26 @@
return provider;
}
+CDummyVanillaConnectionProviderFactory* CDummyVanillaConnectionProviderFactory::NewL(TAny* aParentContainer)
+ {
+ return new (ELeave) CDummyVanillaConnectionProviderFactory(TUid::Uid(CDummyVanillaConnectionProviderFactory::iUid), *reinterpret_cast<ESock::CConnectionFactoryContainer*>(aParentContainer));
+ }
+
+CDummyVanillaConnectionProviderFactory::CDummyVanillaConnectionProviderFactory(TUid aFactoryId, ESock::CConnectionFactoryContainer& aParentContainer)
+ : ESock::CConnectionProviderFactoryBase(aFactoryId, aParentContainer)
+ {
+ //LOG_NODE_CREATE(KDummyCPRTag, CDummyHangingConnectionProviderFactory);
+ }
+
+ACommsFactoryNodeId* CDummyVanillaConnectionProviderFactory::DoCreateObjectL(TFactoryQueryBase& /* aQuery */)
+ {
+ CConnectionProviderBase* provider = CDummyConnectionProvider::NewVanillaL(*this );
+
+ ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider);
+
+ return provider;
+ }
+
//-=========================================================
//
// CDummySubConnectionProviderFactory methods
@@ -209,8 +231,7 @@
// CDummyExtendedSubConnectionProviderFactory methods
//
//-=========================================================
-namespace ESock
-{
+
CDummyExtendedSubConnectionProviderFactory* CDummyExtendedSubConnectionProviderFactory::NewL(TAny* aParentContainer)
{
return new (ELeave) CDummyExtendedSubConnectionProviderFactory(TUid::Uid(CDummyExtendedSubConnectionProviderFactory::iUid),
@@ -230,7 +251,7 @@
if ((query.iSCPRType == RSubConnection::EAttachToDefault) || (query.iSCPRType == RSubConnection::ECreateNew))
{
- provider = ESock::CDummyExtendedSubConnectionProvider::NewL(*this);
+ provider = CDummyExtendedSubConnectionProvider::NewL(*this);
ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider);
}
else
@@ -239,15 +260,48 @@
}
return provider;
}
-}
+
+
+
+//-=========================================================
+//
+// CDummyExtendedSubConnectionProviderFactory methods
+//
+//-=========================================================
+CDummyVanillaSubConnectionProviderFactory* CDummyVanillaSubConnectionProviderFactory::NewL(TAny* aParentContainer)
+ {
+ return new (ELeave) CDummyVanillaSubConnectionProviderFactory(TUid::Uid(CDummyVanillaSubConnectionProviderFactory::iUid),
+ *reinterpret_cast<ESock::CSubConnectionFactoryContainer*>(aParentContainer));
+ }
+
+CDummyVanillaSubConnectionProviderFactory::CDummyVanillaSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer)
+ : CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer)
+ {
+ //LOG_NODE_CREATE(KDummyExtendedSCPRTag, CDummyExtendedSubConnectionProviderFactory);
+ }
+
+ACommsFactoryNodeId* CDummyVanillaSubConnectionProviderFactory::DoCreateObjectL(TFactoryQueryBase& aQuery)
+ {
+ const TDefaultSCPRFactoryQuery& query = static_cast<const TDefaultSCPRFactoryQuery&>(aQuery);
+ CSubConnectionProviderBase* provider = NULL;
+
+ if ((query.iSCPRType == RSubConnection::EAttachToDefault) || (query.iSCPRType == RSubConnection::ECreateNew))
+ {
+ provider = CDummySubConnectionProvider::NewVanillaL(*this);
+ ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider);
+ }
+ else
+ {
+ User::Leave(KErrNotSupported);
+ }
+ return provider;
+ }
//-=========================================================
//
// CDummyNetworkFlowFactory methods
//
//-=========================================================
-namespace ESock
-{
CDummyNetworkFlowFactory* CDummyNetworkFlowFactory::NewL(TAny* aConstructionParameters)
{
CDummyNetworkFlowFactory* fact = new (ELeave) CDummyNetworkFlowFactory(
@@ -357,5 +411,4 @@
return protocolDescription;
}
-}
--- a/datacommsserver/esockserver/test/providers/dummy/src/dummypr_subconnprov.cpp Tue Apr 27 17:53:34 2010 +0300
+++ b/datacommsserver/esockserver/test/providers/dummy/src/dummypr_subconnprov.cpp Tue May 11 17:20:19 2010 +0300
@@ -27,6 +27,7 @@
#include "dummypr_subconnprov.h"
#include "dummypr_metaconnprov.h"
+#include "activityTest.h"
#include <elements/sd_mintercept.h>
@@ -133,7 +134,7 @@
NODEACTIVITY_END()
}
-// Activity Map
+// Activity Map For test-code ridden scpr
namespace DummySCPRStates
{
DEFINE_ACTIVITY_MAP(stateMap)
@@ -144,9 +145,26 @@
ACTIVITY_MAP_END_BASE(SCprActivities, coreSCprActivities)
}
+// Activity Map For vanilla cpr
+namespace VanillaDummySCPRStates
+{
+DECLARE_DEFINE_ACTIVITY_MAP(stateMap)
+ ACTIVITY_MAP_ENTRY(CancelTestBindToActivity, CancelBindTo)
+ACTIVITY_MAP_END_BASE(SCprActivities, coreSCprActivities)
+}
+
CDummySubConnectionProvider* CDummySubConnectionProvider::NewL(ESock::CSubConnectionProviderFactoryBase& aFactory)
{
- CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory);
+ CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, DummySCPRStates::stateMap::Self());
+ CleanupStack::PushL(self);
+ self->ConstructL(KDummySCPRPreallocatedActivityBufferSize);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CDummySubConnectionProvider* CDummySubConnectionProvider::NewVanillaL(ESock::CSubConnectionProviderFactoryBase& aFactory)
+ {
+ CDummySubConnectionProvider* self = new (ELeave) CDummySubConnectionProvider(aFactory, VanillaDummySCPRStates::stateMap::Self());
CleanupStack::PushL(self);
self->ConstructL(KDummySCPRPreallocatedActivityBufferSize);
CleanupStack::Pop(self);
@@ -154,8 +172,8 @@
}
-CDummySubConnectionProvider::CDummySubConnectionProvider(CSubConnectionProviderFactoryBase& aFactory)
-:CCoreSubConnectionProvider(aFactory,DummySCPRStates::stateMap::Self())
+CDummySubConnectionProvider::CDummySubConnectionProvider(CSubConnectionProviderFactoryBase& aFactory, const MeshMachine::TNodeActivityMap& aActivityMap)
+:CCoreSubConnectionProvider(aFactory, aActivityMap)
{
LOG_NODE_CREATE(KDummySCPRTag, CDummySubConnectionProvider);
}