Updated the methods in the scheduler module to use the changed storage client
interface. Re-formatted try-catch blocks everywhere to make them less readable.
This commit is contained in:
parent
0bb6923efd
commit
5c5e8c7de9
59 changed files with 425 additions and 610 deletions
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.3 $
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/StorageClientFactoryTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -151,8 +151,7 @@ StorageClientFactoryTest :: firstTest(void)
|
|||
|
||||
try {
|
||||
CPPUNIT_ASSERT( storage->existsPlaylist(sessionId, id01));
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "existsPlaylist returned error:\n";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
|
@ -160,8 +159,7 @@ StorageClientFactoryTest :: firstTest(void)
|
|||
|
||||
try {
|
||||
CPPUNIT_ASSERT(!storage->existsPlaylist(sessionId, id77));
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "existsPlaylist returned error:\n";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
|
@ -170,8 +168,7 @@ StorageClientFactoryTest :: firstTest(void)
|
|||
try {
|
||||
Ptr<Playlist>::Ref playlist = storage->getPlaylist(sessionId, id01);
|
||||
CPPUNIT_ASSERT(playlist->getId()->getId() == id01->getId());
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "getPlaylist returned error:\n";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.27 $
|
||||
Version : $Revision: 1.28 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -194,6 +194,30 @@ TestStorageClient :: configure(const xmlpp::Element & element)
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Create a new playlist.
|
||||
*----------------------------------------------------------------------------*/
|
||||
Ptr<Playlist>::Ref
|
||||
TestStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
|
||||
throw ()
|
||||
{
|
||||
// generate a new UniqueId -- TODO: fix UniqueId to make sure
|
||||
// this is really unique; not checked here!
|
||||
Ptr<UniqueId>::Ref playlistId =
|
||||
Ptr<UniqueId>::Ref(UniqueId :: generateId());
|
||||
|
||||
Ptr<time_duration>::Ref playLength =
|
||||
Ptr<time_duration>::Ref(new time_duration(0,0,0));
|
||||
|
||||
Ptr<Playlist>::Ref playlist =
|
||||
Ptr<Playlist>::Ref(new Playlist(playlistId, playLength));
|
||||
|
||||
playlistMap[playlistId->getId()] = playlist;
|
||||
|
||||
return getPlaylist(sessionId, playlistId); // return a copy of the playlist
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Tell if a playlist exists.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -214,17 +238,26 @@ TestStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
Ptr<UniqueId>::Ref id) const
|
||||
throw (XmlRpcException)
|
||||
{
|
||||
PlaylistMapType::const_iterator it = playlistMap.find(id->getId());
|
||||
Ptr<Playlist>::Ref playlist;
|
||||
|
||||
if (it == playlistMap.end()) {
|
||||
throw XmlRpcException("no such playlist");
|
||||
EditedPlaylistsType::const_iterator
|
||||
editIt = editedPlaylists.find(id->getId());
|
||||
if (editIt != editedPlaylists.end() // is being edited
|
||||
&& (*editIt->second->getToken() == sessionId->getId())) { // by us
|
||||
playlist = editIt->second;
|
||||
} else {
|
||||
PlaylistMapType::const_iterator
|
||||
getIt = playlistMap.find(id->getId());
|
||||
if (getIt != playlistMap.end()) {
|
||||
playlist.reset(new Playlist(*getIt->second)); // get from storage
|
||||
} else {
|
||||
throw XmlRpcException("no such playlist");
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<Playlist>::Ref copyOfPlaylist(new Playlist(*it->second));
|
||||
return copyOfPlaylist;
|
||||
|
||||
return playlist;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Return a playlist to be edited.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -237,8 +270,12 @@ TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
throw XmlRpcException("playlist is already being edited");
|
||||
}
|
||||
|
||||
editedPlaylists[id->getId()] = sessionId;
|
||||
return getPlaylist(sessionId, id);
|
||||
Ptr<Playlist>::Ref playlist = getPlaylist(sessionId, id);
|
||||
Ptr<std::string>::Ref token(new std::string(sessionId->getId()));
|
||||
playlist->setToken(token);
|
||||
|
||||
editedPlaylists[id->getId()] = playlist;
|
||||
return playlist;
|
||||
}
|
||||
|
||||
|
||||
|
@ -248,17 +285,25 @@ TestStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
void
|
||||
TestStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<Playlist>::Ref playlist)
|
||||
throw ()
|
||||
throw (XmlRpcException)
|
||||
{
|
||||
EditedPlaylistsType::iterator
|
||||
editIt = editedPlaylists.find(playlist->getId()->getId());
|
||||
|
||||
if ((editIt == editedPlaylists.end()) || (*editIt->second != *sessionId)) {
|
||||
if (! playlist->getToken()) {
|
||||
throw XmlRpcException("savePlaylist() called without editPlaylist()");
|
||||
}
|
||||
|
||||
editedPlaylists.erase(editIt);
|
||||
if (sessionId->getId() != *playlist->getToken()) {
|
||||
throw XmlRpcException("tried to save playlist in different session"
|
||||
" than the one it was opened in???");
|
||||
}
|
||||
|
||||
EditedPlaylistsType::iterator
|
||||
editIt = editedPlaylists.find(playlist->getId()->getId());
|
||||
|
||||
if ((editIt == editedPlaylists.end())
|
||||
|| (*playlist->getToken() != *editIt->second->getToken())) {
|
||||
throw XmlRpcException("savePlaylist() called without editPlaylist()");
|
||||
}
|
||||
|
||||
PlaylistMapType::iterator
|
||||
storeIt = playlistMap.find(playlist->getId()->getId());
|
||||
|
||||
|
@ -267,6 +312,8 @@ TestStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
}
|
||||
|
||||
storeIt->second = playlist;
|
||||
|
||||
editedPlaylists.erase(editIt);
|
||||
}
|
||||
|
||||
|
||||
|
@ -461,30 +508,6 @@ TestStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId)
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Create a new playlist.
|
||||
*----------------------------------------------------------------------------*/
|
||||
Ptr<Playlist>::Ref
|
||||
TestStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
|
||||
throw ()
|
||||
{
|
||||
// generate a new UniqueId -- TODO: fix UniqueId to make sure
|
||||
// this is really unique; not checked here!
|
||||
Ptr<UniqueId>::Ref playlistId =
|
||||
Ptr<UniqueId>::Ref(UniqueId :: generateId());
|
||||
|
||||
Ptr<time_duration>::Ref playLength =
|
||||
Ptr<time_duration>::Ref(new time_duration(0,0,0));
|
||||
|
||||
Ptr<Playlist>::Ref playlist =
|
||||
Ptr<Playlist>::Ref(new Playlist(playlistId, playLength));
|
||||
|
||||
playlistMap[playlistId->getId()] = playlist;
|
||||
|
||||
return getPlaylist(sessionId, playlistId); // return a copy of the playlist
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Tell if an audio clip exists.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.23 $
|
||||
Version : $Revision: 1.24 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -90,7 +90,7 @@ using namespace LiveSupport::Core;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.23 $
|
||||
* @version $Revision: 1.24 $
|
||||
*/
|
||||
class TestStorageClient :
|
||||
virtual public Configurable,
|
||||
|
@ -116,7 +116,7 @@ class TestStorageClient :
|
|||
/**
|
||||
* The type for the list of playlists which are currently being edited
|
||||
*/
|
||||
typedef std::map<const UniqueId::IdType, Ptr<SessionId>::Ref>
|
||||
typedef std::map<const UniqueId::IdType, Ptr<Playlist>::Ref>
|
||||
EditedPlaylistsType;
|
||||
|
||||
/**
|
||||
|
@ -214,7 +214,12 @@ class TestStorageClient :
|
|||
|
||||
/**
|
||||
* Return a playlist with the specified id to be displayed.
|
||||
* If the playlist is being edited, its last saved state is returned.
|
||||
* If the playlist is being edited, and this method is called
|
||||
* by the same user who is editing the playlist,
|
||||
* (i.e., the method is called with the same sessionId and playlistId
|
||||
* that editPlaylist() was), then the working copy of the playlist
|
||||
* is returned.
|
||||
* Any other user gets the old (pre-editPlaylist()) copy from storage.
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param id the id of the playlist to return.
|
||||
|
@ -233,6 +238,10 @@ class TestStorageClient :
|
|||
* This puts a lock on the playlist, and nobody else can edit it
|
||||
* until we release it using savePlaylist().
|
||||
*
|
||||
* This method creates a working copy of the playlist, which will
|
||||
* be returned by getPlaylist() if it is called with the same
|
||||
* sessionId and playlistId, until we call savePlaylist().
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param id the id of the playlist to return.
|
||||
* @return the requested playlist.
|
||||
|
@ -250,13 +259,15 @@ class TestStorageClient :
|
|||
* Can only be called after we obtained a lock on the playlist using
|
||||
* editPlaylist(); this method releases the lock.
|
||||
*
|
||||
* This method destroys the working copy created by editPlaylist().
|
||||
*
|
||||
* @param sessionId the session ID from the authentication client
|
||||
* @param playlist the playlist to save.
|
||||
*/
|
||||
virtual void
|
||||
savePlaylist(Ptr<SessionId>::Ref sessionId,
|
||||
Ptr<Playlist>::Ref playlist)
|
||||
throw ();
|
||||
throw (XmlRpcException);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.26 $
|
||||
Version : $Revision: 1.27 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -147,21 +147,18 @@ WebStorageClientTest :: firstTest(void)
|
|||
try {
|
||||
authentication->logout(sessionId);
|
||||
CPPUNIT_FAIL("allowed logout operation without login");
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
sessionId = authentication->login("noSuchUser", "incorrectPassword");
|
||||
CPPUNIT_FAIL("Allowed login with incorrect password.");
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
sessionId = authentication->login("root", "q");
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "Login failed.";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
|
@ -169,8 +166,7 @@ WebStorageClientTest :: firstTest(void)
|
|||
|
||||
try {
|
||||
authentication->logout(sessionId);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "Login failed.";
|
||||
eMsg += e.what();
|
||||
CPPUNIT_FAIL(eMsg);
|
||||
|
@ -188,8 +184,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref uniqueIdVector;
|
||||
try {
|
||||
uniqueIdVector = wsc->reset();
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() >= 3);
|
||||
|
@ -198,8 +193,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<SessionId>::Ref sessionId;
|
||||
try {
|
||||
sessionId = authentication->login("root", "q");
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(sessionId);
|
||||
|
@ -209,8 +203,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<Playlist>::Ref playlist;
|
||||
try{
|
||||
playlist = wsc->createPlaylist(sessionId);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(playlist);
|
||||
|
@ -221,8 +214,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
bool exists = false;
|
||||
try {
|
||||
exists = wsc->existsPlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(exists);
|
||||
|
@ -230,8 +222,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<UniqueId>::Ref playlistId77(new UniqueId(77));
|
||||
try {
|
||||
exists = wsc->existsPlaylist(sessionId, playlistId77);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!exists);
|
||||
|
@ -240,8 +231,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
// test editPlaylist()
|
||||
try {
|
||||
playlist = wsc->editPlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(playlist);
|
||||
|
@ -249,10 +239,8 @@ WebStorageClientTest :: playlistTest(void)
|
|||
try {
|
||||
playlist = wsc->editPlaylist(sessionId, playlistIdxx);
|
||||
CPPUNIT_FAIL("allowed to open playlist for editing twice");
|
||||
}
|
||||
catch (Core::XmlRpcMethodFaultException &e) {
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (Core::XmlRpcMethodFaultException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
std::string eMsg = "editPlaylist() threw unexpected exception:\n";
|
||||
CPPUNIT_FAIL(eMsg + e.what());
|
||||
}
|
||||
|
@ -261,8 +249,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<AudioClip>::Ref audioClip;
|
||||
try {
|
||||
audioClip = wsc->getAudioClip(sessionId, audioClipId);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
|
@ -281,15 +268,13 @@ WebStorageClientTest :: playlistTest(void)
|
|||
// this should be OK, get old copy
|
||||
CPPUNIT_ASSERT(throwAwayPlaylist->getPlaylength()
|
||||
->total_seconds() == 0);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
try {
|
||||
wsc->savePlaylist(sessionId, playlist);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
|
@ -298,8 +283,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
Ptr<Playlist>::Ref newPlaylist;
|
||||
try {
|
||||
newPlaylist = wsc->getPlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(newPlaylist);
|
||||
|
@ -311,8 +295,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
// test acquirePlaylist() and releasePlaylist()
|
||||
try {
|
||||
newPlaylist = wsc->acquirePlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(newPlaylist);
|
||||
|
@ -337,8 +320,7 @@ WebStorageClientTest :: playlistTest(void)
|
|||
|
||||
try {
|
||||
wsc->releasePlaylist(sessionId, newPlaylist);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!newPlaylist->getUri());
|
||||
|
@ -347,15 +329,13 @@ WebStorageClientTest :: playlistTest(void)
|
|||
// test deletePlaylist()
|
||||
try {
|
||||
wsc->deletePlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
try {
|
||||
exists = wsc->existsPlaylist(sessionId, playlistIdxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!exists);
|
||||
|
@ -372,8 +352,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
Ptr<std::vector<Ptr<UniqueId>::Ref> >::Ref uniqueIdVector;
|
||||
try {
|
||||
uniqueIdVector = wsc->reset();
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(uniqueIdVector->size() >= 2);
|
||||
|
@ -387,8 +366,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
Ptr<SessionId>::Ref sessionId;
|
||||
try {
|
||||
sessionId = authentication->login("root", "q");
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(sessionId);
|
||||
|
@ -398,8 +376,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
bool exists = false;;
|
||||
try {
|
||||
exists = wsc->existsAudioClip(sessionId, id01);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(exists);
|
||||
|
@ -407,22 +384,19 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
Ptr<AudioClip>::Ref audioClip;
|
||||
try {
|
||||
audioClip = wsc->getAudioClip(sessionId, id01);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
try {
|
||||
wsc->deleteAudioClip(sessionId, id01);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
try {
|
||||
exists = wsc->existsAudioClip(sessionId, id01);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!exists);
|
||||
|
@ -430,8 +404,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
Ptr<UniqueId>::Ref id77(new UniqueId(10077));
|
||||
try {
|
||||
exists = wsc->existsAudioClip(sessionId, id77);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!exists);
|
||||
|
@ -447,8 +420,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
|
||||
try {
|
||||
wsc->storeAudioClip(sessionId, audioClip);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
|
@ -457,16 +429,14 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
|
||||
try {
|
||||
CPPUNIT_ASSERT( wsc->existsAudioClip(sessionId, idxx));
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
Ptr<AudioClip>::Ref newAudioClip;
|
||||
try {
|
||||
newAudioClip = wsc->getAudioClip(sessionId, idxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
|
||||
|
@ -478,8 +448,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
// test acquireAudioClip() and releaseAudioClip()
|
||||
try {
|
||||
newAudioClip = wsc->acquireAudioClip(sessionId, idxx);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(newAudioClip->getUri());
|
||||
|
@ -488,8 +457,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
|
||||
try {
|
||||
wsc->releaseAudioClip(sessionId, newAudioClip);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(!newAudioClip->getUri());
|
||||
|
@ -499,8 +467,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClipVector;
|
||||
try {
|
||||
audioClipVector = wsc->getAllAudioClips(sessionId);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
CPPUNIT_ASSERT(audioClipVector->size() == 0);
|
||||
|
@ -508,8 +475,7 @@ WebStorageClientTest :: audioClipTest(void)
|
|||
|
||||
try{
|
||||
authentication->logout(sessionId);
|
||||
}
|
||||
catch (XmlRpcException &e) {
|
||||
} catch (XmlRpcException &e) {
|
||||
CPPUNIT_FAIL(e.what());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue