fixed ticket #1668:
added a missing reset() method to the authentication client; now using this reset() method in the unit test to avoid dependence on earlier events
This commit is contained in:
parent
d83086efa8
commit
7b4c7f97a4
5 changed files with 49 additions and 2 deletions
|
@ -203,6 +203,18 @@ class AuthenticationClientInterface
|
|||
throw (XmlRpcException)
|
||||
= 0;
|
||||
|
||||
/**
|
||||
* Reset the authentication client.
|
||||
* Invalidates all active session IDs, and resets the list of
|
||||
* preferences to its initial (empty) state.
|
||||
*
|
||||
* @exception XmlRpcException if the server returns an error.
|
||||
*/
|
||||
virtual void
|
||||
reset(void)
|
||||
throw (XmlRpcException)
|
||||
= 0;
|
||||
|
||||
/**
|
||||
* A virtual destructor, as this class has virtual functions.
|
||||
*/
|
||||
|
|
|
@ -114,6 +114,10 @@ AuthenticationClientFactoryTest :: firstTest(void)
|
|||
Ptr<AuthenticationClientInterface>::Ref
|
||||
authentication = acf->getAuthenticationClient();
|
||||
|
||||
CPPUNIT_ASSERT_NO_THROW(
|
||||
authentication->reset()
|
||||
);
|
||||
|
||||
Ptr<SessionId>::Ref sessionId;
|
||||
|
||||
try {
|
||||
|
@ -144,6 +148,10 @@ AuthenticationClientFactoryTest :: preferencesTest(void)
|
|||
Ptr<AuthenticationClientInterface>::Ref
|
||||
authentication = acf->getAuthenticationClient();
|
||||
|
||||
CPPUNIT_ASSERT_NO_THROW(
|
||||
authentication->reset()
|
||||
);
|
||||
|
||||
Ptr<SessionId>::Ref sessionId;
|
||||
Ptr<const Glib::ustring>::Ref prefValue;
|
||||
|
||||
|
|
|
@ -280,3 +280,17 @@ TestAuthenticationClient :: deletePreferencesItem(
|
|||
preferences.erase(it);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Reset the list of preferences to its initial (empty) state.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
TestAuthenticationClient :: reset(void)
|
||||
throw (XmlRpcException)
|
||||
{
|
||||
sessionIdList.clear();
|
||||
sessionCounter = 0;
|
||||
|
||||
preferences.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -261,6 +261,17 @@ class TestAuthenticationClient :
|
|||
deletePreferencesItem(Ptr<SessionId>::Ref sessionId,
|
||||
const Glib::ustring & key)
|
||||
throw (XmlRpcException);
|
||||
|
||||
/**
|
||||
* Reset the authentication client.
|
||||
* Invalidates all active session IDs, and resets the list of
|
||||
* preferences to its initial (empty) state.
|
||||
*
|
||||
* @exception XmlRpcException if the server returns an error.
|
||||
*/
|
||||
virtual void
|
||||
reset(void)
|
||||
throw (XmlRpcException);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -272,11 +272,13 @@ class WebAuthenticationClient :
|
|||
throw (XmlRpcException);
|
||||
|
||||
/**
|
||||
* Reset the list of preferences to its initial (empty) state.
|
||||
* Reset the authentication client.
|
||||
* Invalidates all active session IDs, and resets the list of
|
||||
* preferences to its initial (empty) state.
|
||||
*
|
||||
* @exception XmlRpcException if the server returns an error.
|
||||
*/
|
||||
void
|
||||
virtual void
|
||||
reset(void)
|
||||
throw (XmlRpcException);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue