added reset() method to StorageClientInterface;

modified scheduler tests to use this reset() method;
changed getAllPlaylists() and getAllAudioClips() in StorageClientInterface
  to use the search() method, and added optional limit and offset arguments;
changed the Makefile.in in modules/storage and products/scheduler to
  initialize the storage server after compilation and before running tests;
modified some scheduler tests to work correctly with either Test- or
  Web- StorageClient
This commit is contained in:
fgerlits 2005-01-27 20:20:15 +00:00
parent 56e7c95d2a
commit bc49af1e38
41 changed files with 641 additions and 323 deletions

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.33 $
Version : $Revision: 1.34 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -1295,19 +1295,6 @@ WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
}
/*------------------------------------------------------------------------------
* Return a listing of all the playlists in the playlist store.
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId) const
throw (Core::XmlRpcException)
{
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref playlistVector(
new std::vector<Ptr<Playlist>::Ref>);
return playlistVector;
}
/*------------------------------------------------------------------------------
* Tell if an audio clip exists.
*----------------------------------------------------------------------------*/
@ -1838,20 +1825,6 @@ WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
}
/*------------------------------------------------------------------------------
* Return a listing of all the audio clips in the audio clip store.
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId)
const
throw (Core::XmlRpcException)
{
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClipVector(
new std::vector<Ptr<AudioClip>::Ref>);
return audioClipVector;
}
/*------------------------------------------------------------------------------
* Reset the storage to its initial state.
*----------------------------------------------------------------------------*/
@ -2044,3 +2017,59 @@ WebStorageClient :: search(Ptr<SessionId>::Ref sessionId,
+ int(result[searchPlaylistCountParamName]);
}
/*------------------------------------------------------------------------------
* Return a list of all playlists in the storage.
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref
WebStorageClient :: getAllPlaylists(Ptr<SessionId>::Ref sessionId,
const int limit, const int offset)
throw (XmlRpcException)
{
Ptr<SearchCriteria>::Ref criteria(new SearchCriteria("playlist"));
criteria->setLimit(limit);
criteria->setOffset(offset);
search(sessionId, criteria);
Ptr<std::vector<Ptr<Playlist>::Ref> >::Ref playlists(
new std::vector<Ptr<Playlist>::Ref>);
std::vector<Ptr<UniqueId>::Ref>::const_iterator it, end;
it = getPlaylistIds()->begin();
end = getPlaylistIds()->end();
while (it != end) {
playlists->push_back(getPlaylist(sessionId, *it));
++it;
}
return playlists;
}
/*------------------------------------------------------------------------------
* Return a list of all audio clips in the storage.
*----------------------------------------------------------------------------*/
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref
WebStorageClient :: getAllAudioClips(Ptr<SessionId>::Ref sessionId,
const int limit, const int offset)
throw (XmlRpcException)
{
Ptr<SearchCriteria>::Ref criteria(new SearchCriteria("audioClip"));
criteria->setLimit(limit);
criteria->setOffset(offset);
search(sessionId, criteria);
Ptr<std::vector<Ptr<AudioClip>::Ref> >::Ref audioClips(
new std::vector<Ptr<AudioClip>::Ref>);
std::vector<Ptr<UniqueId>::Ref>::const_iterator it, end;
it = getAudioClipIds()->begin();
end = getAudioClipIds()->end();
while (it != end) {
audioClips->push_back(getAudioClip(sessionId, *it));
++it;
}
return audioClips;
}