added possibility for personalized development

(e.g. sharing a system between multiple developers)
This commit is contained in:
maroy 2005-04-08 11:56:37 +00:00
parent 7b09d7d251
commit 66bd876f08
130 changed files with 2742 additions and 2210 deletions

355
livesupport/bin/user_setup.sh Executable file
View File

@ -0,0 +1,355 @@
#!/bin/sh
#-------------------------------------------------------------------------------
# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LiveSupport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/user_setup.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This script configures the environment for a developer.
#
# Invoke as:
# ./bin/user_setup.sh
#
# To get usage help, try the -h option
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Determine directories, files
#-------------------------------------------------------------------------------
reldir=`dirname $0`/..
basedir=`cd $reldir; pwd;`
bindir=$basedir/bin
etcdir=$basedir/etc
docdir=$basedir/doc
tmpdir=$basedir/tmp
toolsdir=$basedir/tools
modules_dir=$basedir/modules
products_dir=$basedir/products
usrdir=`cd $basedir/usr; pwd;`
#-------------------------------------------------------------------------------
# Print the usage information for this script.
#-------------------------------------------------------------------------------
printUsage()
{
echo "LiveSupport install script.";
echo "parameters";
echo "";
echo " -g, --apache-group The group the apache daemon runs as.";
echo " [default: apache]";
echo " -h, --help Print this message and exit.";
echo "";
}
#-------------------------------------------------------------------------------
# Process command line parameters
#-------------------------------------------------------------------------------
CMD=${0##*/}
opts=$(getopt -o g:h -l apache-group:,help -n $CMD -- "$@") || exit 1
eval set -- "$opts"
while true; do
case "$1" in
-g|--apache-group)
apache_group=$2;
shift; shift;;
-h|--help)
printUsage;
exit 0;;
--)
shift;
break;;
*)
echo "Unrecognized option $1.";
printUsage;
exit 1;
esac
done
if [ "x$apache_group" == "x" ]; then
apache_group=apache;
fi
scheduler_base_port=3344
user=`whoami`
hostname=`hostname -f`
http_port=80
scheduler_port=`expr $scheduler_base_port + $UID`
dbserver=localhost
database=LiveSupport-$user
dbuser=test
dbpassword=test
homedir=$HOME
configdir=$homedir/.livesupport
htmldir=$homedir/public_html
echo "Configuring LiveSupport development environment for user $user.";
echo "";
echo "Using the following installation parameters:";
echo "";
echo " host name: $hostname";
echo " web server port: $http_port";
echo " scheduler port: $scheduler_port";
echo " database server: $dbserver";
echo " database: $database";
echo " database user: $dbuser";
echo " database user password: $dbpassword";
echo " apache daemon group: $apache_group";
echo " home directory: $homedir";
echo " configuration directory: $configdir";
echo " web base directory: $htmldir";
echo ""
# check for the apache group to be a real group
group_tmp_file=/tmp/ls_group_check.$$
touch $group_tmp_file
test_result=`chgrp $apache_group $group_tmp_file 2> /dev/null`
if [ $? != 0 ]; then
rm -f $group_tmp_file;
echo "Unable to use apache deamon group $apache_group.";
echo "Please check if $apache_group is a correct user group.";
exit 1;
fi
rm -f $group_tmp_file;
#-------------------------------------------------------------------------------
# The details of installation
#-------------------------------------------------------------------------------
installdir=$usrdir
ls_php_host=$hostname
ls_php_port=$http_port
ls_php_urlPrefix=~$user/livesupport
ls_alib_xmlRpcPrefix="xmlrpc/xrLocStor.php"
ls_storage_xmlRpcPrefix="xmlrpc/xrLocStor.php"
ls_dbserver=$dbserver
ls_dbuser=$dbuser
ls_dbpassword=$dbpassword
ls_database=$database
ls_scheduler_host=$hostname
ls_scheduler_port=$scheduler_port
ls_scheduler_urlPrefix=
ls_scheduler_xmlRpcPrefix=RC2
# replace / characters with a \/ sequence, for sed below
# the sed statement is really "s/\//\\\\\//g", but needs escaping because of
# bash, hence the extra '\' characters
installdir_s=`echo $installdir | sed -e "s/\//\\\\\\\\\//g"`
ls_storage_xmlRpcPrefix_s=`echo $ls_storage_xmlRpcPrefix | \
sed -e "s/\//\\\\\\\\\//g"`
ls_alib_xmlRpcPrefix_s=`echo $ls_alib_xmlRpcPrefix | sed -e "s/\//\\\\\\\\\//g"`
ls_php_urlPrefix_s=`echo $ls_php_urlPrefix | sed -e "s/\//\\\\\\\\\//g"`
ls_scheduler_urlPrefix_s=`echo $ls_scheduler_urlPrefix | \
sed -e "s/\//\\\\\\\\\//g"`
ls_scheduler_xmlRpcPrefix_s=`echo $ls_scheduler_xmlRpcPrefix | \
sed -e "s/\//\\\\\\\\\//g"`
replace_sed_string="s/ls_install_dir/$installdir_s/; \
s/ls_dbuser/$ls_dbuser/; \
s/ls_dbpassword/$ls_dbpassword/; \
s/ls_dbserver/$ls_dbserver/; \
s/ls_database/$ls_database/; \
s/ls_storageUrlPath/\/$ls_php_urlPrefix_s\/storageServer\/var/; \
s/ls_php_urlPrefix/$ls_php_urlPrefix_s/; \
s/ls_storage_xmlRpcPrefix/$ls_storage_xmlRpcPrefix_s/; \
s/ls_alib_xmlRpcPrefix/$ls_alib_xmlRpcPrefix_s/; \
s/ls_php_host/$ls_php_host/; \
s/ls_php_port/$ls_php_port/; \
s/ls_archiveUrlPath/\/$ls_php_urlPrefix_s\/archiveServer\/var/; \
s/ls_scheduler_urlPrefix/$ls_scheduler_urlPrefix_s/; \
s/ls_scheduler_xmlRpcPrefix/$ls_scheduler_xmlRpcPrefix_s/; \
s/ls_scheduler_host/$ls_scheduler_host/; \
s/ls_scheduler_port/$ls_scheduler_port/;"
#-------------------------------------------------------------------------------
# Function to check for the existence of an executable on the PATH
#
# @param $1 the name of the exectuable
# @return 0 if the executable exists on the PATH, non-0 otherwise
#-------------------------------------------------------------------------------
check_exe() {
if [ -x "`which $1 2> /dev/null`" ]; then
echo "Exectuable $1 found...";
return 0;
else
echo "Exectuable $1 not found...";
return 1;
fi
}
#-------------------------------------------------------------------------------
# Function to check for a PEAR module
#
# @param $1 the name of the PEAR module
# @return 0 if the module is available, non-0 otherwise
#-------------------------------------------------------------------------------
check_pear_module() {
test_result=`pear info $1`
if [ $? = 0 ]; then
echo "PEAR module $1 found...";
return 0;
else
echo "PEAR module $1 not found...";
return 1;
fi
}
#-------------------------------------------------------------------------------
# Check for required tools
#-------------------------------------------------------------------------------
echo "Checking for required tools..."
check_exe "sed" || exit 1;
check_exe "php" || exit 1;
check_exe "pear" || exit 1;
check_pear_module "DB" || exit 1;
check_pear_module "Calendar" || exit 1;
check_pear_module "File" || exit 1;
check_pear_module "File_Find" || exit 1;
check_pear_module "HTML_Common" || exit 1;
check_pear_module "HTML_QuickForm" || exit 1;
check_pear_module "XML_Beautifier" || exit 1;
check_pear_module "XML_Parser" || exit 1;
check_pear_module "XML_RPC" || exit 1;
check_pear_module "XML_Serializer" || exit 1;
check_pear_module "XML_Util" || exit 1;
#-------------------------------------------------------------------------------
# Customize the configuration files with the appropriate values
#-------------------------------------------------------------------------------
echo "Customizing configuration files..."
mkdir -p $configdir
cat $modules_dir/storageServer/var/conf_only.php.template \
| sed -e "$replace_sed_string" \
> $configdir/storageServer.conf.php
cat $modules_dir/archiveServer/var/conf_only.php.template \
| sed -e "$replace_sed_string" \
> $configdir/archiveServer.conf.php
cat $modules_dir/db/etc/connectionManagerFactory.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/connectionManagerFactory.xml
cat $modules_dir/db/etc/simpleConnectionManager.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/simpleConnectionManager.xml
cat $modules_dir/schedulerClient/etc/schedulerClientFactory.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/schedulerClientFactory.xml
cat $modules_dir/schedulerClient/etc/schedulerDaemonXmlRpcClient.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/schedulerDaemonXmlRpcClient.xml
cat $modules_dir/storage/etc/webAuthenticationClient.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/webAuthenticationClient.xml
cat $modules_dir/storage/etc/webStorage.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/webStorage.xml
cat $products_dir/scheduler/etc/scheduler.xml.template \
| sed -e "$replace_sed_string" \
> $configdir/scheduler.xml
#-------------------------------------------------------------------------------
# Create the public html directory, and links to the PHP directories
#-------------------------------------------------------------------------------
echo "Creating public HTML directory and links to web interfaces..."
mkdir -p $htmldir
rm -f $htmldir/livesupport
ln -s $modules_dir $htmldir/livesupport
#-------------------------------------------------------------------------------
# Setup directory permissions
#-------------------------------------------------------------------------------
echo "Setting up directory permissions..."
chgrp $apache_group $modules_dir/archiveServer/var/stor
chgrp $apache_group $modules_dir/archiveServer/var/access
chgrp $apache_group $modules_dir/archiveServer/var/trans
chgrp $apache_group $modules_dir/archiveServer/var/stor/buffer
chmod g+sw $modules_dir/archiveServer/var/stor
chmod g+sw $modules_dir/archiveServer/var/access
chmod g+sw $modules_dir/archiveServer/var/trans
chmod g+sw $modules_dir/archiveServer/var/stor/buffer
chgrp $apache_group $modules_dir/storageServer/var/stor
chgrp $apache_group $modules_dir/storageServer/var/access
chgrp $apache_group $modules_dir/storageServer/var/trans
chgrp $apache_group $modules_dir/storageServer/var/stor/buffer
chmod g+sw $modules_dir/storageServer/var/stor
chmod g+sw $modules_dir/storageServer/var/access
chmod g+sw $modules_dir/storageServer/var/trans
chmod g+sw $modules_dir/storageServer/var/stor/buffer
chgrp $apache_group $modules_dir/htmlUI/var/templates_c
chgrp $apache_group $modules_dir/htmlUI/var/html/img
chmod g+sw $modules_dir/htmlUI/var/templates_c
chmod g+sw $modules_dir/htmlUI/var/html/img
#-------------------------------------------------------------------------------
# Say goodbye
#-------------------------------------------------------------------------------
echo "";
echo "The HTML user interface for the LiveSupport development environment";
echo "for user $user is available at:";
echo "http://$ls_php_host:$ls_php_port/$ls_php_urlPrefix/htmlUI/var";
echo "";
echo "Done."

248
livesupport/bin/user_setup_db.sh Executable file
View File

@ -0,0 +1,248 @@
#!/bin/sh
#-------------------------------------------------------------------------------
# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LiveSupport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/user_setup_db.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This script sets up the development environment for a user.
#
# Invoke as:
# ./bin/user_setup_root.sh
#
# To get usage help, try the -h option
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Determine directories, files
#-------------------------------------------------------------------------------
reldir=`dirname $0`/..
basedir=`cd $reldir; pwd;`
bindir=$basedir/bin
etcdir=$basedir/etc
docdir=$basedir/doc
tmpdir=$basedir/tmp
toolsdir=$basedir/tools
modules_dir=$basedir/modules
products_dir=$basedir/products
usrdir=`cd $basedir/usr; pwd;`
#-------------------------------------------------------------------------------
# Print the usage information for this script.
#-------------------------------------------------------------------------------
printUsage()
{
echo "LiveSupport development environment setup script.";
echo "parameters:";
echo "";
echo " -g, --apache-group The group the apache daemon runs as.";
echo " [default: apache]";
echo " -u, --user The user to set up the environment for.";
echo " Required parameter.";
echo " -h, --help Print this message and exit.";
echo "";
}
#-------------------------------------------------------------------------------
# Process command line parameters
#-------------------------------------------------------------------------------
CMD=${0##*/}
opts=$(getopt -o g:hu: -l apache-group:,help,user: -n $CMD -- "$@") || exit 1
eval set -- "$opts"
while true; do
case "$1" in
-g|--apache-group)
apache_group=$2;
shift; shift;;
-h|--help)
printUsage;
exit 0;;
-u|--user)
user=$2;
shift; shift;;
--)
shift;
break;;
*)
echo "Unrecognized option $1.";
printUsage;
exit 1;
esac
done
if [ "x$user" == "x" ]; then
echo "Required parameter user missing.";
printUsage;
exit 1;
fi
if [ "x$apache_group" == "x" ]; then
apache_group=apache;
fi
dbserver=localhost;
database=LiveSupport-$user;
dbuser=test;
dbpassword=test;
echo "Configuring LiveSupport development environment.";
echo "";
echo "Using the following parameters:";
echo "";
echo " configuring for user: $user";
echo " database server: $dbserver";
echo " database: $database";
echo " database user: $dbuser";
echo " database user password: $dbpassword";
echo " apache daemon group: $apache_group";
echo ""
# check for the apache group to be a real group
group_tmp_file=/tmp/ls_group_check.$$
touch $group_tmp_file
test_result=`chgrp $apache_group $group_tmp_file 2> /dev/null`
if [ $? != 0 ]; then
rm -f $group_tmp_file;
echo "Unable to use apache deamon group $apache_group.";
echo "Please check if $apache_group is a correct user group.";
exit 1;
fi
rm -f $group_tmp_file;
#-------------------------------------------------------------------------------
# The details of installation
#-------------------------------------------------------------------------------
ls_dbserver=$dbserver
ls_dbuser=$dbuser
ls_dbpassword=$dbpassword
ls_database=$database
postgres_user=postgres
replace_sed_string="s/ls_dbuser/$ls_dbuser/; \
s/ls_dbpassword/$ls_dbpassword/; \
s/ls_dbserver/$ls_dbserver/; \
s/ls_database/$ls_database/;"
#-------------------------------------------------------------------------------
# Function to check for the existence of an executable on the PATH
#
# @param $1 the name of the exectuable
# @return 0 if the executable exists on the PATH, non-0 otherwise
#-------------------------------------------------------------------------------
check_exe() {
if [ -x "`which $1 2> /dev/null`" ]; then
echo "Exectuable $1 found...";
return 0;
else
echo "Exectuable $1 not found...";
return 1;
fi
}
#-------------------------------------------------------------------------------
# Check to see if this script is being run as root
#-------------------------------------------------------------------------------
if [ `whoami` != "root" ]; then
echo "Please run this script as root.";
exit ;
fi
#-------------------------------------------------------------------------------
# Check for required tools
#-------------------------------------------------------------------------------
echo "Checking for required tools..."
check_exe "sed" || exit 1;
check_exe "psql" || exit 1;
check_exe "odbcinst" || exit 1;
#-------------------------------------------------------------------------------
# Create the necessary database user and database itself
#-------------------------------------------------------------------------------
echo "Creating database and database user...";
# FIXME: the below might not work for remote databases
su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \
ENCRYPTED PASSWORD '$ls_dbpassword' \
CREATEDB NOCREATEUSER;\" \
| psql -h $ls_dbserver template1" \
|| echo "Couldn't create database user $ls_dbuser.";
su - $postgres_user -c "echo \"CREATE DATABASE \\\"$ls_database\\\" \
OWNER $ls_dbuser ENCODING 'utf-8';\" \
| psql -h $ls_dbserver template1" \
|| echo "Couldn't create database $ls_database.";
# TODO: check for the success of these operations somehow
#-------------------------------------------------------------------------------
# Create the ODBC data source and driver
#-------------------------------------------------------------------------------
echo "Creating ODBC data source and driver...";
odbcinst_template=$products_dir/scheduler/etc/odbcinst_template
odbc_template=$products_dir/scheduler/etc/odbc_template
odbc_template_tmp=/tmp/odbc_template.$$
# check for an existing PostgreSQL ODBC driver, and only install if necessary
odbcinst_res=`odbcinst -q -d | grep "\[PostgreSQL\]"`
if [ "x$odbcinst_res" == "x" ]; then
echo "Registering ODBC PostgreSQL driver...";
odbcinst -i -d -v -f $odbcinst_template || exit 1;
fi
echo "Registering LiveSupport ODBC data source...";
cat $odbc_template | sed -e "$replace_sed_string" > $odbc_template_tmp
odbcinst -i -s -l -f $odbc_template_tmp || exit 1;
rm -f $odbc_template_tmp
#-------------------------------------------------------------------------------
# Call the script that will do the user-specific setup.
#-------------------------------------------------------------------------------
su - $user $bindir/user_setup.sh -g $apache_group
#-------------------------------------------------------------------------------
# Say goodbye
#-------------------------------------------------------------------------------
echo "Done."

View File

@ -13,7 +13,7 @@ Development Loan Fund</a>, under the GNU <a
href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
<ul>
<li>Author: $Author: maroy $</li>
<li>Version: $Revision: 1.14 $</li>
<li>Version: $Revision: 1.15 $</li>
<li>Location: $Source:
/home/cvs/livesupport/doc/gettingStarted.html,v $</li>
</ul>
@ -36,6 +36,8 @@ development environment.<br>
<li>set up additional system resources</li>
<li>check out the sources</li>
<li>set up tools used by LiveSupport</li>
<li>personalize your development environment<br>
</li>
</ul>
<h2>Install development tools</h2>
Install all the tools needed for the development of LiveSupport. Please
@ -56,16 +58,6 @@ database, and an ODBC
Data Source accessible to it through <a href="http://www.unixodbc.org/">unixODBC</a>.
Please refer to the documentation of these tools to set them up.<br>
<br>
LiveSupport expects an ODBC Data Source with the following parameters:<br>
<ul>
<li>DSN: <code>LiveSupport-test</code></li>
<li>username: <code>test</code></li>
<li>password: <code>test</code></li>
</ul>
This data source should point to a PostgreSQL instance. Only one
developer at the time should access this datasource, as the test suites
regularly create and destroy database tables.<br>
<br>
The test environment assumes that it can connect to the PostgreSQL
database as localhost via a TCP/IP connection, as the user test. To
achieve this access, please make sure to edit <code>postgresql.conf</code>
@ -114,24 +106,6 @@ list</code> and installed by e.g.: <code>pear install DB</code>):</li>
</ul>
<!-- <li><a href="http:///"></a></li>-->
</ul>
Please, check settings in <code>var/conf.php</code> files in both
storageServer and archiveServer modules and create two
symlinks with name corresponding to 'URL configuration' part of
<code>var/conf.php</code> files - example for default values:
<ul>
<li> <code>http://localhost:80/livesupportStorageServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/storageServer/var</code>
directory </li>
<li> <code>http://localhost:80/livesupportArchiveServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/archiveServer/var</code>
directory </li>
<li> <code>http://localhost:80/YOUR-CHOICE/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/htmlUI/var</code>
directory </li>
</ul>
Please make &lt;livesupport-cvs&gt;/modules/htmlUI/var/templates_c/ and
&lt;livesupport-cvs&gt;/modules/htmlUI/var/html/img/ writable for
apache.
<h2>Check out the sources</h2>
The LiveSupport development directory tree can be accessed via
anonymous <a href="https://www.cvshome.org/">CVS</a>, using the
@ -164,6 +138,82 @@ The execution of this command will take a while, as all the supporting
libraries and tools are compiled and installed to the <code>livesupport/usr</code>
directory. Please note that nothing is installed outside of the
LiveSupport directory structure.<br>
<h2>Personalize your LiveSupport development environment</h2>
The LiveSupport development environment can be run in two ways: either
only one developer actively doing LiveSupport development on the
system, or multiple developers sharing a system for LiveSupport
development. In the former case, only one database instance, scheduler
daemon and apache (XML-RPC and HTTP/HTML) entry point is needed. In the
latter case, each user will have their own database instance, scheduler
daemon and apache entry points.<br>
<h3>Only one developer doing development on the system<br>
</h3>
If only one developer is doing development on the system, there is no
need to personalize the resources used by the development environment.
The following resources are expected on the system.<br>
<br>
LiveSupport expects an ODBC Data Source with the following parameters:<br>
<ul>
<li>DSN: <code>LiveSupport-test</code></li>
<li>username: <code>test</code></li>
<li>password: <code>test</code></li>
</ul>
This data source should point to a PostgreSQL instance of the same
name. Only one
developer at the time should access this datasource, as the test suites
regularly create and destroy database tables.<br>
<br>
The scheduler daemon will use the port 3344.<br>
<br>
Please, check settings in <code>var/conf.php</code> files in both
storageServer and archiveServer modules and create two
symlinks with name corresponding to 'URL configuration' part of
<code>var/conf.php</code> files - example for default values:
<ul>
<li> <code>http://localhost:80/livesupportStorageServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/storageServer/var</code>
directory </li>
<li> <code>http://localhost:80/livesupportArchiveServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/archiveServer/var</code>
directory </li>
<li> <code>http://localhost:80/YOUR-CHOICE/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/htmlUI/var</code>
directory </li>
</ul>
Please make <code>&lt;livesupport-cvs&gt;/modules/htmlUI/var/templates_c/</code>
and
<code>&lt;livesupport-cvs&gt;/modules/htmlUI/var/html/img/</code>
writable for
apache.
<h3>Multiple developers doing development on the system</h3>
In case multiple developers are sharing a system for LiveSupport
development, each resource has to be personalized. Please run the <code>livesupport/bin/user_setup_db.sh</code>
script as <code>root</code> to make the appropriate steps for
personalization. The script expects the name of the user as a mandatory
parameter, e.g. invoke as:<br>
<br>
<pre><code>cd livesupport<br>./bin/user_setup_db.sh --user ls_developer_user<br></code></pre>
<br>
The script will set up the following resources:<br>
<ul>
<li>a PostgreSQL user named <code>test</code> with the password <code>test</code>
(if it does not exist)</li>
<li>a PostgreSQL database named <code>LiveSupport-ls_developer_user</code></li>
<li>an ODBC data source of the same name</li>
<li>define a user-specific port for the scheduler daemon<br>
</li>
<li>make certain the directories in the development environment are
writable by <code>apache</code></li>
<li>create personalized configuration files in <code>~/.livesupport/</code></li>
<li>create symlinks from <code>~/public_html/</code> to XML-RPC and
HTML entry points</li>
</ul>
After running the above script, the livesupport development environment
for the specified user will be unique on the system, and will not
conflict with resources used by other developers. For example, the
LiveSupport HTML user interface for the user will be reachable at:<br>
<br>
<pre><code>http://localhost/~ls_developer_user/livesupport/htmlUI/var<br><br></code></pre>
<h1>Ready to roll</h1>
With the above steps completed, the LiveSupport modules and products
are ready to be compiled and developed further. Have fun!<br>

View File

@ -22,8 +22,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: tomas $
Version : $Revision: 1.9 $
Author : $Author: maroy $
Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/conf.php,v $
------------------------------------------------------------------------------*/
@ -54,6 +54,9 @@
* <dt>archiveUrlHost, archiveUrlPort<dd>host and port of archiveServer
* </dl>
*/
// these are the default values for the config
$config = array(
/* ================================================== basic configuration */
'dsn' => array(
@ -113,4 +116,22 @@ $config = array(
'RootNode' => 'RootNode',
'tmpRootPass' => 'q',
);
?>
// see if a ~/.livesupport/archiveServer.conf.php exists, and
// overwrite the settings from there if any
$this_file = $_SERVER["SCRIPT_FILENAME"];
$fileowner_id = fileowner($this_file);
$fileowner_array = posix_getpwuid($fileowner_id);
$fileowner_homedir = $fileowner_array['dir'];
$home_conf = $fileowner_homedir . '/.livesupport/archiveServer.conf.php';
if (file_exists($home_conf)) {
$default_config = $config;
include $home_conf;
$user_config = $config;
$config = $user_config + $default_config;
}
?>

View File

@ -0,0 +1,80 @@
<?php
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/conf_only.php.template,v $
------------------------------------------------------------------------------*/
/**
* \file conf.php
* archiveServer configuration file
*/
/**
* configuration structure:
*
* <dl>
* <dt>dsn<dd> datasource setting
* <dt>tblNamePrefix <dd>prefix for table names in the database
* <dt>authCookieName <dd>secret token cookie name
* <dt>storageDir <dd>main directory for storing binary media files
* <dt>bufferDir <dd>directory for temporary files
* <dt>transDir <dd>directory for incomplete transferred files
* <dt>accessDir <dd>directory for symlinks to accessed files
* <dt>isArchive <dd>local/central flag
* <dt>storageUrlPath<dd>path-URL-part of storageServer base dir
* (on central archive side: storage=archive)
* <dt>storageXMLRPC<dd>XMLRPC server script address relative to storageUrlPath
* <dt>storageUrlHost, storageUrlPort<dd>host and port of storageServer
* <dt>archiveUrlPath<dd>path-URL-part of archiveServer base dir
* <dt>archiveXMLRPC<dd>XMLRPC server script address relative to archiveUrlPath
* <dt>archiveUrlHost, archiveUrlPort<dd>host and port of archiveServer
* </dl>
*/
$config = array(
/* ================================================== basic configuration */
'dsn' => array(
'username' => 'ls_dbuser',
'password' => 'ls_dbpassword',
'hostspec' => 'ls_dbserver',
'phptype' => 'pgsql',
'database' => 'ls_database',
),
/* ==================================================== URL configuration */
// on central archive side: archive is the storage !
'storageUrlPath' => 'ls_storageUrlPath',
'storageXMLRPC' => 'xmlrpc/xrArchive.php',
'storageUrlHost' => 'ls_php_host',
'storageUrlPort' => ls_php_port,
// have to be another remote archive:
#'archiveUrlPath' => 'ls_archiveUrlPath',
#'archiveXMLRPC' => 'xmlrpc/xrArchive.php',
#'archiveUrlHost' => 'ls_php_host',
#'archiveUrlPort' => ls_php_port,
);
?>

View File

@ -20,8 +20,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: fgerlits $
# Version : $Revision: 1.25 $
# Author : $Author: maroy $
# Version : $Revision: 1.26 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/Makefile.in,v $
#
# @configure_input@
@ -125,7 +125,8 @@ CORE_LIB_OBJS = ${TMP_DIR}/UniqueId.o \
${TMP_DIR}/Md5.o \
${TMP_DIR}/XmlRpcTools.o \
${TMP_DIR}/XmlRpcException.o \
${TMP_DIR}/TagConversion.o
${TMP_DIR}/TagConversion.o \
${TMP_DIR}/BaseTestMethod.o
TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \
${TMP_DIR}/UniqueIdTest.o \

View File

@ -20,8 +20,8 @@ dnl along with LiveSupport; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl
dnl Author : $Author: fgerlits $
dnl Version : $Revision: 1.8 $
dnl Author : $Author: maroy $
dnl Version : $Revision: 1.9 $
dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/etc/configure.ac,v $
dnl-----------------------------------------------------------------------------
@ -35,14 +35,14 @@ dnl-----------------------------------------------------------------------------
AC_INIT(Core, 1.0, bugs@campware.org)
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL])
AC_REVISION($Revision: 1.8 $)
AC_REVISION($Revision: 1.9 $)
AC_CONFIG_SRCDIR(../src/UniqueId.cxx)
AC_CONFIG_HEADERS(configure.h)
AC_PROG_CXX()
AC_CHECK_HEADERS(getopt.h sys/time.h time.h)
AC_CHECK_HEADERS(getopt.h sys/time.h time.h sys/types.h pwd.h)
PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.6.0])
AC_SUBST(LIBXMLPP_CFLAGS)

View File

