diff --git a/livesupport/modules/authentication/src/AuthenticationClientFactoryTest.cxx b/livesupport/modules/authentication/src/AuthenticationClientFactoryTest.cxx index 0ea3b9c01..7903c9c72 100644 --- a/livesupport/modules/authentication/src/AuthenticationClientFactoryTest.cxx +++ b/livesupport/modules/authentication/src/AuthenticationClientFactoryTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/authentication/src/AuthenticationClientFactoryTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -118,8 +118,7 @@ AuthenticationClientFactoryTest :: firstTest(void) try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } @@ -127,8 +126,7 @@ AuthenticationClientFactoryTest :: firstTest(void) try { authentication->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } } @@ -219,8 +217,7 @@ AuthenticationClientFactoryTest :: preferencesTest(void) // and log out try { authentication->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } } diff --git a/livesupport/modules/authentication/src/TestAuthenticationClientTest.cxx b/livesupport/modules/authentication/src/TestAuthenticationClientTest.cxx index ebbac3d29..1ab88aa35 100644 --- a/livesupport/modules/authentication/src/TestAuthenticationClientTest.cxx +++ b/livesupport/modules/authentication/src/TestAuthenticationClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/authentication/src/TestAuthenticationClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -114,8 +114,7 @@ TestAuthenticationClientTest :: firstTest(void) try { sessionId = tac->login("Piszkos Fred", "malnaszor"); CPPUNIT_FAIL("Allowed login with incorrect login and password."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } // TODO: this call writes some garbage to cerr; it should be told not to @@ -123,29 +122,25 @@ TestAuthenticationClientTest :: firstTest(void) try { tac->logout(sessionId); CPPUNIT_FAIL("Allowed logout without previous login."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } try { sessionId = tac->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } try { tac->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } try { tac->logout(sessionId); CPPUNIT_FAIL("Allowed to logout twice."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } } @@ -230,8 +225,7 @@ TestAuthenticationClientTest :: preferencesTest(void) // and log out try { tac->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } } diff --git a/livesupport/modules/authentication/src/WebAuthenticationClientTest.cxx b/livesupport/modules/authentication/src/WebAuthenticationClientTest.cxx index 9d4bb63a9..f90e51648 100644 --- a/livesupport/modules/authentication/src/WebAuthenticationClientTest.cxx +++ b/livesupport/modules/authentication/src/WebAuthenticationClientTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/authentication/src/WebAuthenticationClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -114,37 +114,32 @@ WebAuthenticationClientTest :: firstTest(void) try { sessionId = wac->login("Piszkos Fred", "malnaszor"); CPPUNIT_FAIL("Allowed login with incorrect login and password."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } sessionId.reset(new SessionId("bad_session_ID")); try { wac->logout(sessionId); CPPUNIT_FAIL("Allowed logout without previous login."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } try { sessionId = wac->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } try { wac->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } try { wac->logout(sessionId); CPPUNIT_FAIL("Allowed to logout twice."); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { } } @@ -158,8 +153,7 @@ WebAuthenticationClientTest :: preferencesTest(void) { try { wac->reset(); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } @@ -236,8 +230,7 @@ WebAuthenticationClientTest :: preferencesTest(void) // and log out try { wac->logout(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { CPPUNIT_FAIL(e.what()); } } diff --git a/livesupport/modules/core/src/Playlist.cxx b/livesupport/modules/core/src/Playlist.cxx index 6cad30466..8120df133 100644 --- a/livesupport/modules/core/src/Playlist.cxx +++ b/livesupport/modules/core/src/Playlist.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.24 $ + Version : $Revision: 1.25 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/Playlist.cxx,v $ ------------------------------------------------------------------------------*/ @@ -145,6 +145,9 @@ Playlist :: Playlist(const Playlist & otherPlaylist) uri = otherPlaylist.uri; token = otherPlaylist.token; + isLockedForPlaying = otherPlaylist.isLockedForPlaying; + isLockedForEditing = otherPlaylist.isLockedForEditing; + elementList.reset(new PlaylistElementListType(*otherPlaylist.elementList)); if (otherPlaylist.savedCopy) { diff --git a/livesupport/modules/core/src/PlaylistTest.cxx b/livesupport/modules/core/src/PlaylistTest.cxx index b7627fe06..e1ec0a541 100644 --- a/livesupport/modules/core/src/PlaylistTest.cxx +++ b/livesupport/modules/core/src/PlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.19 $ + Version : $Revision: 1.20 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/PlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -205,8 +205,7 @@ PlaylistTest :: audioClipTest(void) // hour, min, sec, frac_sec try { playlist->addAudioClip(audioClip, relativeOffset); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { string eMsg = "addAudioClip returned with error: "; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -242,8 +241,7 @@ PlaylistTest :: audioClipTest(void) try { playlist->removePlaylistElement(relativeOffset); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { string eMsg = "removePlaylistElement returned with error: "; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -264,8 +262,7 @@ PlaylistTest :: audioClipTest(void) playlist->removePlaylistElement(phonyRelativeOffset); CPPUNIT_FAIL("removePlaylistElement allowed to remove " "non-existent audio clip"); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { } } @@ -280,8 +277,7 @@ PlaylistTest :: savedCopyTest(void) try { playlist->revertToSavedCopy(); CPPUNIT_FAIL("allowed to revert to non-existent state"); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { } playlist->createSavedCopy(); @@ -295,8 +291,7 @@ PlaylistTest :: savedCopyTest(void) try { playlist->revertToSavedCopy(); - } - catch (std::logic_error &e) { + } catch (std::logic_error &e) { CPPUNIT_FAIL("could not revert to saved state"); } @@ -318,8 +313,7 @@ PlaylistTest :: savedCopyTest(void) try { playlist->revertToSavedCopy(); CPPUNIT_FAIL("allowed to revert to deleted state"); - } - catch (std::logic_error &e) { + } catch (std::logic_error &e) { } } @@ -356,16 +350,14 @@ PlaylistTest :: fadeInfoTest(void) Ptr::Ref relativeOffset (new time_duration(0,0,0,0)); try { playlist->setFadeInfo(relativeOffset, fadeInfo); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL("could not add new fade info"); } relativeOffset.reset(new time_duration(0,0,11,0)); try { playlist->setFadeInfo(relativeOffset, fadeInfo); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL("could not update fade info"); } @@ -387,8 +379,7 @@ PlaylistTest :: fadeInfoTest(void) try { playlist->setFadeInfo(relativeOffset, fadeInfo); CPPUNIT_FAIL("allowed to set fade info for non-existent element"); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { } } diff --git a/livesupport/modules/core/src/XmlRpcToolsTest.cxx b/livesupport/modules/core/src/XmlRpcToolsTest.cxx index ad58c7eaf..5711fd0b5 100644 --- a/livesupport/modules/core/src/XmlRpcToolsTest.cxx +++ b/livesupport/modules/core/src/XmlRpcToolsTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/XmlRpcToolsTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -168,8 +168,7 @@ XmlRpcToolsTest :: firstTest(void) newPlaylistId = XmlRpcTools::extractPlaylistId(xmlRpcPlaylistId); newAudioClipId = XmlRpcTools::extractAudioClipId(xmlRpcPlaylistId); newRelativeOffset = XmlRpcTools::extractRelativeOffset(xmlRpcPlaylistId); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL(e.what()); } @@ -191,8 +190,7 @@ XmlRpcToolsTest :: errorTest(void) try { XmlRpcTools :: markError(42, "this is an error", xmlRpcValue); CPPUNIT_FAIL("did not throw exception in markError()"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 42); CPPUNIT_ASSERT(e.getMessage() == "this is an error"); } diff --git a/livesupport/modules/storage/src/StorageClientFactoryTest.cxx b/livesupport/modules/storage/src/StorageClientFactoryTest.cxx index 8972ba072..6e2919195 100644 --- a/livesupport/modules/storage/src/StorageClientFactoryTest.cxx +++ b/livesupport/modules/storage/src/StorageClientFactoryTest.cxx @@ -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::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); diff --git a/livesupport/modules/storage/src/TestStorageClient.cxx b/livesupport/modules/storage/src/TestStorageClient.cxx index ecf12035a..7dcd575ca 100644 --- a/livesupport/modules/storage/src/TestStorageClient.cxx +++ b/livesupport/modules/storage/src/TestStorageClient.cxx @@ -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::Ref +TestStorageClient :: createPlaylist(Ptr::Ref sessionId) + throw () +{ + // generate a new UniqueId -- TODO: fix UniqueId to make sure + // this is really unique; not checked here! + Ptr::Ref playlistId = + Ptr::Ref(UniqueId :: generateId()); + + Ptr::Ref playLength = + Ptr::Ref(new time_duration(0,0,0)); + + Ptr::Ref playlist = + Ptr::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::Ref sessionId, Ptr::Ref id) const throw (XmlRpcException) { - PlaylistMapType::const_iterator it = playlistMap.find(id->getId()); + Ptr::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::Ref copyOfPlaylist(new Playlist(*it->second)); - return copyOfPlaylist; + + return playlist; } - /*------------------------------------------------------------------------------ * Return a playlist to be edited. *----------------------------------------------------------------------------*/ @@ -237,8 +270,12 @@ TestStorageClient :: editPlaylist(Ptr::Ref sessionId, throw XmlRpcException("playlist is already being edited"); } - editedPlaylists[id->getId()] = sessionId; - return getPlaylist(sessionId, id); + Ptr::Ref playlist = getPlaylist(sessionId, id); + Ptr::Ref token(new std::string(sessionId->getId())); + playlist->setToken(token); + + editedPlaylists[id->getId()] = playlist; + return playlist; } @@ -248,17 +285,25 @@ TestStorageClient :: editPlaylist(Ptr::Ref sessionId, void TestStorageClient :: savePlaylist(Ptr::Ref sessionId, Ptr::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::Ref sessionId, } storeIt->second = playlist; + + editedPlaylists.erase(editIt); } @@ -461,30 +508,6 @@ TestStorageClient :: getAllPlaylists(Ptr::Ref sessionId) } -/*------------------------------------------------------------------------------ - * Create a new playlist. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TestStorageClient :: createPlaylist(Ptr::Ref sessionId) - throw () -{ - // generate a new UniqueId -- TODO: fix UniqueId to make sure - // this is really unique; not checked here! - Ptr::Ref playlistId = - Ptr::Ref(UniqueId :: generateId()); - - Ptr::Ref playLength = - Ptr::Ref(new time_duration(0,0,0)); - - Ptr::Ref playlist = - Ptr::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. *----------------------------------------------------------------------------*/ diff --git a/livesupport/modules/storage/src/TestStorageClient.h b/livesupport/modules/storage/src/TestStorageClient.h index 8014849af..c55ce0763 100644 --- a/livesupport/modules/storage/src/TestStorageClient.h +++ b/livesupport/modules/storage/src/TestStorageClient.h @@ -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; * * * @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::Ref> + typedef std::map::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::Ref sessionId, Ptr::Ref playlist) - throw (); + throw (XmlRpcException); /** diff --git a/livesupport/modules/storage/src/WebStorageClientTest.cxx b/livesupport/modules/storage/src/WebStorageClientTest.cxx index 228a8da87..7564a5994 100644 --- a/livesupport/modules/storage/src/WebStorageClientTest.cxx +++ b/livesupport/modules/storage/src/WebStorageClientTest.cxx @@ -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::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::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::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::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::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::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::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::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::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::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::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::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()); } } diff --git a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx index fecd5c318..0f499e231 100644 --- a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.13 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -110,8 +110,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -121,8 +120,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlistId; try{ playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); return; @@ -131,8 +129,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref audioClipId; try{ audioClipId = XmlRpcTools::extractAudioClipId(parameters); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+3, "missing audio clip ID argument", returnValue); return; @@ -141,8 +138,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref relativeOffset; try{ relativeOffset = XmlRpcTools::extractRelativeOffset(parameters); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+4, "missing relative offset argument", returnValue); return; @@ -156,8 +152,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+5, "playlist not found", returnValue); return; @@ -173,8 +168,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref audioClip; try { audioClip = storage->getAudioClip(sessionId, audioClipId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { XmlRpcTools::markError(errorId+7, "audio clip does not exist", returnValue); return; @@ -182,8 +176,7 @@ AddAudioClipToPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, try { // and finally, the beef playlist->addAudioClip(audioClip, relativeOffset); - } - catch(std::invalid_argument &e) { + } catch(std::invalid_argument &e) { XmlRpcTools::markError(errorId+8, "two audio clips at the same relative offset", returnValue); diff --git a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx index e3db8bc31..08984211a 100644 --- a/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.12 $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -139,8 +139,7 @@ AddAudioClipToPlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -186,8 +185,7 @@ AddAudioClipToPlaylistMethodTest :: firstTest(void) result.clear(); try { openPlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -198,8 +196,7 @@ AddAudioClipToPlaylistMethodTest :: firstTest(void) try { addAudioClipMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to add overlapping audio clip"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 308); } @@ -213,8 +210,7 @@ AddAudioClipToPlaylistMethodTest :: firstTest(void) result.clear(); try { addAudioClipMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx index 9aff0910a..3cd0b571c 100644 --- a/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.10 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -109,8 +109,7 @@ CreatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -126,8 +125,19 @@ CreatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->createPlaylist(sessionId); + } catch (XmlRpcException &e) { + std::string eMsg = "could not create playlist:\n"; + eMsg += e.what(); + XmlRpcTools :: markError(errorId+2, + eMsg, + returnValue); + return; } - catch (XmlRpcException &e) { + + Ptr::Ref playlistId = playlist->getId(); + try { + playlist = storage->editPlaylist(sessionId, playlistId); + } catch (XmlRpcException &e) { std::string eMsg = "could not create playlist:\n"; eMsg += e.what(); XmlRpcTools :: markError(errorId+2, diff --git a/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx index 92e53056e..dc094bf51 100644 --- a/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.12 $ + Version : $Revision: 1.13 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -139,8 +139,7 @@ CreatePlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -178,8 +177,7 @@ CreatePlaylistMethodTest :: firstTest(void) rootParameter[0] = parameter; try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -202,8 +200,7 @@ CreatePlaylistMethodTest :: firstTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to open playlist twice"); - } - catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 105); + } catch (XmlRpc::XmlRpcException &e) { + CPPUNIT_ASSERT(e.getCode() == 104); } } diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx b/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx index b3d1891a9..38d2344aa 100644 --- a/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/DeletePlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.10 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -100,8 +100,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -111,8 +110,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlistId; try{ playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); return; @@ -125,8 +123,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); @@ -141,8 +138,7 @@ DeletePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, try { storage->deletePlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist could not be deleted:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+5, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx index 99f96e736..515bb8851 100644 --- a/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/DeletePlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -140,8 +140,7 @@ DeletePlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -187,8 +186,7 @@ DeletePlaylistMethodTest :: firstTest(void) result.clear(); try { openMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -199,16 +197,14 @@ DeletePlaylistMethodTest :: firstTest(void) try { deleteMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to delete locked playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 904); // playlist is locked } result.clear(); try { saveMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -218,8 +214,7 @@ DeletePlaylistMethodTest :: firstTest(void) result.clear(); try { deleteMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -250,8 +245,7 @@ DeletePlaylistMethodTest :: negativeTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to delete non-existent playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 903); // playlist not found } } diff --git a/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx b/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx index 7d3cc1775..bc623efe0 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.8 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -109,8 +109,7 @@ DisplayAudioClipMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -120,8 +119,7 @@ DisplayAudioClipMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref id; try{ id = XmlRpcTools::extractAudioClipId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "argument is not an audio clip ID", returnValue); return; @@ -136,8 +134,7 @@ DisplayAudioClipMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref audioClip; try { audioClip = storage->getAudioClip(sessionId, id); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "audio clip not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx b/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx index 92cd28c91..5003f4386 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -137,8 +137,7 @@ DisplayAudioClipMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -179,8 +178,7 @@ DisplayAudioClipMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -219,8 +217,7 @@ DisplayAudioClipMethodTest :: negativeTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to display non-existent audio clip"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 603); // audio clip not found } } diff --git a/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx b/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx index 030c27a8d..77932ff17 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.7 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -99,8 +99,7 @@ DisplayAudioClipsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -116,8 +115,7 @@ DisplayAudioClipsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref> >::Ref audioClipVector; try { audioClipVector = storage->getAllAudioClips(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "getAllAudioClips returned error:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+2, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx b/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx index ccf86c2b1..5000d3973 100644 --- a/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx +++ b/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -138,8 +138,7 @@ DisplayAudioClipsMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -178,8 +177,7 @@ DisplayAudioClipsMethodTest :: firstTest(void) rootParameter[0] = parameter; try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx b/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx index 456914868..b1c1dccc2 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.9 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.10 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -109,8 +109,7 @@ DisplayPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -120,8 +119,7 @@ DisplayPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref id; try{ id = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "argument is not a Playlist ID", returnValue); return; @@ -136,8 +134,7 @@ DisplayPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, id); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx index 625367aa6..cedeca712 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -137,8 +137,7 @@ DisplayPlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -179,8 +178,7 @@ DisplayPlaylistMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -218,8 +216,7 @@ DisplayPlaylistMethodTest :: negativeTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to display non-existent playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1003); // playlist not found } } diff --git a/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx b/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx index 44ef8d330..8659b2dec 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.8 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -100,8 +100,7 @@ DisplayPlaylistsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -117,8 +116,7 @@ DisplayPlaylistsMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref> >::Ref playlistVector; try { playlistVector = storage->getAllPlaylists(sessionId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "getAllPlaylists() returned error:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+2, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx b/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx index 23624ffdf..16899822e 100644 --- a/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx +++ b/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -138,8 +138,7 @@ DisplayPlaylistsMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -177,8 +176,7 @@ DisplayPlaylistsMethodTest :: firstTest(void) rootParameter[0] = parameters; try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx b/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx index 4def56e53..87125ccd0 100644 --- a/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx +++ b/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayScheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -106,8 +106,7 @@ DisplayScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -117,8 +116,7 @@ DisplayScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref fromTime; try { fromTime = XmlRpcTools::extractFromTime(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing or invalid 'from' argument", returnValue); return; @@ -127,8 +125,7 @@ DisplayScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref toTime; try { toTime = XmlRpcTools::extractToTime(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing or invalid 'to' argument", returnValue); return; diff --git a/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx b/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx index 9d36ae3f8..1f5458d27 100644 --- a/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx +++ b/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -153,8 +153,7 @@ DisplayScheduleMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -213,8 +212,7 @@ DisplayScheduleMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -253,8 +251,7 @@ DisplayScheduleMethodTest :: insertEntries(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -276,8 +273,7 @@ DisplayScheduleMethodTest :: insertEntries(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -299,8 +295,7 @@ DisplayScheduleMethodTest :: insertEntries(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -344,8 +339,7 @@ DisplayScheduleMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -394,8 +388,7 @@ DisplayScheduleMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -463,8 +456,7 @@ DisplayScheduleMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx b/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx index 94b8898d3..9f93f958a 100644 --- a/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx +++ b/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -106,8 +106,7 @@ GeneratePlayReportMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -117,8 +116,7 @@ GeneratePlayReportMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref fromTime; try { fromTime = XmlRpcTools::extractFromTime(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing or invalid 'from' argument", returnValue); return; @@ -127,8 +125,7 @@ GeneratePlayReportMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref toTime; try { toTime = XmlRpcTools::extractToTime(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing or invalid 'to' argument", returnValue); return; diff --git a/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx b/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx index 0ddea4624..c2ed0531c 100644 --- a/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx +++ b/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -154,8 +154,7 @@ GeneratePlayReportMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -212,8 +211,7 @@ GeneratePlayReportMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -280,8 +278,7 @@ GeneratePlayReportMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -329,8 +326,7 @@ GeneratePlayReportMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -378,8 +374,7 @@ GeneratePlayReportMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -444,8 +439,7 @@ GeneratePlayReportMethodTest :: intervalTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.cxx b/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.cxx index ea9bfde71..d5512aec0 100644 --- a/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.cxx +++ b/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -104,8 +104,7 @@ GetSchedulerTimeMethodTest :: simpleTest(void) result.clear(); try { getSchedulerTimeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -117,8 +116,7 @@ GetSchedulerTimeMethodTest :: simpleTest(void) result.clear(); try { getSchedulerTimeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx index 9c35e9e0c..d173e81bc 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.14 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -110,8 +110,7 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -121,8 +120,7 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref id; try{ id = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "argument is not a playlist ID", returnValue); return; @@ -136,10 +134,9 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { - playlist = storage->getPlaylist(sessionId, id); - } - catch (XmlRpcException &e) { - std::string eMsg = "playlist not found:\n"; + playlist = storage->editPlaylist(sessionId, id); + } catch (XmlRpcException &e) { + std::string eMsg = "could not open playlist for editing:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+4, eMsg, returnValue); return; @@ -147,7 +144,7 @@ OpenPlaylistForEditingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, if (!playlist->setLockedForEditing(true)) { XmlRpcTools::markError(errorId+5, - "could not open playlist", + "could not lock playlist", returnValue); return; } diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.h b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.h index 36f87f2ba..e4d1e2423 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.h +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethod.h,v $ ------------------------------------------------------------------------------*/ @@ -93,12 +93,12 @@ using namespace LiveSupport::Core; *
    *
  • 101 - invalid argument format
  • *
  • 102 - argument is not a playlist ID
  • - *
  • 104 - playlist not found
  • - *
  • 105 - could not open playlist
  • + *
  • 104 - could not open playlist for editing
  • + *
  • 105 - could not lock playlist
  • *
  • 120 - missing session ID argument
  • *
* @author $Author: fgerlits $ - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ */ class OpenPlaylistForEditingMethod : public XmlRpc::XmlRpcServerMethod { diff --git a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx index 5970040a8..b27daff99 100644 --- a/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx +++ b/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.13 $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -138,8 +138,7 @@ OpenPlaylistForEditingMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -180,8 +179,7 @@ OpenPlaylistForEditingMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -205,9 +203,8 @@ OpenPlaylistForEditingMethodTest :: firstTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to open non-existent playlist"); - } - catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 104); // playlist not found + } catch (XmlRpc::XmlRpcException &e) { + CPPUNIT_ASSERT(e.getCode() == 104); // could not open playlist } parameter.clear(); @@ -219,8 +216,7 @@ OpenPlaylistForEditingMethodTest :: firstTest(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to open the same playlist twice"); - } - catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 105); // could not open playlist + } catch (XmlRpc::XmlRpcException &e) { + CPPUNIT_ASSERT(e.getCode() == 104); // could not open playlist } } diff --git a/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx b/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx index b16df7d8c..cb6313033 100644 --- a/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx +++ b/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -89,11 +89,9 @@ PostgresqlPlayLogTest :: setUp(void) throw () playLog.reset(new PostgresqlPlayLog(cm)); playLog->install(); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL("semantic error in configuration file"); - } - catch (xmlpp::exception &e) { + } catch (xmlpp::exception &e) { CPPUNIT_FAIL("error parsing configuration file"); } } @@ -107,8 +105,7 @@ PostgresqlPlayLogTest :: tearDown(void) throw () { try { playLog->uninstall(); - } - catch (std::exception &e) { + } catch (std::exception &e) { std::string eMsg = "cannot uninstall playlog:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -131,8 +128,7 @@ PostgresqlPlayLogTest :: firstTest(void) try { playLog->addPlayLogEntry(audioClipId, timestamp); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL(e.what()); } } @@ -202,8 +198,7 @@ PostgresqlPlayLogTest :: getPlayLogEntriesTest(void) entries = playLog->getPlayLogEntries(fromTime, toTime); CPPUNIT_ASSERT(entries->size() == 0); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { CPPUNIT_FAIL(e.what()); } } diff --git a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx index 269ec0778..94cbe1dee 100644 --- a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.10 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -111,8 +111,7 @@ RemoveAudioClipFromPlaylistMethod :: execute( Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -122,8 +121,7 @@ RemoveAudioClipFromPlaylistMethod :: execute( Ptr::Ref playlistId; try{ playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); @@ -133,8 +131,7 @@ RemoveAudioClipFromPlaylistMethod :: execute( Ptr::Ref relativeOffset; try{ relativeOffset = XmlRpcTools::extractRelativeOffset(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing relative offset argument", returnValue); @@ -149,8 +146,7 @@ RemoveAudioClipFromPlaylistMethod :: execute( Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist does not exist:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+4, eMsg, returnValue); @@ -166,8 +162,7 @@ RemoveAudioClipFromPlaylistMethod :: execute( try { // and finally, the beef playlist->removePlaylistElement(relativeOffset); - } - catch(std::invalid_argument &e) { + } catch(std::invalid_argument &e) { XmlRpcTools::markError(errorId+6, "no audio clip at the specified " "relative offset", diff --git a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx index 5c4347f71..d885646ed 100644 --- a/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -143,8 +143,7 @@ RemoveAudioClipFromPlaylistMethodTest :: setUp(void) thr authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -192,16 +191,14 @@ RemoveAudioClipFromPlaylistMethodTest :: firstTest(void) try { removeAudioClipMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to edit playlist without opening it first"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 405); // not open for editing } result.clear(); try { openPlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -212,16 +209,14 @@ RemoveAudioClipFromPlaylistMethodTest :: firstTest(void) try { removeAudioClipMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to remove non-existent audio clip from playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 406); // no audio clip at this rel offset } result.clear(); try { addAudioClipMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -231,8 +226,7 @@ RemoveAudioClipFromPlaylistMethodTest :: firstTest(void) result.clear(); try { removeAudioClipMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx b/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx index 00165bf36..d780e6ccc 100644 --- a/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx +++ b/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveFromScheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -103,8 +103,7 @@ RemoveFromScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -114,8 +113,7 @@ RemoveFromScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref entryId; try { entryId = XmlRpcTools::extractScheduleEntryId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing schedule entry ID argument", returnValue); return; diff --git a/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx b/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx index 91d7dc36e..ed994af7d 100644 --- a/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx +++ b/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -127,8 +127,7 @@ RemoveFromScheduleMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -183,8 +182,7 @@ RemoveFromScheduleMethodTest :: firstTest(void) result.clear(); try { uploadMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -203,8 +201,7 @@ RemoveFromScheduleMethodTest :: firstTest(void) result.clear(); try { removeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -236,8 +233,7 @@ RemoveFromScheduleMethodTest :: negativeTest(void) try { removeMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to remove non-existent schedule entry"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { } } diff --git a/livesupport/products/scheduler/src/RescheduleMethod.cxx b/livesupport/products/scheduler/src/RescheduleMethod.cxx index c46a90aba..d4ec1c2bb 100644 --- a/livesupport/products/scheduler/src/RescheduleMethod.cxx +++ b/livesupport/products/scheduler/src/RescheduleMethod.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RescheduleMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -106,8 +106,7 @@ RescheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -117,8 +116,7 @@ RescheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref entryId; try { entryId = XmlRpcTools::extractScheduleEntryId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing schedule entry ID argument", returnValue); return; @@ -127,8 +125,7 @@ RescheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playschedule; try { playschedule = XmlRpcTools::extractPlayschedule(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing playtime argument", returnValue); return; @@ -146,8 +143,7 @@ RescheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, } try { schedule->reschedule(entryId, playschedule); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+5, e.what(), returnValue); return; diff --git a/livesupport/products/scheduler/src/RescheduleMethodTest.cxx b/livesupport/products/scheduler/src/RescheduleMethodTest.cxx index 066c966de..123ce61de 100644 --- a/livesupport/products/scheduler/src/RescheduleMethodTest.cxx +++ b/livesupport/products/scheduler/src/RescheduleMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RescheduleMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -129,8 +129,7 @@ RescheduleMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -183,8 +182,7 @@ RescheduleMethodTest :: firstTest(void) result.clear(); try { uploadMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -211,8 +209,7 @@ RescheduleMethodTest :: firstTest(void) result.clear(); try { rescheduleMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -236,8 +233,7 @@ RescheduleMethodTest :: firstTest(void) try { rescheduleMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to schedule playlist onto itself"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1305); } } diff --git a/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx b/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx index 5cc53014c..1cdf38778 100644 --- a/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.8 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -105,8 +105,7 @@ RevertEditedPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -116,8 +115,7 @@ RevertEditedPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref id; try{ id = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "argument is not a playlist ID", returnValue); return; @@ -132,8 +130,7 @@ RevertEditedPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, id); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); @@ -142,8 +139,7 @@ RevertEditedPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, try { playlist->revertToSavedCopy(); - } - catch (std::logic_error) { + } catch (std::logic_error) { XmlRpcTools::markError(errorId+4, "could not revert playlist", returnValue); return; diff --git a/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx index c7eb0836c..5a85562eb 100644 --- a/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -141,8 +141,7 @@ RevertEditedPlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -191,16 +190,14 @@ RevertEditedPlaylistMethodTest :: firstTest(void) try { revertMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to revert playlist without saving it first"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 804); // no saved copy } result.clear(); try { openMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -210,8 +207,7 @@ RevertEditedPlaylistMethodTest :: firstTest(void) result.clear(); try { removeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -222,15 +218,13 @@ RevertEditedPlaylistMethodTest :: firstTest(void) try { removeMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to remove the same playlist element twice"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { } result.clear(); try { revertMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -240,8 +234,7 @@ RevertEditedPlaylistMethodTest :: firstTest(void) result.clear(); try { // but now we can again removeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -251,8 +244,7 @@ RevertEditedPlaylistMethodTest :: firstTest(void) result.clear(); try { saveMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -263,8 +255,7 @@ RevertEditedPlaylistMethodTest :: firstTest(void) try { revertMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to revert playlist after discarding saved copy"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 804); // no saved copy } } diff --git a/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx b/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx index 2cbceaf41..ead99aea1 100644 --- a/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx +++ b/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -156,8 +156,7 @@ RpcAddAudioClipToPlaylistTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx b/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx index 19f2be021..c58b09ee8 100644 --- a/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx +++ b/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -137,8 +137,7 @@ DisplayAudioClipMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx b/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx index e1cd4e961..7a658a324 100644 --- a/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx +++ b/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -148,8 +148,7 @@ RpcDisplayPlaylistTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx b/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx index 088b0796c..926251568 100644 --- a/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx +++ b/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -138,8 +138,7 @@ DisplayPlaylistsMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx b/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx index b03975276..970c7e1ce 100644 --- a/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx +++ b/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -137,8 +137,7 @@ RpcDisplayScheduleTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx b/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx index 6e1f4f8e0..76a3ce5d3 100644 --- a/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx +++ b/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -137,8 +137,7 @@ RpcRemoveFromScheduleTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcRescheduleTest.cxx b/livesupport/products/scheduler/src/RpcRescheduleTest.cxx index c92cda840..74a5b56ce 100644 --- a/livesupport/products/scheduler/src/RpcRescheduleTest.cxx +++ b/livesupport/products/scheduler/src/RpcRescheduleTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRescheduleTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -136,8 +136,7 @@ RpcRescheduleTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx b/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx index d8428c635..e8e5ee8b3 100644 --- a/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx +++ b/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -139,8 +139,7 @@ RpcUploadPlaylistTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); diff --git a/livesupport/products/scheduler/src/SavePlaylistMethod.cxx b/livesupport/products/scheduler/src/SavePlaylistMethod.cxx index b21863699..bc189931a 100644 --- a/livesupport/products/scheduler/src/SavePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/SavePlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.8 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -105,8 +105,7 @@ SavePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -116,8 +115,7 @@ SavePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref id; try{ id = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "argument is not a playlist ID", returnValue); return; @@ -132,8 +130,7 @@ SavePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, id); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); @@ -142,10 +139,19 @@ SavePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, if (!playlist->setLockedForEditing(false)) { XmlRpcTools::markError(errorId+4, - "could not save playlist", + "could not unlock playlist", returnValue); return; } playlist->deleteSavedCopy(); + + try { + storage->savePlaylist(sessionId, playlist); + } catch (XmlRpcException &e) { + std::string eMsg = "could not save playlist:\n"; + eMsg += e.what(); + XmlRpcTools::markError(errorId+5, eMsg, returnValue); + return; + } } diff --git a/livesupport/products/scheduler/src/SavePlaylistMethod.h b/livesupport/products/scheduler/src/SavePlaylistMethod.h index 7dfca32f6..a87347f18 100644 --- a/livesupport/products/scheduler/src/SavePlaylistMethod.h +++ b/livesupport/products/scheduler/src/SavePlaylistMethod.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethod.h,v $ ------------------------------------------------------------------------------*/ @@ -87,11 +87,12 @@ using namespace LiveSupport::Core; *
  • 701 - invalid argument format
  • *
  • 702 - argument is not a playlist ID
  • *
  • 703 - playlist not found
  • - *
  • 704 - could not save playlist
  • + *
  • 704 - could not unlock playlist
  • + *
  • 705 - could not save playlist
  • *
  • 720 - missing session ID argument
  • * * @author $Author: fgerlits $ - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ */ class SavePlaylistMethod : public XmlRpc::XmlRpcServerMethod { diff --git a/livesupport/products/scheduler/src/SavePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/SavePlaylistMethodTest.cxx index c9ef34888..fff625af5 100644 --- a/livesupport/products/scheduler/src/SavePlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/SavePlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SavePlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -43,6 +43,7 @@ #include #include #include +#include #include "LiveSupport/Db/ConnectionManagerFactory.h" #include "LiveSupport/Storage/StorageClientFactory.h" @@ -138,8 +139,7 @@ SavePlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -182,9 +182,8 @@ SavePlaylistMethodTest :: firstTest(void) try { saveMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to save non-existent playlist"); - } - catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 703); // playlist not found + } catch (XmlRpc::XmlRpcException &e) { + CPPUNIT_ASSERT(e.getCode() == 703); // playlist not found } parameter["playlistId"] = "0000000000000001"; @@ -192,8 +191,8 @@ SavePlaylistMethodTest :: firstTest(void) result.clear(); try { openMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + saveMethod->execute(rootParameter, result); + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -201,25 +200,10 @@ SavePlaylistMethodTest :: firstTest(void) } result.clear(); - try { // open then save OK + try { saveMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - - result.clear(); - try { // save then open OK - saveMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); + CPPUNIT_FAIL("allowed to save playlist twice"); + } catch (XmlRpc::XmlRpcException &e) { + CPPUNIT_ASSERT(e.getCode() == 705); // could not save playlist } } diff --git a/livesupport/products/scheduler/src/SchedulerDaemon.cxx b/livesupport/products/scheduler/src/SchedulerDaemon.cxx index 8293b7497..a38da7dbd 100644 --- a/livesupport/products/scheduler/src/SchedulerDaemon.cxx +++ b/livesupport/products/scheduler/src/SchedulerDaemon.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.17 $ + Version : $Revision: 1.18 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/SchedulerDaemon.cxx,v $ ------------------------------------------------------------------------------*/ @@ -329,8 +329,7 @@ SchedulerDaemon :: install(void) throw (std::exception) Ptr::Ref sf = ScheduleFactory::getInstance(); try { sf->install(); - } - catch (std::exception &e) { + } catch (std::exception &e) { std::cerr << e.what() << std::endl; } Ptr::Ref plf = PlayLogFactory::getInstance(); @@ -348,8 +347,7 @@ SchedulerDaemon :: uninstall(void) throw (std::exception) Ptr::Ref plf = PlayLogFactory::getInstance(); try { plf->uninstall(); - } - catch (std::exception &e) { + } catch (std::exception &e) { std::cerr << e.what() << std::endl; } diff --git a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx index f0538e1e3..ba239818d 100644 --- a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx +++ b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.7 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -113,8 +113,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -124,8 +123,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref playlistId; try{ playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); @@ -135,8 +133,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref relativeOffset; try{ relativeOffset = XmlRpcTools::extractRelativeOffset(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing relative offset argument", returnValue); @@ -146,8 +143,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref fadeIn; try{ fadeIn = XmlRpcTools::extractFadeIn(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+4, "missing fade in argument", returnValue); @@ -157,8 +153,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref fadeOut; try{ fadeOut = XmlRpcTools::extractFadeOut(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+5, "missing fade out argument", returnValue); @@ -173,8 +168,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist does not exist:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+6, eMsg, returnValue); @@ -191,8 +185,7 @@ UpdateFadeInFadeOutMethod :: execute( Ptr::Ref fadeInfo(new FadeInfo(fadeIn, fadeOut)); try { // and finally, the beef playlist->setFadeInfo(relativeOffset, fadeInfo); - } - catch(std::invalid_argument &e) { + } catch(std::invalid_argument &e) { XmlRpcTools::markError(errorId+8, "no audio clip at the specified " "relative offset", diff --git a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx index ec49b6a0a..daf522875 100644 --- a/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx +++ b/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UpdateFadeInFadeOutMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -141,8 +141,7 @@ UpdateFadeInFadeOutMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -188,8 +187,7 @@ UpdateFadeInFadeOutMethodTest :: firstTest(void) try { updateFadeMethod->execute(rootParameter, result); CPPUNIT_FAIL("did not notice missing fade out parameter"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1605); // missing fade out } @@ -200,16 +198,14 @@ UpdateFadeInFadeOutMethodTest :: firstTest(void) try { updateFadeMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed update fade info without opening playlist first"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1607); // not open for editing } result.clear(); try { openPlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -221,8 +217,7 @@ UpdateFadeInFadeOutMethodTest :: firstTest(void) updateFadeMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed update fade info for non-existent " "playlist element"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1608);// no audio clip at this rel offset } @@ -232,8 +227,7 @@ UpdateFadeInFadeOutMethodTest :: firstTest(void) result.clear(); try { updateFadeMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); diff --git a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx index 767c0e9f8..31299e18b 100644 --- a/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.13 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -110,8 +110,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -121,8 +120,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlistId; try { playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); return; @@ -131,8 +129,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playschedule; try { playschedule = XmlRpcTools::extractPlayschedule(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+3, "missing playtime argument", returnValue); return; @@ -146,8 +143,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist not found:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+4, eMsg, returnValue); @@ -169,8 +165,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref scheduleEntryId; try { scheduleEntryId = schedule->schedulePlaylist(playlist, playschedule); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+6, e.what(), returnValue); return; diff --git a/livesupport/products/scheduler/src/UploadPlaylistMethodTest.cxx b/livesupport/products/scheduler/src/UploadPlaylistMethodTest.cxx index 8311f1e12..3c2b3cdef 100644 --- a/livesupport/products/scheduler/src/UploadPlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/UploadPlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -149,8 +149,7 @@ UploadPlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -201,8 +200,7 @@ UploadPlaylistMethodTest :: firstTest(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -241,8 +239,7 @@ UploadPlaylistMethodTest :: overlappingPlaylists(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -267,8 +264,7 @@ UploadPlaylistMethodTest :: overlappingPlaylists(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to schedule overlapping playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1405); // timeframe not available } @@ -287,8 +283,7 @@ UploadPlaylistMethodTest :: overlappingPlaylists(void) result.clear(); try { method->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -312,8 +307,7 @@ UploadPlaylistMethodTest :: overlappingPlaylists(void) try { method->execute(rootParameter, result); CPPUNIT_FAIL("allowed to schedule doubly overlapping playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 1405); // timeframe not available } } diff --git a/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx b/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx index a0cc363d8..7272b81a0 100644 --- a/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx +++ b/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.9 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.10 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethod.cxx,v $ ------------------------------------------------------------------------------*/ @@ -110,8 +110,7 @@ ValidatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref sessionId; try{ sessionId = XmlRpcTools::extractSessionId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+20, "missing session ID argument", returnValue); @@ -121,8 +120,7 @@ ValidatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlistId; try{ playlistId = XmlRpcTools::extractPlaylistId(parameters); - } - catch (std::invalid_argument &e) { + } catch (std::invalid_argument &e) { XmlRpcTools::markError(errorId+2, "missing playlist ID argument", returnValue); @@ -137,8 +135,7 @@ ValidatePlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, Ptr::Ref playlist; try { playlist = storage->getPlaylist(sessionId, playlistId); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "playlist does not exist:\n"; eMsg += e.what(); XmlRpcTools::markError(errorId+3, eMsg, returnValue); diff --git a/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx b/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx index fa49f8829..b3a0167fe 100644 --- a/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx +++ b/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ValidatePlaylistMethodTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -141,8 +141,7 @@ ValidatePlaylistMethodTest :: setUp(void) throw () authentication = acf->getAuthenticationClient(); try { sessionId = authentication->login("root", "q"); - } - catch (XmlRpcException &e) { + } catch (XmlRpcException &e) { std::string eMsg = "could not log in:\n"; eMsg += e.what(); CPPUNIT_FAIL(eMsg); @@ -187,8 +186,7 @@ ValidatePlaylistMethodTest :: firstTest(void) try { validatePlaylistMethod->execute(rootParameter, result); CPPUNIT_FAIL("allowed to validate non-existent playlist"); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { CPPUNIT_ASSERT(e.getCode() == 503); // no such playlist } @@ -199,8 +197,7 @@ ValidatePlaylistMethodTest :: firstTest(void) rootParameter[0] = parameter; try { openPlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -210,8 +207,7 @@ ValidatePlaylistMethodTest :: firstTest(void) result.clear(); try { validatePlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -225,8 +221,7 @@ ValidatePlaylistMethodTest :: firstTest(void) rootParameter[0] = parameter; try { removeAudioClipMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage(); @@ -236,8 +231,7 @@ ValidatePlaylistMethodTest :: firstTest(void) result.clear(); try { validatePlaylistMethod->execute(rootParameter, result); - } - catch (XmlRpc::XmlRpcException &e) { + } catch (XmlRpc::XmlRpcException &e) { std::stringstream eMsg; eMsg << "XML-RPC method returned error: " << e.getCode() << " - " << e.getMessage();