added acquirePlaylist() to TestStorageClient

This commit is contained in:
fgerlits 2004-11-08 10:08:59 +00:00
parent 4631706006
commit 28b2da6dd9
4 changed files with 50 additions and 11 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/Attic/StorageServerLoginTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "StorageServerLoginTest.h"
using namespace std;
using namespace XmlRpc;
using namespace LiveSupport::Storage;
@ -97,12 +98,21 @@ StorageServerLoginTest :: firstTest(void)
XmlRpcValue parameters;
XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 80,
"/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php", false);
XmlRpcClient xmlRpcClient("localhost", 80,
"/storage/var/xmlrpc/xrLocStor.php", false);
parameters.clear();
parameters["login"] = "root";
parameters["pass"] = "q";
xmlRpcClient.execute("locstor.login", parameters, result);
xmlRpcClient.execute("test", parameters, result);
std::cerr << "\nstorage server response:\n###\n" << result << "\n###\n";
std::string sessionId(result);
parameters.clear();
parameters["sessid"] = sessionId;
result.clear();
xmlRpcClient.execute("locstor.logout", parameters, result);
std::string byeMessage(result);
CPPUNIT_ASSERT(byeMessage == "Bye");
}

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -133,6 +133,19 @@ TestStorageClient :: getPlaylist(Ptr<const UniqueId>::Ref id) const
}
/*------------------------------------------------------------------------------
* Acquire resources for a playlist.
*----------------------------------------------------------------------------*/
Ptr<std::string>::Ref
TestStorageClient :: acquirePlaylist(Ptr<const UniqueId>::Ref id) const
throw (std::invalid_argument,
std::logic_error)
{
Ptr<std::string>::Ref returnValue(new std::string("/tmp/somefile.xml"));
return returnValue;
}
/*------------------------------------------------------------------------------
* Release a playlist.
*----------------------------------------------------------------------------*/

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.8 $
Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClient.h,v $
------------------------------------------------------------------------------*/
@ -67,7 +67,7 @@ using namespace LiveSupport::Core;
* A dummy storage client, only used for test purposes.
*
* @author $Author: fgerlits $
* @version $Revision: 1.8 $
* @version $Revision: 1.9 $
*/
class TestStorageClient :
virtual public Configurable,
@ -161,7 +161,22 @@ class TestStorageClient :
throw (std::invalid_argument);
/**
* Release the lock on a playlist with the specified id.
* Acquire the resources for the playlist
* At this point, this does not do anything.
*
* @param id the id of the playlist to release.
* @return something
* @exception std::invalid_argument if no playlist with the specified
* specified id exists.
*/
virtual Ptr<std::string>::Ref
acquirePlaylist(Ptr<const UniqueId>::Ref id) const
throw (std::invalid_argument,
std::logic_error);
/**
* Release the resources (audio clips, other playlists) used
* in a playlist.
* At this point, this does not do anything.
*
* @param id the id of the playlist to release.

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.7 $
Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/
@ -116,7 +116,7 @@ TestStorageClientTest :: firstTest(void)
Ptr<Playlist>::Ref playlist = tsc->getPlaylist(id1);
CPPUNIT_ASSERT(playlist->getId()->getId() == id1->getId());
/*
try {
tsc->releasePlaylist(id1);
}
@ -142,6 +142,7 @@ TestStorageClientTest :: firstTest(void)
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
}
*/
}