@ -0,0 +1,125 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/include/LiveSupport/Core/BaseTestMethod.h,v $
------------------------------------------------------------------------------*/
#ifndef LiveSupport_Core_BaseTestMethod_h
#define LiveSupport_Core_BaseTestMethod_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <stdexcept>
#include <libxml++/libxml++.h>
#include <cppunit/extensions/HelperMacros.h>
namespace LiveSupport {
namespace Core {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* A base class for the test methods.
* Subclass this class for the methods that use configuration files.
* This class gives helpers to access the configuration files
* from various locations (~/.livesupport, ./etc)
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class BaseTestMethod : public CPPUNIT_NS::TestFixture
{
private:
/**
* Get the current working directory.
*
* @return the current working directory.
*/
static std::string
getCwd(void) throw ();
public:
/**
* Return the full path for a configuration file.
*
* @param configFileName the name of the configuration file.
* @return the full path of the configuration file, found in the
* appropriate directory.
* @exception std::invalid_argument if the specified config file
* does not exist.
*/
static std::string
getConfigFile(const std::string configFileName)
throw (std::invalid_argument);
/**
* Helper function to return an XML Document object based on
* a config file name.
* First, the proper location of the config file is found.
*
* @param parser the XML DOM parser to use for parsing.
* @param configFileName the name of the configuration file.
* @return an XML document, containing the contents of the
* config file
* @exception std::invalid_argument if the configuration file
* could not be found
* @exception std::exception on parsing errors.
*/
static const xmlpp::Document *
getConfigDocument(xmlpp::DomParser & parser,
const std::string configFileName)
throw (std::invalid_argument,
std::exception);
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Core
} // namespace LiveSupport
#endif // LiveSupport_Core_BaseTestMethod_h

View File

@ -0,0 +1,144 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/BaseTestMethod.cxx,v $
------------------------------------------------------------------------------*/
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#else
#error need sys/types.h
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#else
#error need pwd.h
#endif
#include <fstream>
#include "LiveSupport/Core/BaseTestMethod.h"
using namespace LiveSupport::Core;
/* =================================================== local data structures */
/* ================================================ local constants & macros */
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Return the current working directory
*----------------------------------------------------------------------------*/
std::string
BaseTestMethod :: getCwd(void) throw ()
{
size_t size = 100;
char * buffer;
while (true) {
buffer = new char[size];
if (getcwd(buffer, size)) {
break;
}
delete[] buffer;
if (errno != ERANGE) {
return "";
}
size *= 2;
}
std::string cwd(buffer);
delete[] buffer;
return cwd;
}
/*------------------------------------------------------------------------------
* Return the full path for a configuration file.
*----------------------------------------------------------------------------*/
std::string
BaseTestMethod :: getConfigFile(const std::string configFileName)
throw (std::invalid_argument)
{
std::string fileName;
std::ifstream file;
// first, try with ~/.livesupport/configFileName
struct passwd * pwd = getpwnam(getlogin());
if (pwd) {
fileName += pwd->pw_dir;
fileName += "/.livesupport/" + configFileName;
file.open(fileName.c_str());
if (file.good()) {
file.close();
return fileName;
}
file.close();
file.clear();
}
// second, try with ./etc/configFileName
fileName = getCwd() + "/etc/" + configFileName;
file.open(fileName.c_str());
if (file.good()) {
file.close();
return fileName;
}
file.close();
throw std::invalid_argument("can't find config file " + configFileName);
}
/*------------------------------------------------------------------------------
* Return a configuration document
*----------------------------------------------------------------------------*/
const xmlpp::Document *
BaseTestMethod :: getConfigDocument(xmlpp::DomParser & parser,
const std::string configFileName)
throw (std::invalid_argument,
std::exception)
{
std::string realFileName = getConfigFile(configFileName);
parser.set_validate();
parser.parse_file(realFileName);
return parser.get_document();
}

View File

@ -21,7 +21,7 @@
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.8 $
# Version : $Revision: 1.9 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/etc/Makefile.in,v $
#
# @configure_input@
@ -43,6 +43,7 @@ BASE_DIR = @builddir@
DOC_DIR = ${BASE_DIR}/doc
DOXYGEN_DIR = ${DOC_DIR}/doxygen
COVERAGE_DIR = ${DOC_DIR}/coverage
BIN_DIR = ${BASE_DIR}/bin
ETC_DIR = ${BASE_DIR}/etc
INCLUDE_DIR = ${BASE_DIR}/include
LIB_DIR = ${BASE_DIR}/lib
@ -73,9 +74,9 @@ TEST_RESULTS = ${DOC_DIR}/testResults.xml
# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR
TEST_XSLT = ../etc/testResultToHtml.xsl
DB_LIB = livesupport_db
DB_LIB_FILE = ${LIB_DIR}/lib${DB_LIB}.a
TEST_RUNNER = ${TMP_DIR}/testRunner
DB_LIB = livesupport_db
DB_LIB_FILE = ${LIB_DIR}/lib${DB_LIB}.a
TEST_RUNNER = ${TMP_DIR}/testRunner
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
@ -108,9 +109,9 @@ LDFLAGS = @LDFLAGS@ -pthread \
DB_LIB_OBJS = ${TMP_DIR}/SimpleConnectionManager.o \
${TMP_DIR}/ConnectionManagerFactory.o \
${TMP_DIR}/Conversion.o
TEST_RUNNER_OBJS = ${TMP_DIR}/SimpleConnectionManagerTest.o \
${TMP_DIR}/ConnectionManagerFactoryTest.o \
${TMP_DIR}/TestRunner.o
TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \
${TMP_DIR}/SimpleConnectionManagerTest.o \
${TMP_DIR}/ConnectionManagerFactoryTest.o
TEST_RUNNER_LIBS = -l${DB_LIB} -l${CORE_LIB} -lcppunit -ldl

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE connectionManagerFactory [
<!ELEMENT connectionManagerFactory (simpleConnectionManager) >
<!ELEMENT simpleConnectionManager EMPTY >
<!ATTLIST simpleConnectionManager dsn CDATA #REQUIRED >
<!ATTLIST simpleConnectionManager userName CDATA #REQUIRED >
<!ATTLIST simpleConnectionManager password CDATA #REQUIRED >
]>
<connectionManagerFactory>
<simpleConnectionManager dsn = "ls_database"
userName = "ls_dbuser"
password = "ls_dbpassword"
/>
</connectionManagerFactory>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE simpleConnectionManager [
<!ELEMENT simpleConnectionManager EMPTY >
<!ATTLIST simpleConnectionManager dsn CDATA #REQUIRED >
<!ATTLIST simpleConnectionManager userName CDATA #REQUIRED >
<!ATTLIST simpleConnectionManager password CDATA #REQUIRED >
]>
<simpleConnectionManager dsn = "ls_database"
userName = "ls_dbuser"
password = "ls_dbpassword"
/>

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.1 $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/src/ConnectionManagerFactoryTest.cxx,v $
------------------------------------------------------------------------------*/
@ -61,7 +61,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ConnectionManagerFactoryTest);
/**
* The name of the configuration file for the connection manager factory.
*/
static const std::string configFileName = "etc/connectionManagerFactory.xml";
static const std::string configFileName = "connectionManagerFactory.xml";
/* =============================================== local function prototypes */
@ -95,9 +95,9 @@ ConnectionManagerFactoryTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
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();
Ptr<ConnectionManagerFactory>::Ref cmf =
ConnectionManagerFactory::getInstance();
@ -118,7 +118,9 @@ ConnectionManagerFactoryTest :: firstTest(void)
CPPUNIT_ASSERT(rs->getInt(1) == 1);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
CPPUNIT_FAIL(e.what());
} catch (std::runtime_error &e) {
CPPUNIT_FAIL(e.what());
} catch (xmlpp::exception &e) {
CPPUNIT_FAIL(e.what());
}

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.1 $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/src/ConnectionManagerFactoryTest.h,v $
------------------------------------------------------------------------------*/
@ -42,10 +42,15 @@
#include <cppunit/extensions/HelperMacros.h>
#include "LiveSupport/Core/BaseTestMethod.h"
namespace LiveSupport {
namespace Db {
using namespace LiveSupport::Core;
/* ================================================================ constants */
@ -58,10 +63,10 @@ namespace Db {
* Unit test for the ConnectionManagerFactory class.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
* @see ConnectionManagerFactory
*/
class ConnectionManagerFactoryTest : public CPPUNIT_NS::TestFixture
class ConnectionManagerFactoryTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(ConnectionManagerFactoryTest);
CPPUNIT_TEST(firstTest);

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.2 $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/src/SimpleConnectionManager.cxx,v $
------------------------------------------------------------------------------*/
@ -120,7 +120,6 @@ SimpleConnectionManager :: getConnection(void)
throw (std::runtime_error)
{
odbc::Connection * conn;
try {
conn = odbc::DriverManager::getConnection(dsn, userName, password);
} catch (std::exception &e) {
@ -128,7 +127,7 @@ SimpleConnectionManager :: getConnection(void)
}
if (!conn) {
std::string eMsg = "unable to option ODBC connection for DSN ";
std::string eMsg = "unable to open ODBC connection for DSN ";
eMsg += dsn;
throw std::runtime_error(eMsg);
}

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.1 $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/src/SimpleConnectionManagerTest.cxx,v $
------------------------------------------------------------------------------*/
@ -61,7 +61,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(SimpleConnectionManagerTest);
/**
* The name of the configuration file for the connection manager.
*/
static const std::string configFileName = "etc/simpleConnectionManager.xml";
static const std::string configFileName = "simpleConnectionManager.xml";
/* =============================================== local function prototypes */
@ -95,9 +95,9 @@ SimpleConnectionManagerTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
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();
Ptr<SimpleConnectionManager>::Ref scm(new SimpleConnectionManager());
@ -114,7 +114,9 @@ SimpleConnectionManagerTest :: firstTest(void)
CPPUNIT_ASSERT(rs->getInt(1) == 1);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
CPPUNIT_FAIL(e.what());
} catch (std::runtime_error &e) {
CPPUNIT_FAIL(e.what());
} catch (xmlpp::exception &e) {
CPPUNIT_FAIL(e.what());
}

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.1 $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/db/src/SimpleConnectionManagerTest.h,v $
------------------------------------------------------------------------------*/
@ -42,10 +42,15 @@
#include <cppunit/extensions/HelperMacros.h>
#include "LiveSupport/Core/BaseTestMethod.h"
namespace LiveSupport {
namespace Db {
using namespace LiveSupport::Core;
/* ================================================================ constants */
@ -58,10 +63,10 @@ namespace Db {
* Unit test for the SimpleConnectionManager class.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
* @see SimpleConnectionManager
*/
class SimpleConnectionManagerTest : public CPPUNIT_NS::TestFixture
class SimpleConnectionManagerTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(SimpleConnectionManagerTest);
CPPUNIT_TEST(firstTest);

View File

@ -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>

View File

@ -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"
/>

View File

@ -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.

View File

@ -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);

View File

@ -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);

View File

@ -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.

View File

@ -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));

View File

@ -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:

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE authenticationClientFactory [
<!ELEMENT authenticationClientFactory (testAuthentication|
webAuthentication)>
<!ELEMENT webAuthentication (location) >
<!ELEMENT location EMPTY >
<!ATTLIST location server CDATA #REQUIRED >
<!ATTLIST location port NMTOKEN #REQUIRED >
<!ATTLIST location path CDATA #REQUIRED >
]>
<authenticationClientFactory>
<webAuthentication>
<location server="ls_php_host" port="ls_php_port"
path="/ls_php_urlPrefix/storageServer/var/ls_alib_xmlRpcPrefix"/>
</webAuthentication>
</authenticationClientFactory>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE webStorage [
<!ELEMENT webStorage (location) >
<!ATTLIST webStorage tempFiles CDATA #REQUIRED >
<!ELEMENT location EMPTY >
<!ATTLIST location server CDATA #REQUIRED >
<!ATTLIST location port NMTOKEN #REQUIRED >
<!ATTLIST location path CDATA #REQUIRED >
]>
<webStorage tempFiles="file:///ls_install_dir/tmp/webStorageClient" >
<location server="ls_php_host" port="ls_php_port"
path="/ls_php_urlPrefix/storageServer/var/ls_alib_xmlRpcPrefix"/>
</webStorage>

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.38 $
Author : $Author: maroy $
Version : $Revision: 1.39 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/
@ -71,13 +71,13 @@ CPPUNIT_TEST_SUITE_REGISTRATION(WebStorageClientTest);
/**
* The name of the configuration file for the web storage client.
*/
static const std::string storageConfigFileName = "etc/webStorage.xml";
static const std::string storageConfigFileName = "webStorage.xml";
/**
* The name of the configuration file for the authentication factory.
*/
static const std::string authenticationFactoryConfigFileName
= "etc/webAuthenticationClient.xml";
= "webAuthenticationClient.xml";
/* =============================================== local function prototypes */
@ -94,9 +94,9 @@ WebStorageClientTest :: setUp(void) throw ()
Ptr<AuthenticationClientFactory>::Ref acf;
acf = AuthenticationClientFactory::getInstance();
try {
Ptr<xmlpp::DomParser>::Ref parser(
new xmlpp::DomParser(authenticationFactoryConfigFileName, true));
const xmlpp::Document * document = parser->get_document();
xmlpp::DomParser parser;
const xmlpp::Document * document = getConfigDocument(parser,
authenticationFactoryConfigFileName);
const xmlpp::Element * root = document->get_root_node();
acf->configure(*root);
@ -109,9 +109,9 @@ WebStorageClientTest :: setUp(void) throw ()
authentication = acf->getAuthenticationClient();
try {
Ptr<xmlpp::DomParser>::Ref parser(
new xmlpp::DomParser(storageConfigFileName, true));
const xmlpp::Document * document = parser->get_document();
xmlpp::DomParser parser;
const xmlpp::Document * document = getConfigDocument(parser,
storageConfigFileName);
const xmlpp::Element * root = document->get_root_node();
wsc.reset(new WebStorageClient());

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.8 $
Author : $Author: maroy $
Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.h,v $
------------------------------------------------------------------------------*/
@ -42,6 +42,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include "LiveSupport/Core/BaseTestMethod.h"
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
@ -62,11 +63,11 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the UploadPlaylistMetohd class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.8 $
* @author $Author: maroy $
* @version $Revision: 1.9 $
* @see WebStorageClient
*/
class WebStorageClientTest : public CPPUNIT_NS::TestFixture
class WebStorageClientTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(WebStorageClientTest);
CPPUNIT_TEST(firstTest);

View File

@ -22,8 +22,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: tomas $
Version : $Revision: 1.15 $
Author : $Author: maroy $
Version : $Revision: 1.16 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
------------------------------------------------------------------------------*/
@ -58,6 +58,9 @@
* for login to archive
* </dl>
*/
// these are the default values for the config
$config = array(
/* ================================================== basic configuration */
'dsn' => array(
@ -125,4 +128,21 @@ $config = array(
'RootNode' => 'RootNode',
'tmpRootPass' => 'q',
);
?>
// see if a ~/.livesupport/archiveServer.conf.php exists, and
// overwrite the settings from there if any
$this_file = $_SERVER["SCRIPT_FILENAME"];
$fileowner_id = fileowner($this_file);
$fileowner_array = posix_getpwuid($fileowner_id);
$fileowner_homedir = $fileowner_array['dir'];
$home_conf = $fileowner_homedir . '/.livesupport/storageServer.conf.php';
if (file_exists($home_conf)) {
$default_config = $config;
include $home_conf;
$user_config = $config;
$config = $user_config + $default_config;
}
?>

View File

@ -0,0 +1,92 @@
<?php
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf_only.php.template,v $
------------------------------------------------------------------------------*/
/**
* \file conf.php
* storageServer configuration file
*/
/**
* configuration structure:
*
* <dl>
* <dt>dsn<dd> datasource setting
* <dt>tblNamePrefix <dd>prefix for table names in the database
* <dt>authCookieName <dd>secret token cookie name
* <dt>StationPrefsGr <dd>name of station preferences group
* <dt>AllGr <dd>name of 'all users' group
* <dt>storageDir <dd>main directory for storing binary media files
* <dt>bufferDir <dd>directory for temporary files
* <dt>transDir <dd>directory for incomplete transferred files
* <dt>accessDir <dd>directory for symlinks to accessed files
* <dt>isArchive <dd>local/central flag
* <dt>validate <dd>enable/disable validator
* <dt>storageUrlPath<dd>path-URL-part of storageServer base dir
* <dt>storageXMLRPC<dd>XMLRPC server script address relative to storageUrlPath
* <dt>storageUrlHost, storageUrlPort<dd>host and port of storageServer
* <dt>archiveUrlPath<dd>path-URL-part of archiveServer base dir
* <dt>archiveXMLRPC<dd>XMLRPC server script address relative to archiveUrlPath
* <dt>archiveUrlHost, archiveUrlPort<dd>host and port of archiveServer
* <dt>archiveAccountLogin, archiveAccountPass <dd>account info
* for login to archive
* </dl>
*/
$config = array(
/* ================================================== basic configuration */
'dsn' => array(
'username' => 'ls_dbuser',
'password' => 'ls_dbpassword',
'hostspec' => 'ls_dbserver',
'phptype' => 'pgsql',
'database' => 'ls_database',
),
/* ==================================================== URL configuration */
'storageUrlPath' => 'ls_storageUrlPath',
'storageXMLRPC' => 'xmlrpc/xrLocStor.php',
'storageUrlHost' => 'ls_php_host',
'storageUrlPort' => ls_php_port,
/* ================================================ archive configuration */
'archiveUrlPath' => 'ls_archiveUrlPath',
'archiveXMLRPC' => 'xmlrpc/xrArchive.php',
'archiveUrlHost' => 'ls_php_host',
'archiveUrlPort' => ls_php_port,
'archiveAccountLogin' => 'root',
'archiveAccountPass' => 'q',
/* ============================================== scheduler configuration */
'schedulerUrlPath' => 'ls_scheduler_urlPrefix',
'schedulerXMLRPC' => 'ls_scheduler_xmlRpcPrefix',
'schedulerUrlHost' => 'ls_scheduler_host',
'schedulerUrlPort' => ls_scheduler_port,
);
?>

View File

@ -0,0 +1,70 @@
#!/bin/sh
#-------------------------------------------------------------------------------# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LiveSupport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/bin/run_tests.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Run the test suite for the scheduler.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Determine directories, files
#-------------------------------------------------------------------------------
reldir=`dirname $0`/..
basedir=`cd $reldir; pwd;`
bindir=$basedir/bin
etcdir=$basedir/etc
libdir=$basedir/lib
tmpdir=$basedir/tmp
usrdir=`cd $basedir/../../usr; pwd;`
#-------------------------------------------------------------------------------
# Set up the environment
#-------------------------------------------------------------------------------
export LD_LIBRARY_PATH=$usrdir/lib:$LD_LIBRARY_PATH
if [ -x $tmpdir/testRunner ]; then
testRunner=$tmpdir/testRunner
else
echo "Can't find testRunner executable.";
fi
if [ -f ~/.livesupport/scheduler.xml ]; then
config_file=~/.livesupport/scheduler.xml
elif [ -f $etcdir/scheduler.xml ]; then
config_file=$etcdir/scheduler.xml
else
echo "Can't find configuration file.";
fi
#-------------------------------------------------------------------------------
# Run the tests
#-------------------------------------------------------------------------------
$testRunner -c $config_file "$*"

View File

@ -0,0 +1,120 @@
#!/bin/sh
#-------------------------------------------------------------------------------# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LiveSupport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/bin/scheduler_devenv.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# System V runlevel style invoke script for the LiveSupport Scheduler
# This script is only used in the LiveSupport development environment
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Determine directories, files
#-------------------------------------------------------------------------------
reldir=`dirname $0`/..
basedir=`cd $reldir; pwd;`
bindir=$basedir/bin
etcdir=$basedir/etc
libdir=$basedir/lib
tmpdir=$basedir/tmp
usrdir=`cd $basedir/../../usr; pwd;`
#-------------------------------------------------------------------------------
# Set up the environment
#-------------------------------------------------------------------------------
export LD_LIBRARY_PATH=$usrdir/lib:$LD_LIBRARY_PATH
if [ -x $bindir/scheduler ]; then
scheduler_exe=$bindir/scheduler
elif [ -x $tmpdir/scheduler ]; then
scheduler_exe=$tmpdir/scheduler
else
echo "Can't find scheduler executable.";
fi
if [ -f ~/.livesupport/scheduler.xml ]; then
config_file=~/.livesupport/scheduler.xml
elif [ -f $etcdir/scheduler.xml ]; then
config_file=$etcdir/scheduler.xml
else
echo "Can't find configuration file.";
fi
mode=$1
#echo "Using scheduler: $scheduler_exe";
#echo " configuration file: $config_file";
#-------------------------------------------------------------------------------
# Do what the user asks us to do
#-------------------------------------------------------------------------------
case "$mode" in
'start')
echo "Starting the LiveSupport scheduler..."
$scheduler_exe -c $config_file start
sleep 2
;;
'stop')
echo "Stopping the LiveSupport scheduler..."
$scheduler_exe -c $config_file stop
sleep 2
;;
'status')
echo "Checking LiveSupport scheduler status..."
$scheduler_exe -c $config_file status
;;
'install')
echo "Installing LiveSupport scheduler database tables..."
$scheduler_exe -c $config_file install
;;
'uninstall')
echo "Uninstalling LiveSupport scheduler database tables..."
$scheduler_exe -c $config_file uninstall
;;
'kill')
echo "Killing all LiveSupport scheduler processes..."
killall scheduler
sleep 2
killall -9 scheduler
;;
*)
echo "LiveSupport scheduler System V runlevel init script."
echo ""
echo "Usage:"
echo " $0 start|stop|status|install|uninstall|kill"
echo ""
esac

View File

@ -21,7 +21,7 @@
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.51 $
# Version : $Revision: 1.52 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/Makefile.in,v $
#
# @configure_input@
@ -43,6 +43,7 @@ BASE_DIR = @builddir@
DOC_DIR = ${BASE_DIR}/doc
DOXYGEN_DIR = ${DOC_DIR}/doxygen
COVERAGE_DIR = ${DOC_DIR}/coverage
BIN_DIR = ${BASE_DIR}/bin
ETC_DIR = ${BASE_DIR}/etc
SRC_DIR = ${BASE_DIR}/src
TMP_DIR = ${BASE_DIR}/tmp
@ -117,6 +118,7 @@ TEST_RESULTS = ${DOC_DIR}/testResults.xml
TEST_XSLT = ../etc/testResultToHtml.xsl
SCHEDULER_EXE = ${TMP_DIR}/scheduler
SCHEDULER_SH = ${BIN_DIR}/scheduler_devenv.sh
SCHEDULER_CFG = ${ETC_DIR}/scheduler.xml
SCHEDULER_WEB_CFG = ${ETC_DIR}/scheduler-web.xml
TEST_RUNNER = ${TMP_DIR}/testRunner
@ -207,8 +209,9 @@ SCHEDULER_EXE_LIBS = -l${EVENT_SCHEDULER_LIB} -l${PLAYLIST_EXECUTOR_LIB} \
TEST_RUNNER_OBJS = ${SCHEDULER_OBJS} \
${TMP_DIR}/TestRunner.o \
${TMP_DIR}/SchedulerDaemonTest.o \
${TMP_DIR}/BaseTestMethod.o \
${TMP_DIR}/ResetStorageMethodTest.o \
${TMP_DIR}/SchedulerDaemonTest.o \
${TMP_DIR}/GetSchedulerTimeMethodTest.o \
${TMP_DIR}/RpcGetSchedulerTimeTest.o \
${TMP_DIR}/GetVersionMethodTest.o \
@ -261,8 +264,8 @@ TEST_RUNNER_LIBS = ${SCHEDULER_EXE_LIBS} -lcppunit -ldl
#-------------------------------------------------------------------------------
.PHONY: all dir_setup doc clean docclean depclean distclean
.PHONY: install start status run_tests stop uninstall
.PHONY: install_web start_web status_web run_web stop_web uninstall_web
.PHONY: check check_web
.PHONY: install_local start_local status_local run_local stop_local
.PHONY: uninstall_local check check_local
all: dir_setup ${SCHEDULER_EXE}
@ -292,54 +295,51 @@ depclean: clean
distclean: clean docclean
${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te*
check: all ${TEST_RUNNER} start run_tests stop
check: all ${TEST_RUNNER} storage_server_init start run_tests stop
check_web: all ${TEST_RUNNER} storage_server_init start_web run_tests stop_web
check_local: all ${TEST_RUNNER} start_local run_tests stop_local
run_tests: ${TEST_RUNNER}
${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT}
./bin/run_tests.sh -o ${TEST_RESULTS} -s ${TEST_XSLT}
# ${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT}
install: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} install
${SCHEDULER_SH} install
start: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} start
${SCHEDULER_SH} start
sleep 2
stop: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} stop
${SCHEDULER_SH} stop
sleep 2
status: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} status
${SCHEDULER_SH} status
uninstall: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} uninstall
${SCHEDULER_SH} uninstall
run: ${SCHEDULER_EXE}
install_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} install
start_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} start
sleep 2
stop_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} stop
sleep 2
status_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} status
run_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} --debug start
sleep 2
install_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} install
start_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} start
sleep 2
stop_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} stop
sleep 2
status_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} status
run_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} --debug start
sleep 2
uninstall_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} uninstall
uninstall_local: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_CFG} uninstall
storage_server_init:
${MAKE} -C ${STORAGE_SERVER_DIR}

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.15 $
Author : $Author: maroy $
Version : $Revision: 1.16 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -52,6 +52,7 @@
#include "OpenPlaylistForEditingMethod.h"
#include "AddAudioClipToPlaylistMethod.h"
#include "AddAudioClipToPlaylistMethodTest.h"
#include "SchedulerDaemon.h"
using namespace std;
using namespace LiveSupport::Db;
@ -67,69 +68,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(AddAudioClipToPlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string AddAudioClipToPlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string AddAudioClipToPlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string AddAudioClipToPlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
AddAudioClipToPlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
AddAudioClipToPlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -138,7 +93,7 @@ AddAudioClipToPlaylistMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/AddAudioClipToPlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,11 +64,11 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the AddAudioClipToPlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see AddAudioClipToPlaylistMethod
*/
class AddAudioClipToPlaylistMethodTest : public CPPUNIT_NS::TestFixture
class AddAudioClipToPlaylistMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(AddAudioClipToPlaylistMethodTest);
CPPUNIT_TEST(firstTest);
@ -75,23 +76,6 @@ class AddAudioClipToPlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,19 +86,6 @@ class AddAudioClipToPlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -0,0 +1,92 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/BaseTestMethod.cxx,v $
------------------------------------------------------------------------------*/
/* ============================================================ include files */
#include "SchedulerDaemon.h"
#include "BaseTestMethod.h"
using namespace LiveSupport::Scheduler;
/* =================================================== local data structures */
/* ================================================ local constants & macros */
/*------------------------------------------------------------------------------
* The XML-RPC host to connect to.
*----------------------------------------------------------------------------*/
std::string LiveSupport::Scheduler::BaseTestMethod::xmlRpcHost;
/*------------------------------------------------------------------------------
* The XML-RPC port number to connect to.
*----------------------------------------------------------------------------*/
unsigned int LiveSupport::Scheduler::BaseTestMethod::xmlRpcPort;
/*------------------------------------------------------------------------------
* A flag to indicate if configuration has already been done.
*----------------------------------------------------------------------------*/
bool LiveSupport::Scheduler::BaseTestMethod::configured = false;
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Read configuration information.
*----------------------------------------------------------------------------*/
void
LiveSupport::Scheduler::
BaseTestMethod :: configure(std::string configFileName)
throw (std::exception)
{
if (!configured) {
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
std::auto_ptr<xmlpp::DomParser>
parser(new xmlpp::DomParser(configFileName, true));
const xmlpp::Document * document = parser->get_document();
scheduler->configure(*(document->get_root_node()));
} catch (std::invalid_argument &e) {
std::cerr << "semantic error in configuration file" << std::endl
<< e.what() << std::endl;
} catch (xmlpp::exception &e) {
std::cerr << "error parsing configuration file" << std::endl
<< e.what() << std::endl;
}
xmlRpcHost = scheduler->getXmlRpcHost();
xmlRpcPort = scheduler->getXmlRpcPort();
}
}

View File

@ -0,0 +1,135 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LiveSupport is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/BaseTestMethod.h,v $
------------------------------------------------------------------------------*/
#ifndef BaseTestMethod_h
#define BaseTestMethod_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <cppunit/extensions/HelperMacros.h>
#include "LiveSupport/Core/BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* A base class for the test methods.
* Subclass this class for the methods that connect to an XML-RPC source.
* Make sure to call BaseTestMethod::configure() before running the
* test cases.
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class BaseTestMethod : public LiveSupport::Core::BaseTestMethod
{
private:
/**
* The XML-RPC host name to connect to.
*/
static std::string xmlRpcHost;
/**
* The XML-RPC port to connect to.
*/
static unsigned int xmlRpcPort;
/**
* A flag to indicate if configuration has already been done.
*/
static bool configured;
public:
/**
* Function to read configuration information, and fill out
* relevant attributes, such as the XML-RPC port and host.
*
* @param configFileName the name of the configuration file to read.
* @exception std::exception in case of errors reading the
* configuration file
*/
static void
configure(std::string configFileName)
throw (std::exception);
/**
* Return the XML-RPC port to connect to.
*
* @return the XML-RPC port to connect to.
*/
static unsigned int
getXmlRpcPort(void) throw ()
{
return xmlRpcPort;
}
/**
* Return the XML-RPC host to connect to.
*
* @return the XML-RPC host to connect to.
*/
static std::string
getXmlRpcHost(void) throw ()
{
return xmlRpcHost;
}
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace Scheduler
} // namespace LiveSupport
#endif // BaseTestMethod_h

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.15 $
Author : $Author: maroy $
Version : $Revision: 1.16 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "CreatePlaylistMethod.h"
#include "OpenPlaylistForEditingMethod.h"
#include "CreatePlaylistMethodTest.h"
@ -67,69 +68,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(CreatePlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string CreatePlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string CreatePlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string CreatePlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
CreatePlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
CreatePlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -138,7 +93,7 @@ CreatePlaylistMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Author : $Author: maroy $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/CreatePlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,11 +64,11 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the CreatePlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.6 $
* @author $Author: maroy $
* @version $Revision: 1.7 $
* @see CreatePlaylistMethod
*/
class CreatePlaylistMethodTest : public CPPUNIT_NS::TestFixture
class CreatePlaylistMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(CreatePlaylistMethodTest);
CPPUNIT_TEST(firstTest);
@ -75,23 +76,6 @@ class CreatePlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,20 +86,6 @@ class CreatePlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.9 $
Author : $Author: maroy $
Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "OpenPlaylistForEditingMethod.h"
#include "SavePlaylistMethod.h"
@ -68,69 +69,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DeletePlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DeletePlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DeletePlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DeletePlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DeletePlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DeletePlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -139,7 +94,7 @@ DeletePlaylistMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/DeletePlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -65,10 +66,10 @@ using namespace LiveSupport::Authentication;
*
* @author $Author: maroy, fgerlits
$
* @version $Revision: 1.4 $
* @version $Revision: 1.5 $
* @see DeletePlaylistMethod
*/
class DeletePlaylistMethodTest : public CPPUNIT_NS::TestFixture
class DeletePlaylistMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(DeletePlaylistMethodTest);
CPPUNIT_TEST(firstTest);
@ -77,23 +78,6 @@ class DeletePlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -104,20 +88,6 @@ class DeletePlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.11 $
Author : $Author: maroy $
Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "DisplayAudioClipMethod.h"
#include "DisplayAudioClipMethodTest.h"
@ -65,69 +66,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DisplayAudioClipMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DisplayAudioClipMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DisplayAudioClipMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DisplayAudioClipMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DisplayAudioClipMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DisplayAudioClipMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -136,7 +91,7 @@ DisplayAudioClipMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {
@ -192,7 +147,7 @@ DisplayAudioClipMethodTest :: firstTest(void)
Ptr<AudioClip>::Ref audioClip;
CPPUNIT_ASSERT_NO_THROW(audioClip.reset(new AudioClip(result)));
CPPUNIT_ASSERT(audioClip->getId()->getId() == 0x10001);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 60 * 60);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 11);
}

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,11 +64,11 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the DisplayAudioClipMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see DisplayAudioClipMethod
*/
class DisplayAudioClipMethodTest : public CPPUNIT_NS::TestFixture
class DisplayAudioClipMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(DisplayAudioClipMethodTest);
CPPUNIT_TEST(firstTest);
@ -76,23 +77,6 @@ class DisplayAudioClipMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -103,20 +87,6 @@ class DisplayAudioClipMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.11 $
Author : $Author: maroy $
Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "DisplayAudioClipsMethod.h"
#include "DisplayAudioClipsMethodTest.h"
@ -66,69 +67,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DisplayAudioClipsMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DisplayAudioClipsMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DisplayAudioClipsMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DisplayAudioClipsMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DisplayAudioClipsMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DisplayAudioClipsMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -137,7 +92,7 @@ DisplayAudioClipsMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {
@ -193,7 +148,7 @@ DisplayAudioClipsMethodTest :: firstTest(void)
Ptr<AudioClip>::Ref audioClip;
CPPUNIT_ASSERT_NO_THROW(audioClip.reset(new AudioClip(result0)));
CPPUNIT_ASSERT(audioClip->getId()->getId() == 0x10001);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 60 * 60);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 11);
XmlRpc::XmlRpcValue result1 = result[1];
CPPUNIT_ASSERT(result1.hasMember("audioClip"));
@ -201,6 +156,6 @@ DisplayAudioClipsMethodTest :: firstTest(void)
== XmlRpc::XmlRpcValue::TypeString);
CPPUNIT_ASSERT_NO_THROW(audioClip.reset(new AudioClip(result1)));
CPPUNIT_ASSERT(audioClip->getId()->getId() == 0x10002);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 30 * 60);
CPPUNIT_ASSERT(audioClip->getPlaylength()->total_seconds() == 12);
}

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayAudioClipsMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,11 +64,11 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the DisplayAudioClipsMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see DisplayAudioClipsMethod
*/
class DisplayAudioClipsMethodTest : public CPPUNIT_NS::TestFixture
class DisplayAudioClipsMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(DisplayAudioClipsMethodTest);
CPPUNIT_TEST(firstTest);
@ -75,23 +76,6 @@ class DisplayAudioClipsMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,20 +86,6 @@ class DisplayAudioClipsMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.11 $
Author : $Author: maroy $
Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "DisplayPlaylistMethod.h"
#include "DisplayPlaylistMethodTest.h"
@ -65,69 +66,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DisplayPlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DisplayPlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DisplayPlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DisplayPlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DisplayPlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DisplayPlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -136,7 +91,7 @@ DisplayPlaylistMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the DisplayPlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see DisplayPlaylistMethod
*/
class DisplayPlaylistMethodTest : public CPPUNIT_NS::TestFixture
@ -76,23 +77,6 @@ class DisplayPlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -103,20 +87,6 @@ class DisplayPlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.11 $
Author : $Author: maroy $
Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "DisplayPlaylistsMethod.h"
#include "DisplayPlaylistsMethodTest.h"
@ -66,69 +67,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DisplayPlaylistsMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DisplayPlaylistsMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DisplayPlaylistsMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DisplayPlaylistsMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DisplayPlaylistsMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DisplayPlaylistsMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -137,7 +92,7 @@ DisplayPlaylistsMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {
@ -184,14 +139,25 @@ DisplayPlaylistsMethodTest :: firstTest(void)
<< " - " << e.getMessage();
CPPUNIT_FAIL(eMsg.str());
}
CPPUNIT_ASSERT(result.size() == 1);
XmlRpc::XmlRpcValue result0 = result[0];
CPPUNIT_ASSERT(result.size() == 2);
XmlRpc::XmlRpcValue result0;
Ptr<Playlist>::Ref playlist;
// check the first returned playlist
result0 = result[0];
CPPUNIT_ASSERT(result0.hasMember("playlist"));
CPPUNIT_ASSERT(result0["playlist"].getType()
== XmlRpc::XmlRpcValue::TypeString);
Ptr<Playlist>::Ref playlist;
CPPUNIT_ASSERT_NO_THROW(playlist.reset(new Playlist(result0)));
CPPUNIT_ASSERT(playlist->getId()->getId() == 1);
CPPUNIT_ASSERT(playlist->getPlaylength()->total_seconds() == 90 * 60);
// check the second returned playlist
result0 = result[1];
CPPUNIT_ASSERT(result0.hasMember("playlist"));
CPPUNIT_ASSERT(result0["playlist"].getType()
== XmlRpc::XmlRpcValue::TypeString);
CPPUNIT_ASSERT_NO_THROW(playlist.reset(new Playlist(result0)));
CPPUNIT_ASSERT(playlist->getId()->getId() == 2);
CPPUNIT_ASSERT(playlist->getPlaylength()->total_seconds() == 29);
}

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayPlaylistsMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the DisplayPlaylistsMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see DisplayPlaylistsMethod
*/
class DisplayPlaylistsMethodTest : public CPPUNIT_NS::TestFixture
@ -75,23 +76,6 @@ class DisplayPlaylistsMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,20 +86,6 @@ class DisplayPlaylistsMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.10 $
Author : $Author: maroy $
Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayScheduleMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "ScheduleFactory.h"
#include "UploadPlaylistMethod.h"
#include "DisplayScheduleMethod.h"
@ -69,81 +70,26 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(DisplayScheduleMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string DisplayScheduleMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string DisplayScheduleMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the schedule factory.
*/
const std::string DisplayScheduleMethodTest::scheduleConfig =
"etc/scheduleFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string DisplayScheduleMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
DisplayScheduleMethodTest :: 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
*----------------------------------------------------------------------------*/
void
DisplayScheduleMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
Ptr<ScheduleFactory>::Ref
sf = ScheduleFactory::getInstance();
configure(sf, scheduleConfig);
schedule = sf->getSchedule();
schedule = scheduler->getSchedule();
schedule->install();
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -152,7 +98,7 @@ DisplayScheduleMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/DisplayScheduleMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the DisplayScheduleMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see DisplayScheduleMethod
*/
class DisplayScheduleMethodTest : public CPPUNIT_NS::TestFixture
@ -76,33 +77,11 @@ class DisplayScheduleMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the schedule factory.
*/
static const std::string scheduleConfig;
/**
* The schedule used during the test.
*/
Ptr<ScheduleInterface>::Ref schedule;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -113,21 +92,6 @@ class DisplayScheduleMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
/**
* Insert some entries into the schedule to provide test data.
*/

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.8 $
Author : $Author: maroy $
Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "PlayLogFactory.h"
#include "UploadPlaylistMethod.h"
#include "GeneratePlayReportMethod.h"
@ -68,83 +69,28 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(GeneratePlayReportMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string GeneratePlayReportMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string GeneratePlayReportMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the play log factory.
*/
const std::string GeneratePlayReportMethodTest::playLogConfig =
"etc/playLogFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string GeneratePlayReportMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
GeneratePlayReportMethodTest :: 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
*----------------------------------------------------------------------------*/
void
GeneratePlayReportMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
Ptr<PlayLogFactory>::Ref plf = PlayLogFactory::getInstance();
configure(plf, playLogConfig);
playLog = plf->getPlayLog();
playLog = scheduler->getPlayLog();
playLog->install();
insertEntries();
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -153,7 +99,7 @@ GeneratePlayReportMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GeneratePlayReportMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the GeneratePlayReportMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see GeneratePlayReportMethod
*/
class GeneratePlayReportMethodTest : public CPPUNIT_NS::TestFixture
@ -76,33 +77,11 @@ class GeneratePlayReportMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the play log factory.
*/
static const std::string playLogConfig;
/**
* The play log used during the test.
*/
Ptr<PlayLogInterface>::Ref playLog;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -113,21 +92,6 @@ class GeneratePlayReportMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
/**
* Insert some entries into the play log to provide test data.
*/

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GetSchedulerTimeMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -41,6 +41,7 @@
#endif
#include <cppunit/extensions/HelperMacros.h>
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -59,8 +60,8 @@ using namespace LiveSupport::Core;
/**
* Unit test to test the getSchedulerTime XML-RPC call.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see SchedulerDaemon
*/
class GetSchedulerTimeMethodTest : public CPPUNIT_NS::TestFixture

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.2 $
Author : $Author: maroy $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/GetVersionMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the GetVersionMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.2 $
* @author $Author: maroy $
* @version $Revision: 1.3 $
* @see GetVersionMethod
*/
class GetVersionMethodTest : public CPPUNIT_NS::TestFixture

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.16 $
Author : $Author: maroy $
Version : $Revision: 1.17 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,7 @@
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "LiveSupport/Core/XmlRpcTools.h"
#include "SchedulerDaemon.h"
#include "OpenPlaylistForEditingMethod.h"
#include "OpenPlaylistForEditingMethodTest.h"
@ -66,69 +67,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(OpenPlaylistForEditingMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string OpenPlaylistForEditingMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string OpenPlaylistForEditingMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string OpenPlaylistForEditingMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
OpenPlaylistForEditingMethodTest :: 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
*----------------------------------------------------------------------------*/
void
OpenPlaylistForEditingMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -137,7 +92,7 @@ OpenPlaylistForEditingMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Author : $Author: maroy $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/OpenPlaylistForEditingMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the OpenPlaylistForEditingMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.6 $
* @author $Author: maroy $
* @version $Revision: 1.7 $
* @see OpenPlaylistForEditingMethod
*/
class OpenPlaylistForEditingMethodTest : public CPPUNIT_NS::TestFixture
@ -75,23 +76,6 @@ class OpenPlaylistForEditingMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,19 +86,6 @@ class OpenPlaylistForEditingMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,7 @@
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "PlayLogFactory.h"
#include "SchedulerDaemon.h"
#include "PlaylistEventContainer.h"
#include "PlaylistEventContainerTest.h"
@ -70,38 +71,6 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(PlaylistEventContainerTest);
/**
* The name of the configuration file for the audio player
*/
static const std::string audioPlayerConfigFileName = "etc/audioPlayer.xml";
/**
* The name of the configuration file for the connection manager
*/
static const std::string connectionManagerConfigFileName =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the storage client
*/
static const std::string storageClientConfigFileName = "etc/storageClient.xml";
/**
* The name of the configuration file for the schedule factory
*/
static const std::string scheduleConfigFileName = "etc/scheduleFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
static const std::string authenticationClientConfigFileName =
"etc/authenticationClient.xml";
/**
* The name of the configuration file for the play log factory.
*/
static const std::string playLogConfigFileName = "etc/playLogFactory.xml";
/* =============================================== local function prototypes */
@ -114,52 +83,14 @@ static const std::string playLogConfigFileName = "etc/playLogFactory.xml";
void
PlaylistEventContainerTest :: setUp(void) throw ()
{
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<xmlpp::DomParser>::Ref parser;
// configure the audio player factory
Ptr<AudioPlayerFactory>::Ref apf = AudioPlayerFactory::getInstance();
parser.reset(new xmlpp::DomParser(audioPlayerConfigFileName, true));
apf->configure(*(parser->get_document()->get_root_node()));
audioPlayer = apf->getAudioPlayer();
// configure the connection manager factory
Ptr<ConnectionManagerFactory>::Ref cmf =
ConnectionManagerFactory::getInstance();
parser.reset(new xmlpp::DomParser(connectionManagerConfigFileName,
true));
cmf->configure(*(parser->get_document()->get_root_node()));
// configure the storage client factory
Ptr<StorageClientFactory>::Ref scf =
StorageClientFactory::getInstance();
parser.reset(new xmlpp::DomParser(storageClientConfigFileName, true));
scf->configure(*(parser->get_document()->get_root_node()));
storage = scf->getStorageClient();
audioPlayer = scheduler->getAudioPlayer();
storage = scheduler->getStorage();
storage->reset();
// configure the schedule factory
scheduleFactory = ScheduleFactory::getInstance();
parser.reset(new xmlpp::DomParser(scheduleConfigFileName, true));
scheduleFactory->configure(*(parser->get_document()->get_root_node()));
schedule = scheduleFactory->getSchedule();
// get an authentication client
Ptr<AuthenticationClientFactory>::Ref acf;
acf = AuthenticationClientFactory::getInstance();
parser.reset(new xmlpp::DomParser(authenticationClientConfigFileName,
true));
acf->configure(*(parser->get_document()->get_root_node()));
authentication = acf->getAuthenticationClient();
// get an playlog factory
Ptr<PlayLogFactory>::Ref plf = PlayLogFactory::getInstance();
parser.reset(new xmlpp::DomParser(playLogConfigFileName, true));
plf->configure(*(parser->get_document()->get_root_node()));
playLog = plf->getPlayLog();
schedule = scheduler->getSchedule();
authentication = scheduler->getAuthentication();
playLog = scheduler->getPlayLog();
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;
@ -168,9 +99,8 @@ PlaylistEventContainerTest :: setUp(void) throw ()
std::cerr << e.what() << std::endl;
CPPUNIT_FAIL("error parsing configuration file");
}
try {
scheduleFactory->install();
schedule->install();
playLog->install();
} catch (std::exception &e) {
std::cerr << e.what() << std::endl;
@ -191,12 +121,11 @@ void
PlaylistEventContainerTest :: tearDown(void) throw ()
{
audioPlayer->deInitialize();
scheduleFactory->uninstall();
schedule->uninstall();
playLog->uninstall();
playLog.reset();
schedule.reset();
scheduleFactory.reset();
storage.reset();
audioPlayer.reset();

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.4 $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.h,v $
------------------------------------------------------------------------------*/
@ -50,6 +50,7 @@
#include "ScheduleInterface.h"
#include "PlayLogInterface.h"
#include "ScheduleFactory.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -76,7 +77,7 @@ using namespace LiveSupport::Storage;
* Unit test for the PlaylistEventContainer class
*
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @version $Revision: 1.5 $
* @see PlaylistEventContainer
*/
class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture
@ -97,11 +98,6 @@ class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture
*/
Ptr<StorageClientInterface>::Ref storage;
/**
* The schedule factory used in the test.
*/
Ptr<ScheduleFactory>::Ref scheduleFactory;
/**
* The schedule used by the container.
*/

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.cxx,v $
------------------------------------------------------------------------------*/
@ -46,8 +46,9 @@
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h"
#include "PlayLogFactory.h"
#include "SchedulerDaemon.h"
#include "PlayLogFactory.h"
#include "PlaylistEvent.h"
#include "PlaylistEventTest.h"
@ -67,27 +68,6 @@ using namespace LiveSupport::Scheduler;
CPPUNIT_TEST_SUITE_REGISTRATION(PlaylistEventTest);
/**
* The name of the configuration file for the audio player
*/
static const std::string audioPlayerConfigFileName = "etc/audioPlayer.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
static const std::string authenticationClientConfigFileName =
"etc/authenticationClient.xml";
/**
* The name of the configuration file for the storage client
*/
static const std::string storageClientConfigFileName = "etc/storageClient.xml";
/**
* The name of the configuration file for the play log factory.
*/
static const std::string playLogConfigFileName = "etc/playLogFactory.xml";
/* =============================================== local function prototypes */
@ -100,38 +80,13 @@ static const std::string playLogConfigFileName = "etc/playLogFactory.xml";
void
PlaylistEventTest :: setUp(void) throw ()
{
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<xmlpp::DomParser>::Ref parser;
// configure the audio player factory
Ptr<AudioPlayerFactory>::Ref apf = AudioPlayerFactory::getInstance();
parser.reset(new xmlpp::DomParser(audioPlayerConfigFileName, true));
apf->configure(*(parser->get_document()->get_root_node()));
audioPlayer = apf->getAudioPlayer();
// configure the storage client factory
Ptr<StorageClientFactory>::Ref scf =
StorageClientFactory::getInstance();
parser.reset(new xmlpp::DomParser(storageClientConfigFileName, true));
scf->configure(*(parser->get_document()->get_root_node()));
storage = scf->getStorageClient();
audioPlayer = scheduler->getAudioPlayer();
storage = scheduler->getStorage();
storage->reset();
// get an authentication client
Ptr<AuthenticationClientFactory>::Ref acf;
acf = AuthenticationClientFactory::getInstance();
parser.reset(new xmlpp::DomParser(authenticationClientConfigFileName,
true));
acf->configure(*(parser->get_document()->get_root_node()));
authentication = acf->getAuthenticationClient();
// get an playlog factory
Ptr<PlayLogFactory>::Ref plf = PlayLogFactory::getInstance();
parser.reset(new xmlpp::DomParser(playLogConfigFileName, true));
plf->configure(*(parser->get_document()->get_root_node()));
playLog = plf->getPlayLog();
authentication = scheduler->getAuthentication();
playLog = scheduler->getPlayLog();
} catch (std::invalid_argument &e) {
std::cerr << e.what() << std::endl;

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.5 $
Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.h,v $
------------------------------------------------------------------------------*/
@ -47,6 +47,7 @@
#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h"
#include "PlayLogInterface.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -70,7 +71,7 @@ using namespace LiveSupport::PlaylistExecutor;
* Unit test for the PlaylistEvent class
*
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @version $Revision: 1.6 $
* @see PlaylistEvent
*/
class PlaylistEventTest : public CPPUNIT_NS::TestFixture

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLogTest.cxx,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include <iostream>
#include "LiveSupport/Db/ConnectionManagerFactory.h"
#include "SchedulerDaemon.h"
#include "PostgresqlPlayLog.h"
#include "PostgresqlPlayLogTest.h"
@ -59,11 +60,6 @@ using namespace LiveSupport::Scheduler;
CPPUNIT_TEST_SUITE_REGISTRATION(PostgresqlPlayLogTest);
/**
* The name of the configuration file for the connection manager factory.
*/
static const std::string configFileName = "etc/connectionManagerFactory.xml";
/* =============================================== local function prototypes */
@ -76,16 +72,9 @@ static const std::string configFileName = "etc/connectionManagerFactory.xml";
void
PostgresqlPlayLogTest :: setUp(void) throw ()
{
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<xmlpp::DomParser>::Ref parser(
new xmlpp::DomParser(configFileName, true));
const xmlpp::Document * document = parser->get_document();
const xmlpp::Element * root = document->get_root_node();
Ptr<ConnectionManagerFactory>::Ref cmf =
ConnectionManagerFactory::getInstance();
cmf->configure(*root);
cm = cmf->getConnectionManager();
cm = scheduler->getConnectionManager();
playLog.reset(new PostgresqlPlayLog(cm));
playLog->install();

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Author : $Author: maroy $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLogTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Db/ConnectionManagerInterface.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Core;
/**
* Unit test for the PostgresqlPlayLog class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.1 $
* @author $Author: maroy $
* @version $Revision: 1.2 $
* @see PostgresqlPlayLog
*/
class PostgresqlPlayLogTest : public CPPUNIT_NS::TestFixture

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.6 $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlScheduleTest.cxx,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include <iostream>
#include "LiveSupport/Db/ConnectionManagerFactory.h"
#include "SchedulerDaemon.h"
#include "PostgresqlSchedule.h"
#include "PostgresqlScheduleTest.h"
@ -59,11 +60,6 @@ using namespace LiveSupport::Scheduler;
CPPUNIT_TEST_SUITE_REGISTRATION(PostgresqlScheduleTest);
/**
* The name of the configuration file for the connection manager factory.
*/
static const std::string configFileName = "etc/connectionManagerFactory.xml";
/* =============================================== local function prototypes */
@ -76,16 +72,9 @@ static const std::string configFileName = "etc/connectionManagerFactory.xml";
void
PostgresqlScheduleTest :: setUp(void) throw ()
{
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<xmlpp::DomParser>::Ref parser(
new xmlpp::DomParser(configFileName, true));
const xmlpp::Document * document = parser->get_document();
const xmlpp::Element * root = document->get_root_node();
Ptr<ConnectionManagerFactory>::Ref cmf =
ConnectionManagerFactory::getInstance();
cmf->configure(*root);
cm = cmf->getConnectionManager();
cm = scheduler->getConnectionManager();
schedule.reset(new PostgresqlSchedule(cm));
schedule->install();

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.5 $
Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlScheduleTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Db/ConnectionManagerInterface.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -64,7 +65,7 @@ using namespace LiveSupport::Core;
* Unit test for the PostgresqlSchedule class.
*
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @version $Revision: 1.6 $
* @see PostgresqlSchedule
*/
class PostgresqlScheduleTest : public CPPUNIT_NS::TestFixture

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.13 $
Author : $Author: maroy $
Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -49,6 +49,7 @@
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "LiveSupport/Core/XmlRpcTools.h"
#include "SchedulerDaemon.h"
#include "OpenPlaylistForEditingMethod.h"
#include "AddAudioClipToPlaylistMethod.h"
#include "RemoveAudioClipFromPlaylistMethod.h"
@ -69,71 +70,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(RemoveAudioClipFromPlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string RemoveAudioClipFromPlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string
RemoveAudioClipFromPlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string
RemoveAudioClipFromPlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
RemoveAudioClipFromPlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
RemoveAudioClipFromPlaylistMethodTest :: setUp(void) throw ()
RemoveAudioClipFromPlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -142,7 +95,7 @@ RemoveAudioClipFromPlaylistMethodTest :: setUp(void) thr
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveAudioClipFromPlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the RemoveAudioClipFromPlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see RemoveAudioClipFromPlaylistMethod
*/
class RemoveAudioClipFromPlaylistMethodTest : public CPPUNIT_NS::TestFixture
@ -75,23 +76,6 @@ class RemoveAudioClipFromPlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,19 +86,6 @@ class RemoveAudioClipFromPlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.8 $
Author : $Author: maroy $
Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -46,14 +46,17 @@
#include "ScheduleFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "SchedulerDaemon.h"
#include "UploadPlaylistMethod.h"
#include "RemoveFromScheduleMethod.h"
#include "RemoveFromScheduleMethodTest.h"
using namespace LiveSupport::Scheduler;
using namespace LiveSupport::Authentication;
using namespace LiveSupport::Storage;
using namespace LiveSupport::Scheduler;
/* =================================================== local data structures */
@ -63,59 +66,26 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(RemoveFromScheduleMethodTest);
/**
* The name of the configuration file for the schedule factory.
*/
const std::string RemoveFromScheduleMethodTest::scheduleConfig =
"etc/scheduleFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string RemoveFromScheduleMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
RemoveFromScheduleMethodTest :: 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
*----------------------------------------------------------------------------*/
void
RemoveFromScheduleMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<ScheduleFactory>::Ref sf = ScheduleFactory::getInstance();
configure(sf, scheduleConfig);
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
schedule = sf->getSchedule();
schedule = scheduler->getSchedule();
schedule->install();
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -124,7 +94,7 @@ RemoveFromScheduleMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RemoveFromScheduleMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the RemoveFromScheduleMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see RemoveFromScheduleMethod
*/
class RemoveFromScheduleMethodTest : public CPPUNIT_NS::TestFixture
@ -76,22 +77,11 @@ class RemoveFromScheduleMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the schedule factory.
*/
static const std::string scheduleConfig;
/**
* The schedule used during the test.
*/
Ptr<ScheduleInterface>::Ref schedule;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,20 +92,6 @@ class RemoveFromScheduleMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.8 $
Author : $Author: maroy $
Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RescheduleMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "ScheduleFactory.h"
#include "UploadPlaylistMethod.h"
#include "RescheduleMethod.h"
@ -65,59 +66,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(RescheduleMethodTest);
/**
* The name of the configuration file for the schedule factory.
*/
const std::string RescheduleMethodTest::scheduleConfig =
"etc/scheduleFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string RescheduleMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
RescheduleMethodTest :: 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
*----------------------------------------------------------------------------*/
void
RescheduleMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
Ptr<ScheduleFactory>::Ref sf = ScheduleFactory::getInstance();
configure(sf, scheduleConfig);
schedule = sf->getSchedule();
schedule = scheduler->getSchedule();
schedule->install();
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -126,7 +91,7 @@ RescheduleMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RescheduleMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the RescheduleMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see RescheduleMethod
*/
class RescheduleMethodTest : public CPPUNIT_NS::TestFixture
@ -75,22 +76,11 @@ class RescheduleMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the schedule factory.
*/
static const std::string scheduleConfig;
/**
* The schedule used during the test.
*/
Ptr<ScheduleInterface>::Ref schedule;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -101,20 +91,6 @@ class RescheduleMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.2 $
Author : $Author: maroy $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ResetStorageMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -77,7 +77,10 @@ ResetStorageMethodTest :: firstTest(void)
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Author : $Author: maroy $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/ResetStorageMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -42,6 +42,8 @@
#include <cppunit/extensions/HelperMacros.h>
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -57,17 +59,17 @@ namespace Scheduler {
/**
* Unit test for the ResetStorageMethod class.
*
* @author $Author: maroy, fgerlits
$
* @version $Revision: 1.1 $
* @author $Author: maroy $
* @version $Revision: 1.2 $
* @see ResetStorageMethod
*/
class ResetStorageMethodTest : public CPPUNIT_NS::TestFixture
class ResetStorageMethodTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(ResetStorageMethodTest);
CPPUNIT_TEST(firstTest);
CPPUNIT_TEST_SUITE_END();
protected:
/**

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.10 $
Author : $Author: maroy $
Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.cxx,v $
------------------------------------------------------------------------------*/
@ -48,6 +48,7 @@
#include "LiveSupport/Storage/StorageClientFactory.h"
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
#include "SchedulerDaemon.h"
#include "OpenPlaylistForEditingMethod.h"
#include "RemoveAudioClipFromPlaylistMethod.h"
#include "SavePlaylistMethod.h"
@ -69,69 +70,23 @@ using namespace LiveSupport::Authentication;
CPPUNIT_TEST_SUITE_REGISTRATION(RevertEditedPlaylistMethodTest);
/**
* The name of the configuration file for the storage client factory.
*/
const std::string RevertEditedPlaylistMethodTest::storageClientConfig =
"etc/storageClient.xml";
/**
* The name of the configuration file for the connection manager factory.
*/
const std::string RevertEditedPlaylistMethodTest::connectionManagerConfig =
"etc/connectionManagerFactory.xml";
/**
* The name of the configuration file for the authentication client factory.
*/
const std::string RevertEditedPlaylistMethodTest::authenticationClientConfig =
"etc/authenticationClient.xml";
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Configure a Configurable with an XML file.
*----------------------------------------------------------------------------*/
void
RevertEditedPlaylistMethodTest :: 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
*----------------------------------------------------------------------------*/
void
RevertEditedPlaylistMethodTest :: setUp(void) throw ()
{
Ptr<AuthenticationClientFactory>::Ref acf;
Ptr<StorageClientFactory>::Ref scf;
Ptr<SchedulerDaemon>::Ref scheduler = SchedulerDaemon::getInstance();
try {
scf = StorageClientFactory::getInstance();
configure(scf, storageClientConfig);
Ptr<StorageClientInterface>::Ref storage = scf->getStorageClient();
Ptr<StorageClientInterface>::Ref storage = scheduler->getStorage();
storage->reset();
Ptr<ConnectionManagerFactory>::Ref cmf
= ConnectionManagerFactory::getInstance();
configure(cmf, connectionManagerConfig);
acf = AuthenticationClientFactory::getInstance();
configure(acf, authenticationClientConfig);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in configuration file");
} catch (xmlpp::exception &e) {
@ -140,7 +95,7 @@ RevertEditedPlaylistMethodTest :: setUp(void) throw ()
CPPUNIT_FAIL(e.what());
}
authentication = acf->getAuthenticationClient();
authentication = scheduler->getAuthentication();
try {
sessionId = authentication->login("root", "q");
} catch (XmlRpcException &e) {

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RevertEditedPlaylistMethodTest.h,v $
------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -63,8 +64,8 @@ using namespace LiveSupport::Authentication;
/**
* Unit test for the RevertEditedPlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see RevertEditedPlaylistMethod
*/
class RevertEditedPlaylistMethodTest : public CPPUNIT_NS::TestFixture
@ -75,23 +76,6 @@ class RevertEditedPlaylistMethodTest : public CPPUNIT_NS::TestFixture
private:
/**
* The name of the configuration file for the storage client factory.
*/
static const std::string storageClientConfig;
/**
* The name of the configuration file for the connection manager
* factory.
*/
static const std::string connectionManagerConfig;
/**
* The name of the configuration file for the authentication client
* factory.
*/
static const std::string authenticationClientConfig;
/**
* The authentication client produced by the factory.
*/
@ -102,19 +86,6 @@ class RevertEditedPlaylistMethodTest : 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,
std::string fileName)
throw (std::invalid_argument,
xmlpp::exception);
protected:

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.13 $
Author : $Author: maroy $
Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcAddAudioClipToPlaylistTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcAddAudioClipToPlaylistTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -109,7 +115,10 @@ RpcAddAudioClipToPlaylistTest :: firstTest(void)
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
parameters["playlistId"] = "0000000000000001";

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcAddAudioClipToPlaylistTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the AddAudioClipToPlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see AddAudioClipToPlaylistMethod
*/
class RpcAddAudioClipToPlaylistTest : public CPPUNIT_NS::TestFixture
class RpcAddAudioClipToPlaylistTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcAddAudioClipToPlaylistTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.6 $
Author : $Author: maroy $
Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcCreatePlaylistTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcCreatePlaylistTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcCreatePlaylistTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -109,7 +115,10 @@ RpcCreatePlaylistTest :: firstTest(void)
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
result.clear();

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcCreatePlaylistTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the CreatePlaylistMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see CreatePlaylistMethod
*/
class RpcCreatePlaylistTest : public CPPUNIT_NS::TestFixture
class RpcCreatePlaylistTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcCreatePlaylistTest);
CPPUNIT_TEST(firstTest);

View File

@ -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/products/scheduler/src/Attic/RpcDeletePlaylistTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcDeletePlaylistTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcDeletePlaylistTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -106,7 +112,10 @@ void
RpcDeletePlaylistTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
@ -142,7 +151,10 @@ void
RpcDeletePlaylistTest :: negativeTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/RpcDeletePlaylistTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -64,10 +65,10 @@ using namespace LiveSupport::Core;
*
* @author $Author: maroy, fgerlits
$
* @version $Revision: 1.3 $
* @version $Revision: 1.4 $
* @see DeletePlaylistMethod
*/
class RpcDeletePlaylistTest : public CPPUNIT_NS::TestFixture
class RpcDeletePlaylistTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDeletePlaylistTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.10 $
Author : $Author: maroy $
Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcDisplayAudioClipTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcDisplayAudioClipTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -106,7 +112,10 @@ void
RpcDisplayAudioClipTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
@ -136,7 +145,10 @@ void
RpcDisplayAudioClipTest :: negativeTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayAudioClipTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the DisplayAudioClipMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see DisplayAudioClipMethod
*/
class RpcDisplayAudioClipTest : public CPPUNIT_NS::TestFixture
class RpcDisplayAudioClipTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDisplayAudioClipTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.7 $
Author : $Author: maroy $
Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayAudioClipsTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcDisplayAudioClipsTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcDisplayAudioClipsTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -106,7 +112,10 @@ void
RpcDisplayAudioClipsTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayAudioClipsTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the DisplayAudioClipsMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see RpcDisplayAudioClips
*/
class RpcDisplayAudioClipsTest : public CPPUNIT_NS::TestFixture
class RpcDisplayAudioClipsTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDisplayAudioClipsTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.12 $
Author : $Author: maroy $
Version : $Revision: 1.13 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcDisplayPlaylistTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcDisplayPlaylistTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -109,7 +115,10 @@ RpcDisplayPlaylistTest :: simpleTest(void)
XmlRpcValue parameters;
XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
parameters["playlistId"] = "0000000000000001";
@ -140,7 +149,10 @@ RpcDisplayPlaylistTest :: negativeTest(void)
XmlRpcValue parameters;
XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
parameters["playlistId"] = "0000000000009999";

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test to test the displayPlaylist XML-RPC call.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see SchedulerDaemon
*/
class RpcDisplayPlaylistTest : public CPPUNIT_NS::TestFixture
class RpcDisplayPlaylistTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDisplayPlaylistTest);
CPPUNIT_TEST(simpleTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.10 $
Author : $Author: maroy $
Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcDisplayPlaylistsTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcDisplayPlaylistsTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -106,7 +112,10 @@ void
RpcDisplayPlaylistsTest :: firstTest(void)
throw (CPPUNIT_NS::Exception)
{
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.3 $
Author : $Author: maroy $
Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayPlaylistsTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the DisplayPlaylistsMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.3 $
* @author $Author: maroy $
* @version $Revision: 1.4 $
* @see DisplayPlaylistsMethod
*/
class RpcDisplayPlaylistsTest : public CPPUNIT_NS::TestFixture
class RpcDisplayPlaylistsTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDisplayPlaylistsTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.7 $
Author : $Author: maroy $
Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayScheduleTest.cxx,v $
------------------------------------------------------------------------------*/
@ -92,7 +92,10 @@ RpcDisplayScheduleTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -118,7 +121,10 @@ RpcDisplayScheduleTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -142,7 +148,10 @@ RpcDisplayScheduleTest :: simpleTest(void)
XmlRpcValue result;
struct tm time;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
// list the schedules for an interval (as the database is empty,
// it's going to return an empty result set)
@ -181,7 +190,10 @@ RpcDisplayScheduleTest :: faultTest(void)
XmlRpcValue parameters;
XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
result.clear();
xmlRpcClient.execute("displaySchedule", parameters, result);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcDisplayScheduleTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test to test the displaySchedule XML-RPC call.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see SchedulerDaemon
*/
class RpcDisplayScheduleTest : public CPPUNIT_NS::TestFixture
class RpcDisplayScheduleTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcDisplayScheduleTest);
CPPUNIT_TEST(simpleTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Author : $Author: maroy $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGeneratePlayReportTest.cxx,v $
------------------------------------------------------------------------------*/
@ -91,7 +91,10 @@ RpcGeneratePlayReportTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -117,7 +120,10 @@ RpcGeneratePlayReportTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -166,7 +172,10 @@ RpcGeneratePlayReportTest :: firstTest(void)
XmlRpc::XmlRpcValue result;
struct tm time;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
// set up a structure for the parameters
parameters["sessionId"] = sessionId->getId();
@ -205,7 +214,10 @@ RpcGeneratePlayReportTest :: intervalTest(void)
XmlRpc::XmlRpcValue result;
struct tm time;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
// check for the interval 2004-10-26 between 13 and 15 o'clock
parameters["sessionId"] = sessionId->getId();

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Author : $Author: maroy $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGeneratePlayReportTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the GeneratePlayReportMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.1 $
* @author $Author: maroy $
* @version $Revision: 1.2 $
* @see GeneratePlayReportMethod
*/
class RpcGeneratePlayReportTest : public CPPUNIT_NS::TestFixture
class RpcGeneratePlayReportTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcGeneratePlayReportTest);
CPPUNIT_TEST(firstTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGetSchedulerTimeTest.cxx,v $
------------------------------------------------------------------------------*/
@ -110,7 +110,10 @@ RpcGetSchedulerTimeTest :: simpleTest(void)
struct tm time1,
time2;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
result.clear();
xmlRpcClient.execute("getSchedulerTime", parameters, result);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGetSchedulerTimeTest.h,v $
------------------------------------------------------------------------------*/
@ -42,6 +42,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -59,11 +60,11 @@ using namespace LiveSupport::Core;
/**
* Unit test to test the getSchedulerTime XML-RPC call.
*
* @author $Author: fgerlits $
* @version $Revision: 1.4 $
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @see SchedulerDaemon
*/
class RpcGetSchedulerTimeTest : public CPPUNIT_NS::TestFixture
class RpcGetSchedulerTimeTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcGetSchedulerTimeTest);
CPPUNIT_TEST(simpleTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.4 $
Author : $Author: maroy $
Version : $Revision: 1.5 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGetVersionTest.cxx,v $
------------------------------------------------------------------------------*/
@ -91,7 +91,10 @@ RpcGetVersionTest :: simpleTest(void)
XmlRpcValue parameters;
XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
result.clear();
xmlRpcClient.execute("getVersion", parameters, result);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.2 $
Author : $Author: maroy $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcGetVersionTest.h,v $
------------------------------------------------------------------------------*/
@ -42,6 +42,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -57,11 +58,11 @@ namespace Scheduler {
/**
* Unit test to test the getVersion XML-RPC call.
*
* @author $Author: fgerlits $
* @version $Revision: 1.2 $
* @author $Author: maroy $
* @version $Revision: 1.3 $
* @see SchedulerDaemon
*/
class RpcGetVersionTest : public CPPUNIT_NS::TestFixture
class RpcGetVersionTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcGetVersionTest);
CPPUNIT_TEST(simpleTest);

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.2 $
Author : $Author: maroy $
Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcOpenPlaylistForEditingTest.cxx,v $
------------------------------------------------------------------------------*/
@ -63,7 +63,10 @@ RpcOpenPlaylistForEditingTest :: setUp(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result));
CPPUNIT_ASSERT(!xmlRpcClient.isFault());
@ -89,7 +92,10 @@ RpcOpenPlaylistForEditingTest :: tearDown(void) throw ()
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpc::XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result));
@ -109,7 +115,10 @@ RpcOpenPlaylistForEditingTest :: firstTest(void)
XmlRpc::XmlRpcValue parameters;
XmlRpc::XmlRpcValue result;
XmlRpcClient xmlRpcClient("localhost", 3344, "/RPC2", false);
XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(),
getXmlRpcPort(),
"/RPC2",
false);
parameters["sessionId"] = sessionId->getId();
parameters["playlistId"] = "0000000000000001";

View File

@ -21,8 +21,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: fgerlits $
Version : $Revision: 1.1 $
Author : $Author: maroy $
Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/RpcOpenPlaylistForEditingTest.h,v $
------------------------------------------------------------------------------*/
@ -45,6 +45,7 @@
#include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h"
#include "BaseTestMethod.h"
namespace LiveSupport {
namespace Scheduler {
@ -62,11 +63,11 @@ using namespace LiveSupport::Core;
/**
* Unit test for the OpenPlaylistForEditingMethod class.
*
* @author $Author: fgerlits $
* @version $Revision: 1.1 $
* @author $Author: maroy $
* @version $Revision: 1.2 $
* @see OpenPlaylistForEditingMethod
*/
class RpcOpenPlaylistForEditingTest : public CPPUNIT_NS::TestFixture
class RpcOpenPlaylistForEditingTest : public BaseTestMethod
{
CPPUNIT_TEST_SUITE(RpcOpenPlaylistForEditingTest);
CPPUNIT_TEST(firstTest);

Some files were not shown because too many files have changed in this diff Show More