updated tests to reflect added playlog to playlist events
This commit is contained in:
parent
de1e870d3f
commit
0b72824f47
4 changed files with 59 additions and 14 deletions
|
@ -21,8 +21,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.5 $
|
Version : $Revision: 1.6 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
#include "LiveSupport/Storage/StorageClientFactory.h"
|
#include "LiveSupport/Storage/StorageClientFactory.h"
|
||||||
#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h"
|
#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h"
|
||||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||||
|
#include "PlayLogFactory.h"
|
||||||
|
|
||||||
#include "PlaylistEventContainer.h"
|
#include "PlaylistEventContainer.h"
|
||||||
#include "PlaylistEventContainerTest.h"
|
#include "PlaylistEventContainerTest.h"
|
||||||
|
@ -96,6 +97,11 @@ static const std::string scheduleConfigFileName = "etc/scheduleFactory.xml";
|
||||||
static const std::string authenticationClientConfigFileName =
|
static const std::string authenticationClientConfigFileName =
|
||||||
"etc/authenticationClient.xml";
|
"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 */
|
/* =============================================== local function prototypes */
|
||||||
|
|
||||||
|
@ -149,6 +155,12 @@ PlaylistEventContainerTest :: setUp(void) throw ()
|
||||||
acf->configure(*(parser->get_document()->get_root_node()));
|
acf->configure(*(parser->get_document()->get_root_node()));
|
||||||
authentication = acf->getAuthenticationClient();
|
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();
|
||||||
|
|
||||||
} catch (std::invalid_argument &e) {
|
} catch (std::invalid_argument &e) {
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
CPPUNIT_FAIL("semantic error in configuration file");
|
CPPUNIT_FAIL("semantic error in configuration file");
|
||||||
|
@ -159,6 +171,7 @@ PlaylistEventContainerTest :: setUp(void) throw ()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
scheduleFactory->install();
|
scheduleFactory->install();
|
||||||
|
playLog->install();
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
CPPUNIT_FAIL("can't install schedule factory");
|
CPPUNIT_FAIL("can't install schedule factory");
|
||||||
|
@ -179,7 +192,9 @@ PlaylistEventContainerTest :: tearDown(void) throw ()
|
||||||
{
|
{
|
||||||
audioPlayer->deInitialize();
|
audioPlayer->deInitialize();
|
||||||
scheduleFactory->uninstall();
|
scheduleFactory->uninstall();
|
||||||
|
playLog->uninstall();
|
||||||
|
|
||||||
|
playLog.reset();
|
||||||
schedule.reset();
|
schedule.reset();
|
||||||
scheduleFactory.reset();
|
scheduleFactory.reset();
|
||||||
storage.reset();
|
storage.reset();
|
||||||
|
@ -202,7 +217,8 @@ PlaylistEventContainerTest :: simpleTest(void)
|
||||||
container.reset(new PlaylistEventContainer(sessionId,
|
container.reset(new PlaylistEventContainer(sessionId,
|
||||||
storage,
|
storage,
|
||||||
schedule,
|
schedule,
|
||||||
audioPlayer));
|
audioPlayer,
|
||||||
|
playLog));
|
||||||
|
|
||||||
// see that there are no events scheduled
|
// see that there are no events scheduled
|
||||||
Ptr<ScheduledEventInterface>::Ref scheduledEvent;
|
Ptr<ScheduledEventInterface>::Ref scheduledEvent;
|
||||||
|
@ -222,7 +238,8 @@ PlaylistEventContainerTest :: scheduleTest(void)
|
||||||
container.reset(new PlaylistEventContainer(sessionId,
|
container.reset(new PlaylistEventContainer(sessionId,
|
||||||
storage,
|
storage,
|
||||||
schedule,
|
schedule,
|
||||||
audioPlayer));
|
audioPlayer,
|
||||||
|
playLog));
|
||||||
|
|
||||||
// schedule playlist 1 at 10 seconds from now
|
// schedule playlist 1 at 10 seconds from now
|
||||||
Ptr<UniqueId>::Ref playlistId(new UniqueId(1));
|
Ptr<UniqueId>::Ref playlistId(new UniqueId(1));
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.3 $
|
Version : $Revision: 1.4 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventContainerTest.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -48,6 +48,7 @@
|
||||||
#include "LiveSupport/Storage/StorageClientInterface.h"
|
#include "LiveSupport/Storage/StorageClientInterface.h"
|
||||||
#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h"
|
#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h"
|
||||||
#include "ScheduleInterface.h"
|
#include "ScheduleInterface.h"
|
||||||
|
#include "PlayLogInterface.h"
|
||||||
#include "ScheduleFactory.h"
|
#include "ScheduleFactory.h"
|
||||||
|
|
||||||
namespace LiveSupport {
|
namespace LiveSupport {
|
||||||
|
@ -74,8 +75,8 @@ using namespace LiveSupport::Storage;
|
||||||
/**
|
/**
|
||||||
* Unit test for the PlaylistEventContainer class
|
* Unit test for the PlaylistEventContainer class
|
||||||
*
|
*
|
||||||
* @author $Author: fgerlits $
|
* @author $Author: maroy $
|
||||||
* @version $Revision: 1.3 $
|
* @version $Revision: 1.4 $
|
||||||
* @see PlaylistEventContainer
|
* @see PlaylistEventContainer
|
||||||
*/
|
*/
|
||||||
class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture
|
class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture
|
||||||
|
@ -111,6 +112,11 @@ class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture
|
||||||
*/
|
*/
|
||||||
Ptr<AuthenticationClientInterface>::Ref authentication;
|
Ptr<AuthenticationClientInterface>::Ref authentication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A playlog interface.
|
||||||
|
*/
|
||||||
|
Ptr<PlayLogInterface>::Ref playLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A session ID from the authentication client login() method.
|
* A session ID from the authentication client login() method.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.5 $
|
Version : $Revision: 1.6 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -46,6 +46,7 @@
|
||||||
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
#include "LiveSupport/Authentication/AuthenticationClientFactory.h"
|
||||||
#include "LiveSupport/Storage/StorageClientFactory.h"
|
#include "LiveSupport/Storage/StorageClientFactory.h"
|
||||||
#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h"
|
#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h"
|
||||||
|
#include "PlayLogFactory.h"
|
||||||
|
|
||||||
#include "PlaylistEvent.h"
|
#include "PlaylistEvent.h"
|
||||||
#include "PlaylistEventTest.h"
|
#include "PlaylistEventTest.h"
|
||||||
|
@ -82,6 +83,11 @@ static const std::string authenticationClientConfigFileName =
|
||||||
*/
|
*/
|
||||||
static const std::string storageClientConfigFileName = "etc/storageClient.xml";
|
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 */
|
/* =============================================== local function prototypes */
|
||||||
|
|
||||||
|
@ -121,6 +127,12 @@ PlaylistEventTest :: setUp(void) throw ()
|
||||||
acf->configure(*(parser->get_document()->get_root_node()));
|
acf->configure(*(parser->get_document()->get_root_node()));
|
||||||
authentication = acf->getAuthenticationClient();
|
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();
|
||||||
|
|
||||||
} catch (std::invalid_argument &e) {
|
} catch (std::invalid_argument &e) {
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
CPPUNIT_FAIL("semantic error in configuration file");
|
CPPUNIT_FAIL("semantic error in configuration file");
|
||||||
|
@ -130,6 +142,7 @@ PlaylistEventTest :: setUp(void) throw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
audioPlayer->initialize();
|
audioPlayer->initialize();
|
||||||
|
playLog->install();
|
||||||
|
|
||||||
duration.reset(new time_duration(seconds(30)));
|
duration.reset(new time_duration(seconds(30)));
|
||||||
|
|
||||||
|
@ -145,11 +158,13 @@ PlaylistEventTest :: setUp(void) throw ()
|
||||||
void
|
void
|
||||||
PlaylistEventTest :: tearDown(void) throw ()
|
PlaylistEventTest :: tearDown(void) throw ()
|
||||||
{
|
{
|
||||||
|
playLog->uninstall();
|
||||||
audioPlayer->deInitialize();
|
audioPlayer->deInitialize();
|
||||||
|
|
||||||
duration.reset();
|
duration.reset();
|
||||||
storage.reset();
|
storage.reset();
|
||||||
audioPlayer.reset();
|
audioPlayer.reset();
|
||||||
|
playLog.reset();
|
||||||
|
|
||||||
authentication->logout(sessionId);
|
authentication->logout(sessionId);
|
||||||
sessionId.reset();
|
sessionId.reset();
|
||||||
|
@ -178,6 +193,7 @@ PlaylistEventTest :: createTestEvent(void) throw ()
|
||||||
Ptr<PlaylistEvent>::Ref playlistEvent(new PlaylistEvent(sessionId,
|
Ptr<PlaylistEvent>::Ref playlistEvent(new PlaylistEvent(sessionId,
|
||||||
audioPlayer,
|
audioPlayer,
|
||||||
storage,
|
storage,
|
||||||
|
playLog,
|
||||||
scheduleEntry));
|
scheduleEntry));
|
||||||
|
|
||||||
return playlistEvent;
|
return playlistEvent;
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.4 $
|
Version : $Revision: 1.5 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
|
#include "LiveSupport/Authentication/AuthenticationClientInterface.h"
|
||||||
#include "LiveSupport/Storage/StorageClientInterface.h"
|
#include "LiveSupport/Storage/StorageClientInterface.h"
|
||||||
#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h"
|
#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h"
|
||||||
|
#include "PlayLogInterface.h"
|
||||||
|
|
||||||
|
|
||||||
namespace LiveSupport {
|
namespace LiveSupport {
|
||||||
|
@ -68,8 +69,8 @@ using namespace LiveSupport::PlaylistExecutor;
|
||||||
/**
|
/**
|
||||||
* Unit test for the PlaylistEvent class
|
* Unit test for the PlaylistEvent class
|
||||||
*
|
*
|
||||||
* @author $Author: fgerlits $
|
* @author $Author: maroy $
|
||||||
* @version $Revision: 1.4 $
|
* @version $Revision: 1.5 $
|
||||||
* @see PlaylistEvent
|
* @see PlaylistEvent
|
||||||
*/
|
*/
|
||||||
class PlaylistEventTest : public CPPUNIT_NS::TestFixture
|
class PlaylistEventTest : public CPPUNIT_NS::TestFixture
|
||||||
|
@ -101,6 +102,11 @@ class PlaylistEventTest : public CPPUNIT_NS::TestFixture
|
||||||
*/
|
*/
|
||||||
Ptr<AuthenticationClientInterface>::Ref authentication;
|
Ptr<AuthenticationClientInterface>::Ref authentication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A playlog interface.
|
||||||
|
*/
|
||||||
|
Ptr<PlayLogInterface>::Ref playLog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A session ID from the authentication client login() method.
|
* A session ID from the authentication client login() method.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue