added possibility for personalized development
(e.g. sharing a system between multiple developers)
This commit is contained in:
parent
7b09d7d251
commit
66bd876f08
130 changed files with 2742 additions and 2210 deletions
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE schedulerClientFactory [
|
||||
|
||||
<!ELEMENT schedulerClientFactory (schedulerDaemonXmlRpcClient) >
|
||||
|
||||
<!ELEMENT schedulerDaemonXmlRpcClient EMPTY >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcHost CDATA #REQUIRED >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcPort NMTOKEN #REQUIRED >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcUri CDATA #REQUIRED >
|
||||
|
||||
]>
|
||||
<schedulerClientFactory>
|
||||
<schedulerDaemonXmlRpcClient xmlRpcHost = "ls_scheduler_host"
|
||||
xmlRpcPort = "ls_scheduler_port"
|
||||
xmlRpcUri = "/ls_scheduler_xmlRpcPrefix"
|
||||
/>
|
||||
</schedulerClientFactory>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE schedulerDaemonXmlRpcClient [
|
||||
|
||||
<!ELEMENT schedulerDaemonXmlRpcClient EMPTY >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcHost CDATA #REQUIRED >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcPort NMTOKEN #REQUIRED >
|
||||
<!ATTLIST schedulerDaemonXmlRpcClient xmlRpcUri CDATA #REQUIRED >
|
||||
|
||||
]>
|
||||
<schedulerDaemonXmlRpcClient xmlRpcHost = "ls_scheduler_host"
|
||||
xmlRpcPort = "ls_scheduler_port"
|
||||
xmlRpcUri = "/ls_scheduler_xmlRpcPrefix"
|
||||
/>
|
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/include/LiveSupport/SchedulerClient/SchedulerClientInterface.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -70,12 +70,36 @@ using namespace LiveSupport::Core;
|
|||
/**
|
||||
* An interface to access the scheduler daemon as a client.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.5 $
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.6 $
|
||||
*/
|
||||
class SchedulerClientInterface
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Return the XML-RPC host the client connects to.
|
||||
*
|
||||
* @return the XML-RPC host the client connects to.
|
||||
*/
|
||||
virtual Ptr<const std::string>::Ref
|
||||
getXmlRpcHost(void) const throw () = 0;
|
||||
|
||||
/**
|
||||
* Return the XML-RPC port the client connects to.
|
||||
*
|
||||
* @return the XML-RPC port the client connects to.
|
||||
*/
|
||||
virtual unsigned int
|
||||
getXmlRpcPort(void) const throw () = 0;
|
||||
|
||||
/**
|
||||
* Return the XML-RPC URI prefix used when connecting to the scheduler.
|
||||
*
|
||||
* @return the XML-RPC URI prefix.
|
||||
*/
|
||||
virtual Ptr<const std::string>::Ref
|
||||
getXmlRpcUriPrefix(void) const throw () = 0;
|
||||
|
||||
/**
|
||||
* Return the version string for the scheduler this client
|
||||
* is connected to.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.1 $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/src/SchedulerClientFactoryTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -60,7 +60,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerClientFactoryTest);
|
|||
/**
|
||||
* The name of the configuration file for the scheduler client.
|
||||
*/
|
||||
static const std::string configFileName = "etc/schedulerClientFactory.xml";
|
||||
static const std::string configFileName = "schedulerClientFactory.xml";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
@ -78,9 +78,9 @@ SchedulerClientFactoryTest :: setUp(void) throw ()
|
|||
|
||||
// TODO: only configure, if not configured earlier
|
||||
try {
|
||||
Ptr<xmlpp::DomParser>::Ref parser(
|
||||
new xmlpp::DomParser(configFileName, true));
|
||||
const xmlpp::Document * document = parser->get_document();
|
||||
xmlpp::DomParser parser;
|
||||
const xmlpp::Document * document = getConfigDocument(parser,
|
||||
configFileName);
|
||||
const xmlpp::Element * root = document->get_root_node();
|
||||
|
||||
schedulerClientFactory->configure(*root);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.1 $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/src/SchedulerClientFactoryTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
#include "LiveSupport/Core/BaseTestMethod.h"
|
||||
#include "LiveSupport/SchedulerClient/SchedulerClientFactory.h"
|
||||
|
||||
namespace LiveSupport {
|
||||
|
@ -61,10 +62,10 @@ using namespace LiveSupport::Core;
|
|||
* Unit test for the SchedulerClientFactoryTest class.
|
||||
*
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
* @see SchedulerClientFactoryTest
|
||||
*/
|
||||
class SchedulerClientFactoryTest : public CPPUNIT_NS::TestFixture
|
||||
class SchedulerClientFactoryTest : public BaseTestMethod
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerClientFactoryTest);
|
||||
CPPUNIT_TEST(firstTest);
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/src/SchedulerDaemonXmlRpcClient.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -93,8 +93,8 @@ using namespace LiveSupport::Core;
|
|||
* <!ATTLIST schedulerDaemonXmlRpcClient xmlRpcUri CDATA #REQUIRED >
|
||||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.5 $
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.6 $
|
||||
*/
|
||||
class SchedulerDaemonXmlRpcClient :
|
||||
virtual public Configurable,
|
||||
|
@ -158,6 +158,39 @@ class SchedulerDaemonXmlRpcClient :
|
|||
throw (std::invalid_argument,
|
||||
std::logic_error);
|
||||
|
||||
/**
|
||||
* Return the XML-RPC host the client connects to.
|
||||
*
|
||||
* @return the XML-RPC host the client connects to.
|
||||
*/
|
||||
virtual Ptr<const std::string>::Ref
|
||||
getXmlRpcHost(void) const throw ()
|
||||
{
|
||||
return xmlRpcHost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the XML-RPC port the client connects to.
|
||||
*
|
||||
* @return the XML-RPC port the client connects to.
|
||||
*/
|
||||
virtual unsigned int
|
||||
getXmlRpcPort(void) const throw ()
|
||||
{
|
||||
return xmlRpcPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the XML-RPC URI prefix used when connecting to the scheduler.
|
||||
*
|
||||
* @return the XML-RPC URI prefix.
|
||||
*/
|
||||
virtual Ptr<const std::string>::Ref
|
||||
getXmlRpcUriPrefix(void) const throw ()
|
||||
{
|
||||
return xmlRpcUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version string for the scheduler this client
|
||||
* is connected to.
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/src/SchedulerDaemonXmlRpcClientTest.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -68,13 +68,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonXmlRpcClientTest);
|
|||
/**
|
||||
* The name of the configuration file for the scheduler client.
|
||||
*/
|
||||
static const std::string configFileName = "etc/schedulerDaemonXmlRpcClient.xml";
|
||||
|
||||
/**
|
||||
* The name of the configuration file for the authentication client factory.
|
||||
*/
|
||||
static const std::string authenticationClientConfigFileName =
|
||||
"etc/authenticationClient.xml";
|
||||
static const std::string configFileName = "schedulerDaemonXmlRpcClient.xml";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
@ -82,22 +76,6 @@ static const std::string authenticationClientConfigFileName =
|
|||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------ * Configure a Configurable with an XML file.
|
||||
*----------------------------------------------------------------------------*/void
|
||||
SchedulerDaemonXmlRpcClientTest :: configure(
|
||||
Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
xmlpp::exception)
|
||||
{
|
||||
Ptr<xmlpp::DomParser>::Ref parser(new xmlpp::DomParser(fileName, true));
|
||||
const xmlpp::Document * document = parser->get_document();
|
||||
const xmlpp::Element * root = document->get_root_node();
|
||||
|
||||
configurable->configure(*root);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Set up the test environment
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -105,9 +83,9 @@ void
|
|||
SchedulerDaemonXmlRpcClientTest :: setUp(void) throw ()
|
||||
{
|
||||
try {
|
||||
Ptr<xmlpp::DomParser>::Ref parser(
|
||||
new xmlpp::DomParser(configFileName, true));
|
||||
const xmlpp::Document * document = parser->get_document();
|
||||
xmlpp::DomParser parser;
|
||||
const xmlpp::Document * document = getConfigDocument(parser,
|
||||
configFileName);
|
||||
const xmlpp::Element * root = document->get_root_node();
|
||||
|
||||
schedulerClient.reset(new SchedulerDaemonXmlRpcClient());
|
||||
|
@ -121,7 +99,11 @@ SchedulerDaemonXmlRpcClientTest :: setUp(void) throw ()
|
|||
XmlRpc::XmlRpcValue parameters;
|
||||
XmlRpc::XmlRpcValue result;
|
||||
|
||||
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
|
||||
XmlRpc::XmlRpcClient xmlRpcClient(
|
||||
schedulerClient->getXmlRpcHost()->c_str(),
|
||||
schedulerClient->getXmlRpcPort(),
|
||||
schedulerClient->getXmlRpcUriPrefix()->c_str(),
|
||||
false);
|
||||
|
||||
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
|
||||
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
|
||||
|
@ -147,7 +129,11 @@ SchedulerDaemonXmlRpcClientTest :: tearDown(void) throw ()
|
|||
XmlRpc::XmlRpcValue parameters;
|
||||
XmlRpc::XmlRpcValue result;
|
||||
|
||||
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
|
||||
XmlRpc::XmlRpcClient xmlRpcClient(
|
||||
schedulerClient->getXmlRpcHost()->c_str(),
|
||||
schedulerClient->getXmlRpcPort(),
|
||||
schedulerClient->getXmlRpcUriPrefix()->c_str(),
|
||||
false);
|
||||
|
||||
parameters["sessionId"] = sessionId->getId();
|
||||
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/schedulerClient/src/SchedulerDaemonXmlRpcClientTest.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
#include "LiveSupport/Core/BaseTestMethod.h"
|
||||
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
|
||||
#include "SchedulerDaemonXmlRpcClient.h"
|
||||
|
||||
|
@ -62,11 +63,11 @@ using namespace LiveSupport::Authentication;
|
|||
/**
|
||||
* Unit test for the SchedulerDaemonXmlRpcClient class.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.5 $
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.6 $
|
||||
* @see SchedulerDaemonXmlRpcClient
|
||||
*/
|
||||
class SchedulerDaemonXmlRpcClientTest : public CPPUNIT_NS::TestFixture
|
||||
class SchedulerDaemonXmlRpcClientTest : public BaseTestMethod
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SchedulerDaemonXmlRpcClientTest);
|
||||
CPPUNIT_TEST(getVersionTest);
|
||||
|
@ -88,20 +89,6 @@ class SchedulerDaemonXmlRpcClientTest : public CPPUNIT_NS::TestFixture
|
|||
*/
|
||||
Ptr<SessionId>::Ref sessionId;
|
||||
|
||||
/**
|
||||
* Configure a configurable with an XML file.
|
||||
*
|
||||
* @param configurable configure this
|
||||
* @param fileName the name of the XML file to configure with.
|
||||
* @exception std::invalid_argument on configuration errors.
|
||||
* @exception xmlpp::exception on XML parsing errors.
|
||||
*/
|
||||
void
|
||||
configure(Ptr<Configurable>::Ref configurable,
|
||||
const std::string & fileName)
|
||||
throw (std::invalid_argument,
|
||||
xmlpp::exception);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue