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