changed error reporting in the XML-RPC methods from ad-hoc to standard
XML-RPC fault responses
This commit is contained in:
parent
7b591bbaa1
commit
75d4ff9502
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonDisplayPlaylistTest.cxx,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "SchedulerDaemon.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||
#include "SchedulerDaemonDisplayPlaylistTest.h"
|
||||
#include "RpcDisplayPlaylistTest.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace XmlRpc;
|
||||
|
@ -60,7 +60,7 @@ using namespace LiveSupport::Authentication;
|
|||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonDisplayPlaylistTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcDisplayPlaylistTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the scheduler daemon.
|
||||
|
@ -83,7 +83,7 @@ static const std::string authenticationClientConfigFileName =
|
|||
* Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayPlaylistTest :: configure(
|
||||
RpcDisplayPlaylistTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
|
@ -101,7 +101,7 @@ SchedulerDaemonDisplayPlaylistTest :: configure(
|
|||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayPlaylistTest :: setUp(void) throw ()
|
||||
RpcDisplayPlaylistTest :: setUp(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -144,7 +144,7 @@ SchedulerDaemonDisplayPlaylistTest :: setUp(void) throw (
|
|||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayPlaylistTest :: tearDown(void) throw ()
|
||||
RpcDisplayPlaylistTest :: tearDown(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -161,7 +161,7 @@ SchedulerDaemonDisplayPlaylistTest :: tearDown(void) throw (
|
|||
* A simple smoke test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayPlaylistTest :: simpleTest(void)
|
||||
RpcDisplayPlaylistTest :: simpleTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -174,7 +174,7 @@ SchedulerDaemonDisplayPlaylistTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("displayPlaylist", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
CPPUNIT_ASSERT(((int) result["id"]) == 1);
|
||||
CPPUNIT_ASSERT(((int) result["playlength"]) == (60 * 60));
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ SchedulerDaemonDisplayPlaylistTest :: simpleTest(void)
|
|||
* A simple negative test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayPlaylistTest :: negativeTest(void)
|
||||
RpcDisplayPlaylistTest :: negativeTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -197,6 +197,5 @@ SchedulerDaemonDisplayPlaylistTest :: negativeTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("displayPlaylist", parameters, result);
|
||||
CPPUNIT_ASSERT(result.valid());
|
||||
CPPUNIT_ASSERT(result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(xmlRpcClient.isFault());
|
||||
}
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonDisplayPlaylistTest.h,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef SchedulerDaemonDisplayPlaylistTest_h
|
||||
#define SchedulerDaemonDisplayPlaylistTest_h
|
||||
#ifndef RpcDisplayPlaylistTest_h
|
||||
#define RpcDisplayPlaylistTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
|
@ -64,12 +64,12 @@ using namespace LiveSupport::Core;
|
|||
* Unit test to test the displayPlaylist XML-RPC call.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see SchedulerDaemon
|
||||
*/
|
||||
class SchedulerDaemonDisplayPlaylistTest : public CPPUNIT_NS::TestFixture
|
||||
class RpcDisplayPlaylistTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonDisplayPlaylistTest);
|
||||
CPPUNIT_TEST_SUITE(RpcDisplayPlaylistTest);
|
||||
CPPUNIT_TEST(simpleTest);
|
||||
CPPUNIT_TEST(negativeTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
@ -142,5 +142,5 @@ class SchedulerDaemonDisplayPlaylistTest : public CPPUNIT_NS::TestFixture
|
|||
} // namespace Scheduler
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // SchedulerDaemonDisplayPlaylistTest_h
|
||||
#endif // RpcDisplayPlaylistTest_h
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonDisplayScheduleTest.cxx,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "SchedulerDaemon.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||
#include "SchedulerDaemonDisplayScheduleTest.h"
|
||||
#include "RpcDisplayScheduleTest.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace XmlRpc;
|
||||
|
@ -60,7 +60,7 @@ using namespace LiveSupport::Authentication;
|
|||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonDisplayScheduleTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcDisplayScheduleTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the scheduler daemon.
|
||||
|
@ -83,7 +83,7 @@ static const std::string authenticationClientConfigFileName =
|
|||
* Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayScheduleTest :: configure(
|
||||
RpcDisplayScheduleTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
|
@ -101,7 +101,7 @@ SchedulerDaemonDisplayScheduleTest :: configure(
|
|||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayScheduleTest :: setUp(void) throw ()
|
||||
RpcDisplayScheduleTest :: setUp(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -144,7 +144,7 @@ SchedulerDaemonDisplayScheduleTest :: setUp(void) throw (
|
|||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayScheduleTest :: tearDown(void) throw ()
|
||||
RpcDisplayScheduleTest :: tearDown(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -161,7 +161,7 @@ SchedulerDaemonDisplayScheduleTest :: tearDown(void) throw (
|
|||
* Test a simple query, resulting in an empty result set.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonDisplayScheduleTest :: simpleTest(void)
|
||||
RpcDisplayScheduleTest :: simpleTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -190,7 +190,7 @@ SchedulerDaemonDisplayScheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("displaySchedule", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
CPPUNIT_ASSERT(result.size() == 0);
|
||||
}
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonDisplayScheduleTest.h,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayScheduleTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef SchedulerDaemonDisplayScheduleTest_h
|
||||
#define SchedulerDaemonDisplayScheduleTest_h
|
||||
#ifndef RpcDisplayScheduleTest_h
|
||||
#define RpcDisplayScheduleTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
|
@ -64,12 +64,12 @@ using namespace LiveSupport::Core;
|
|||
* Unit test to test the displaySchedule XML-RPC call.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see SchedulerDaemon
|
||||
*/
|
||||
class SchedulerDaemonDisplayScheduleTest : public CPPUNIT_NS::TestFixture
|
||||
class RpcDisplayScheduleTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonDisplayScheduleTest);
|
||||
CPPUNIT_TEST_SUITE(RpcDisplayScheduleTest);
|
||||
CPPUNIT_TEST(simpleTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
|
@ -133,5 +133,5 @@ class SchedulerDaemonDisplayScheduleTest : public CPPUNIT_NS::TestFixture
|
|||
} // namespace Scheduler
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // SchedulerDaemonDisplayScheduleTest_h
|
||||
#endif // RpcDisplayScheduleTest_h
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonRemoveFromScheduleTest.cxx,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "SchedulerDaemon.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||
#include "SchedulerDaemonRemoveFromScheduleTest.h"
|
||||
#include "RpcRemoveFromScheduleTest.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace XmlRpc;
|
||||
|
@ -60,7 +60,7 @@ using namespace LiveSupport::Authentication;
|
|||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonRemoveFromScheduleTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcRemoveFromScheduleTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the scheduler daemon.
|
||||
|
@ -83,7 +83,7 @@ static const std::string authenticationClientConfigFileName =
|
|||
* Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRemoveFromScheduleTest :: configure(
|
||||
RpcRemoveFromScheduleTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
|
@ -101,7 +101,7 @@ SchedulerDaemonRemoveFromScheduleTest :: configure(
|
|||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRemoveFromScheduleTest :: setUp(void) throw ()
|
||||
RpcRemoveFromScheduleTest :: setUp(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -144,7 +144,7 @@ SchedulerDaemonRemoveFromScheduleTest :: setUp(void) thro
|
|||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRemoveFromScheduleTest :: tearDown(void) throw ()
|
||||
RpcRemoveFromScheduleTest :: tearDown(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -161,7 +161,7 @@ SchedulerDaemonRemoveFromScheduleTest :: tearDown(void) thro
|
|||
* A simple smoke test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRemoveFromScheduleTest :: simpleTest(void)
|
||||
RpcRemoveFromScheduleTest :: simpleTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -183,7 +183,7 @@ SchedulerDaemonRemoveFromScheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("uploadPlaylist", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
CPPUNIT_ASSERT(result.hasMember("scheduleEntryId"));
|
||||
|
||||
Ptr<UniqueId>::Ref entryId(new UniqueId(int(result["scheduleEntryId"])));
|
||||
|
@ -191,7 +191,7 @@ SchedulerDaemonRemoveFromScheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("removeFromSchedule", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ SchedulerDaemonRemoveFromScheduleTest :: simpleTest(void)
|
|||
* A simple negative test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRemoveFromScheduleTest :: negativeTest(void)
|
||||
RpcRemoveFromScheduleTest :: negativeTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -212,6 +212,6 @@ SchedulerDaemonRemoveFromScheduleTest :: negativeTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("removeFromSchedule", parameters, result);
|
||||
CPPUNIT_ASSERT(result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(xmlRpcClient.isFault());
|
||||
}
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonRescheduleTest.h,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRemoveFromScheduleTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef SchedulerDaemonRescheduleTest_h
|
||||
#define SchedulerDaemonRescheduleTest_h
|
||||
#ifndef RpcRemoveFromScheduleTest_h
|
||||
#define RpcRemoveFromScheduleTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
|
@ -64,12 +64,12 @@ using namespace LiveSupport::Core;
|
|||
* Unit test to test the removeFromSchedule XML-RPC call.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see SchedulerDaemon
|
||||
*/
|
||||
class SchedulerDaemonRescheduleTest : public CPPUNIT_NS::TestFixture
|
||||
class RpcRemoveFromScheduleTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonRescheduleTest);
|
||||
CPPUNIT_TEST_SUITE(RpcRemoveFromScheduleTest);
|
||||
CPPUNIT_TEST(simpleTest);
|
||||
CPPUNIT_TEST(negativeTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
@ -142,5 +142,5 @@ class SchedulerDaemonRescheduleTest : public CPPUNIT_NS::TestFixture
|
|||
} // namespace Scheduler
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // SchedulerDaemonRescheduleTest_h
|
||||
#endif // RpcRemoveFromScheduleTest_h
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonRescheduleTest.cxx,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRescheduleTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "SchedulerDaemon.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||
#include "SchedulerDaemonRescheduleTest.h"
|
||||
#include "RpcRescheduleTest.h"
|
||||
|
||||
using namespace XmlRpc;
|
||||
using namespace LiveSupport::Core;
|
||||
|
@ -59,7 +59,7 @@ using namespace LiveSupport::Authentication;
|
|||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonRescheduleTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcRescheduleTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the scheduler daemon.
|
||||
|
@ -82,7 +82,7 @@ static const std::string authenticationClientConfigFileName =
|
|||
* Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRescheduleTest :: configure(
|
||||
RpcRescheduleTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
|
@ -100,7 +100,7 @@ SchedulerDaemonRescheduleTest :: configure(
|
|||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRescheduleTest :: setUp(void) throw ()
|
||||
RpcRescheduleTest :: setUp(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -143,7 +143,7 @@ SchedulerDaemonRescheduleTest :: setUp(void) throw ()
|
|||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRescheduleTest :: tearDown(void) throw ()
|
||||
RpcRescheduleTest :: tearDown(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -160,7 +160,7 @@ SchedulerDaemonRescheduleTest :: tearDown(void) throw ()
|
|||
* A simple smoke test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRescheduleTest :: simpleTest(void)
|
||||
RpcRescheduleTest :: simpleTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -182,6 +182,7 @@ SchedulerDaemonRescheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("uploadPlaylist", parameters, result);
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
CPPUNIT_ASSERT(result.hasMember("scheduleEntryId"));
|
||||
Ptr<UniqueId>::Ref entryId(new UniqueId(int(result["scheduleEntryId"])));
|
||||
|
||||
|
@ -198,7 +199,7 @@ SchedulerDaemonRescheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("reschedule", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
|
||||
// now reschedule it unto itself, should fail
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
|
@ -213,7 +214,7 @@ SchedulerDaemonRescheduleTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("reschedule", parameters, result);
|
||||
CPPUNIT_ASSERT(result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(xmlRpcClient.isFault());
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,7 +222,7 @@ SchedulerDaemonRescheduleTest :: simpleTest(void)
|
|||
* A simple negative test.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonRescheduleTest :: negativeTest(void)
|
||||
RpcRescheduleTest :: negativeTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -234,6 +235,6 @@ SchedulerDaemonRescheduleTest :: negativeTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("removeFromSchedule", parameters, result);
|
||||
CPPUNIT_ASSERT(result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(xmlRpcClient.isFault());
|
||||
}
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonRemoveFromScheduleTest.h,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcRescheduleTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef SchedulerDaemonRemoveFromScheduleTest_h
|
||||
#define SchedulerDaemonRemoveFromScheduleTest_h
|
||||
#ifndef RpcRescheduleTest_h
|
||||
#define RpcRescheduleTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
|
@ -64,12 +64,12 @@ using namespace LiveSupport::Core;
|
|||
* Unit test to test the removeFromSchedule XML-RPC call.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see SchedulerDaemon
|
||||
*/
|
||||
class SchedulerDaemonRemoveFromScheduleTest : public CPPUNIT_NS::TestFixture
|
||||
class RpcRescheduleTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonRemoveFromScheduleTest);
|
||||
CPPUNIT_TEST_SUITE(RpcRescheduleTest);
|
||||
CPPUNIT_TEST(simpleTest);
|
||||
CPPUNIT_TEST(negativeTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
@ -142,5 +142,5 @@ class SchedulerDaemonRemoveFromScheduleTest : public CPPUNIT_NS::TestFixture
|
|||
} // namespace Scheduler
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // SchedulerDaemonRemoveFromScheduleTest_h
|
||||
#endif // RpcRescheduleTest_h
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonUploadTest.cxx,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcUploadPlaylistTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
|||
#include "LiveSupport/Core/UniqueId.h"
|
||||
#include "SchedulerDaemon.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||
#include "SchedulerDaemonUploadTest.h"
|
||||
#include "RpcUploadPlaylistTest.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace XmlRpc;
|
||||
|
@ -62,7 +62,7 @@ using namespace LiveSupport::Authentication;
|
|||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonUploadTest);
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(RpcUploadPlaylistTest);
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the scheduler daemon.
|
||||
|
@ -85,7 +85,7 @@ static const std::string authenticationClientConfigFileName =
|
|||
* Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonUploadTest :: configure(
|
||||
RpcUploadPlaylistTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
|
@ -103,7 +103,7 @@ SchedulerDaemonUploadTest :: configure(
|
|||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonUploadTest :: setUp(void) throw ()
|
||||
RpcUploadPlaylistTest :: setUp(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -146,7 +146,7 @@ SchedulerDaemonUploadTest :: setUp(void) throw ()
|
|||
* Clean up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonUploadTest :: tearDown(void) throw ()
|
||||
RpcUploadPlaylistTest :: tearDown(void) throw ()
|
||||
{
|
||||
Ptr<SchedulerDaemon>::Ref daemon = SchedulerDaemon::getInstance();
|
||||
|
||||
|
@ -163,7 +163,7 @@ SchedulerDaemonUploadTest :: tearDown(void) throw ()
|
|||
* Test a simple upload.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
SchedulerDaemonUploadTest :: simpleTest(void)
|
||||
RpcUploadPlaylistTest :: simpleTest(void)
|
||||
throw (CPPUNIT_NS::Exception)
|
||||
{
|
||||
XmlRpcValue parameters;
|
||||
|
@ -185,6 +185,6 @@ SchedulerDaemonUploadTest :: simpleTest(void)
|
|||
|
||||
result.clear();
|
||||
xmlRpcClient.execute("uploadPlaylist", parameters, result);
|
||||
CPPUNIT_ASSERT(!result.hasMember("errorCode"));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
}
|
||||
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/SchedulerDaemonUploadTest.h,v $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcUploadPlaylistTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef SchedulerDaemonUploadTest_h
|
||||
#define SchedulerDaemonUploadTest_h
|
||||
#ifndef RpcUploadPlaylistTest_h
|
||||
#define RpcUploadPlaylistTest_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
|
@ -64,12 +64,12 @@ using namespace LiveSupport::Core;
|
|||
* Unit test to test the uploadPlaylist XML-RPC call.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.1 $
|
||||
* @see SchedulerDaemon
|
||||
*/
|
||||
class SchedulerDaemonUploadTest : public CPPUNIT_NS::TestFixture
|
||||
class RpcUploadPlaylistTest : public CPPUNIT_NS::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonUploadTest);
|
||||
CPPUNIT_TEST_SUITE(RpcUploadPlaylistTest);
|
||||
CPPUNIT_TEST(simpleTest);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
|
@ -133,5 +133,5 @@ class SchedulerDaemonUploadTest : public CPPUNIT_NS::TestFixture
|
|||
} // namespace Scheduler
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // SchedulerDaemonUploadTest_h
|
||||
#endif // RpcUploadPlaylistTest_h
|
||||
|
Loading…
Reference in New Issue