updated products/gLiveSupport/AudioPlayerTest

(see bug #1231)
This commit is contained in:
fgerlits 2005-07-03 12:46:56 +00:00
parent d65946151a
commit 366a4d0ea2
5 changed files with 69 additions and 19 deletions

View file

@ -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: maroy $ # Author : $Author: fgerlits $
# Version : $Revision: 1.6 $ # Version : $Revision: 1.7 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/user_setup.sh,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/user_setup.sh,v $
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -311,6 +311,14 @@ cat $products_dir/gLiveSupport/etc/gLiveSupport.xml.user-template \
| sed -e "$replace_sed_string" \ | sed -e "$replace_sed_string" \
> $configdir/gLiveSupport.xml > $configdir/gLiveSupport.xml
cat $products_dir/gLiveSupport/etc/authenticationClient.xml.user-template \
| sed -e "$replace_sed_string" \
> $configdir/authenticationClient.xml
cat $products_dir/gLiveSupport/etc/storageClient.xml.user-template \
| sed -e "$replace_sed_string" \
> $configdir/storageClient.xml
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Create the public html directory, and links to the PHP directories # Create the public html directory, and links to the PHP directories

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,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE storageClientFactory [
<!ELEMENT storageClientFactory (webStorage|testStorage) >
<!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 >
]>
<storageClientFactory>
<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>
</storageClientFactory>

View file

@ -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: maroy $ Author : $Author: fgerlits $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AudioPlayerTest.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AudioPlayerTest.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -76,13 +76,13 @@ static const std::string audioPlayerConfigFileName
* The name of the configuration file for the local storage. * The name of the configuration file for the local storage.
*/ */
static const std::string storageClientConfigFileName static const std::string storageClientConfigFileName
= "etc/storageClient.xml"; = "storageClient.xml";
/** /**
* The name of the configuration file for the authentication client. * The name of the configuration file for the authentication client.
*/ */
static const std::string authenticationClientConfigFileName static const std::string authenticationClientConfigFileName
= "etc/authenticationClient.xml"; = "authenticationClient.xml";
/* =============================================== local function prototypes */ /* =============================================== local function prototypes */
@ -121,9 +121,9 @@ AudioPlayerTest :: setUp(void) throw ()
} }
try { try {
Ptr<xmlpp::DomParser>::Ref parser( xmlpp::DomParser parser;
new xmlpp::DomParser(storageClientConfigFileName, true)); const xmlpp::Document * document = getConfigDocument(parser,
const xmlpp::Document * document = parser->get_document(); storageClientConfigFileName);
const xmlpp::Element * root = document->get_root_node(); const xmlpp::Element * root = document->get_root_node();
Ptr<StorageClientFactory>::Ref storageClientFactory; Ptr<StorageClientFactory>::Ref storageClientFactory;
@ -145,9 +145,9 @@ AudioPlayerTest :: setUp(void) throw ()
} }
try { try {
Ptr<xmlpp::DomParser>::Ref parser( xmlpp::DomParser parser;
new xmlpp::DomParser(authenticationClientConfigFileName, true)); const xmlpp::Document * document = getConfigDocument(parser,
const xmlpp::Document * document = parser->get_document(); authenticationClientConfigFileName);
const xmlpp::Element * root = document->get_root_node(); const xmlpp::Element * root = document->get_root_node();
Ptr<AuthenticationClientFactory>::Ref authentClientFactory; Ptr<AuthenticationClientFactory>::Ref authentClientFactory;
@ -252,7 +252,7 @@ AudioPlayerTest :: playAudioClipTest(void)
CPPUNIT_ASSERT(!audioPlayer->isPlaying()); CPPUNIT_ASSERT(!audioPlayer->isPlaying());
CPPUNIT_ASSERT_NO_THROW( CPPUNIT_ASSERT_NO_THROW(
storage->releaseAudioClip(sessionId, audioClip) storage->releaseAudioClip(audioClip)
); );
audioPlayer->close(); audioPlayer->close();
} }
@ -282,9 +282,11 @@ AudioPlayerTest :: playPlaylistTest(void)
); );
CPPUNIT_ASSERT_NO_THROW( CPPUNIT_ASSERT_NO_THROW(
audioPlayer->openAndStart(playlist) audioPlayer->open(*playlist->getUri())
); );
CPPUNIT_ASSERT(!audioPlayer->isPlaying());
CPPUNIT_ASSERT_NO_THROW(audioPlayer->start());
CPPUNIT_ASSERT(audioPlayer->isPlaying()); CPPUNIT_ASSERT(audioPlayer->isPlaying());
Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10))); Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10)));
@ -294,7 +296,7 @@ AudioPlayerTest :: playPlaylistTest(void)
CPPUNIT_ASSERT(!audioPlayer->isPlaying()); CPPUNIT_ASSERT(!audioPlayer->isPlaying());
CPPUNIT_ASSERT_NO_THROW( CPPUNIT_ASSERT_NO_THROW(
storage->releasePlaylist(sessionId, playlist) storage->releasePlaylist(playlist)
); );
audioPlayer->close(); audioPlayer->close();
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AudioPlayerTest.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AudioPlayerTest.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -44,6 +44,7 @@
#include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/Ptr.h"
#include "LiveSupport/Core/SessionId.h" #include "LiveSupport/Core/SessionId.h"
#include "LiveSupport/Core/BaseTestMethod.h"
namespace LiveSupport { namespace LiveSupport {
@ -60,13 +61,13 @@ using namespace LiveSupport::Core;
/* =============================================================== data types */ /* =============================================================== data types */
/** /**
* Testing the AudioPlayerInterface::openAndStart() method. * Testing audio playback from the storage.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.1 $ * @version $Revision: 1.2 $
* @see AudioPlayerFactory * @see AudioPlayerFactory
*/ */
class AudioPlayerTest : public CPPUNIT_NS::TestFixture class AudioPlayerTest : public BaseTestMethod
{ {
CPPUNIT_TEST_SUITE(AudioPlayerTest); CPPUNIT_TEST_SUITE(AudioPlayerTest);
CPPUNIT_TEST(firstTest); CPPUNIT_TEST(firstTest);