modified storage test data to make the testStorageClient and the webS.C.

more similar
This commit is contained in:
fgerlits 2005-01-26 17:51:34 +00:00
parent d9f37bf0b5
commit e273b4eb80
11 changed files with 111 additions and 54 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.32 $
Version : $Revision: 1.33 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/
@ -708,7 +708,7 @@ WebStorageClient :: createPlaylist(Ptr<SessionId>::Ref sessionId)
<< createPlaylistMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(createPlaylistResultParamName)
@ -780,7 +780,7 @@ WebStorageClient :: existsPlaylist(Ptr<SessionId>::Ref sessionId,
<< existsPlaylistMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(existsPlaylistResultParamName)
@ -842,7 +842,7 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
<< getPlaylistOpenMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(getPlaylistUrlParamName)
@ -901,7 +901,7 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
<< getPlaylistCloseMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(getPlaylistPlaylistIdParamName)
@ -998,7 +998,7 @@ WebStorageClient :: editPlaylistGetUrl(Ptr<SessionId>::Ref sessionId,
<< editPlaylistMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(editPlaylistUrlParamName)
@ -1073,7 +1073,7 @@ WebStorageClient :: savePlaylist(Ptr<SessionId>::Ref sessionId,
<< savePlaylistMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(savePlaylistResultParamName)
@ -1271,7 +1271,7 @@ WebStorageClient :: deletePlaylist(Ptr<SessionId>::Ref sessionId,
<< deletePlaylistMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(deletePlaylistResultParamName)
@ -1345,7 +1345,7 @@ WebStorageClient :: existsAudioClip(Ptr<SessionId>::Ref sessionId,
<< existsAudioClipMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(existsAudioClipResultParamName)
@ -1399,7 +1399,7 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
<< getAudioClipOpenMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(getAudioClipUrlParamName)
@ -1460,7 +1460,7 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
<< getAudioClipCloseMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(getAudioClipAudioClipIdParamName)
@ -1540,7 +1540,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
<< storeAudioClipOpenMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(storeAudioClipUrlParamName)
@ -1618,7 +1618,7 @@ WebStorageClient :: storeAudioClip(Ptr<SessionId>::Ref sessionId,
<< storeAudioClipCloseMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(storeAudioClipAudioClipIdParamName)
@ -1683,7 +1683,7 @@ WebStorageClient :: acquireAudioClip(Ptr<SessionId>::Ref sessionId,
<< acquireAudioClipMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(acquireAudioClipUrlParamName)
@ -1749,7 +1749,7 @@ WebStorageClient :: releaseAudioClip(Ptr<SessionId>::Ref sessionId,
<< releaseAudioClipMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(releaseAudioClipResultParamName)
@ -1814,7 +1814,7 @@ WebStorageClient :: deleteAudioClip(Ptr<SessionId>::Ref sessionId,
<< deleteAudioClipMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(deleteAudioClipResultParamName)
@ -1885,7 +1885,7 @@ WebStorageClient :: reset(void)
<< resetStorageMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(resetStorageAudioClipResultParamName)
@ -1975,7 +1975,7 @@ WebStorageClient :: search(Ptr<SessionId>::Ref sessionId,
<< searchMethodName
<< "' returned error message:\n"
<< result;
throw XmlRpcMethodFaultException(eMsg.str());
throw Core::XmlRpcMethodFaultException(eMsg.str());
}
if (! result.hasMember(searchAudioClipResultParamName)

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.33 $
Version : $Revision: 1.34 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClientTest.cxx,v $
------------------------------------------------------------------------------*/
@ -187,7 +187,7 @@ WebStorageClientTest :: playlistTest(void)
CPPUNIT_FAIL(e.what());
}
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() >= 3);
Ptr<UniqueId>::Ref audioClipId = wsc->getAudioClipIds()->at(0);
Ptr<UniqueId>::Ref audioClipId = wsc->getAudioClipIds()->at(2);
Ptr<SessionId>::Ref sessionId;
try {
@ -504,7 +504,7 @@ WebStorageClientTest :: simplePlaylistTest(void)
} catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what());
}
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() >= 3);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() >= 1);
Ptr<UniqueId>::Ref audioClipId = wsc->getAudioClipIds()->at(0);
Ptr<SessionId>::Ref sessionId;
@ -596,10 +596,12 @@ WebStorageClientTest :: searchTest(void)
} catch (XmlRpcException &e) {
CPPUNIT_FAIL(e.what());
}
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() >= 3);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() >= 5);
Ptr<UniqueId>::Ref audioClip0 = wsc->getAudioClipIds()->at(0);
Ptr<UniqueId>::Ref audioClip1 = wsc->getAudioClipIds()->at(1);
Ptr<UniqueId>::Ref audioClip2 = wsc->getAudioClipIds()->at(2);
Ptr<UniqueId>::Ref audioClip3 = wsc->getAudioClipIds()->at(3);
Ptr<UniqueId>::Ref audioClip4 = wsc->getAudioClipIds()->at(4);
CPPUNIT_ASSERT(wsc->getPlaylistIds()->size() >= 1);
Ptr<UniqueId>::Ref playlist0 = wsc->getPlaylistIds()->at(0);
@ -618,8 +620,8 @@ WebStorageClientTest :: searchTest(void)
int numberFound = wsc->search(sessionId, criteria);
CPPUNIT_ASSERT(numberFound == 2);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() == 2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip0);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(1) == *audioClip2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(1) == *audioClip4);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL(e.what());
@ -652,7 +654,7 @@ WebStorageClientTest :: searchTest(void)
int numberFound = wsc->search(sessionId, criteria);
CPPUNIT_ASSERT(numberFound == 1);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() == 1);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip1);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip3);
CPPUNIT_ASSERT(wsc->getPlaylistIds()->size() == 0);
} catch (std::invalid_argument &e) {
@ -663,12 +665,13 @@ WebStorageClientTest :: searchTest(void)
try {
Ptr<SearchCriteria>::Ref criteria(new SearchCriteria("all", "or"));
criteria->addCondition("dcterms:extent", ">", "00:00:11.000000");
criteria->addCondition("dc:title", "prefix", "File2");
criteria->addCondition("dcterms:extent", "<", "00:00:03.000000");
criteria->addCondition("dc:title", "prefix", "My");
int numberFound = wsc->search(sessionId, criteria);
CPPUNIT_ASSERT(numberFound == 2);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() == 1);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip1);
CPPUNIT_ASSERT(numberFound == 3);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() == 2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip3);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(1) == *audioClip4);
CPPUNIT_ASSERT(wsc->getPlaylistIds()->size() == 1);
CPPUNIT_ASSERT(*wsc->getPlaylistIds()->at(0) == *playlist0);
@ -683,12 +686,12 @@ WebStorageClientTest :: searchTest(void)
criteria->setType("all");
criteria->addCondition("dc:title", "partial", "t");
criteria->setLimit(2);
criteria->setOffset(1);
criteria->setOffset(2);
int numberFound = wsc->search(sessionId, criteria);
CPPUNIT_ASSERT(numberFound == 4);
CPPUNIT_ASSERT(numberFound == 5);
CPPUNIT_ASSERT(wsc->getAudioClipIds()->size() == 2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip1);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(1) == *audioClip2);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(0) == *audioClip3);
CPPUNIT_ASSERT(*wsc->getAudioClipIds()->at(1) == *audioClip4);
CPPUNIT_ASSERT(wsc->getPlaylistIds()->size() == 0);
} catch (std::invalid_argument &e) {

View File

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<playlist id="1" playlength="00:00:23.000"
<playlist id="1" playlength="01:30:00.000000"
title="My First Playlist">
<playlistElement id="101" relativeOffset="0" >
<audioClip id="10001" playlength="00:00:11.000"
title="one" />
<audioClip id="10001" playlength="01:00:00.000000" title="one"/>
</playlistElement>
<playlistElement id="102" relativeOffset="00:00:11.000000" >
<audioClip id="10002" playlength="00:00:12.000000"
title="two" />
<playlistElement id="102" relativeOffset="01:00:00.000000" >
<audioClip id="10002" playlength="00:30:00.000000" title="two"/>
</playlistElement>
<metadata
xmlns="http://www.streamonthefly.org/"
@ -18,6 +16,6 @@
>
<dc:title>My First Playlist</dc:title>
<dc:creator>Me, myself and I</dc:creator>
<dcterms:extent>00:00:23.000000</dcterms:extent>
<dcterms:extent>01:30:00.000000</dcterms:extent>
</metadata>
</playlist>

View File

@ -1,5 +1,17 @@
<?
$sampleData = array(
array(
'type' => 'audioclip',
'media' => '../tests/test10001.mp3',
'xml' => '../tests/mdata10001.xml',
'gunid' => '0000000000010001'
),
array(
'type' => 'audioclip',
'media' => '../tests/test10002.mp3',
'xml' => '../tests/mdata10002.xml',
'gunid' => '0000000000010002'
),
array(
'type' => 'audioclip',
'media' => '../tests/ex1.mp3',
@ -20,7 +32,7 @@
array(
'type' => 'playlist',
'xml' => '../tests/plist1.xml',
'gunid' => '123456789abcdef3'
'gunid' => '0000000000000001'
)
);
?>

View File

@ -21,7 +21,7 @@
#
#
# Author : $Author: fgerlits $
# Version : $Revision: 1.45 $
# Version : $Revision: 1.46 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/etc/Makefile.in,v $
#
# @configure_input@
@ -242,6 +242,7 @@ 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
all: dir_setup ${SCHEDULER_EXE}
@ -271,7 +272,9 @@ depclean: clean
distclean: clean docclean
${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te*
check: all ${TEST_RUNNER} storage_server_init start run_tests stop
check: all ${TEST_RUNNER} start run_tests stop
check_web: all ${TEST_RUNNER} storage_server_init start_web run_tests stop_web
run_tests: ${TEST_RUNNER}
${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT}
@ -319,7 +322,7 @@ uninstall_web: ${SCHEDULER_EXE}
${SCHEDULER_EXE} -c ${SCHEDULER_WEB_CFG} uninstall
storage_server_init:
# ${MAKE} -C ${STORAGE_SERVER_DIR}
${MAKE} -C ${STORAGE_SERVER_DIR}
kill:
${KILLALL} scheduler

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE authenticationClientFactory [
<!ELEMENT authenticationClientFactory (testAuthentication|
webAuthentication)>
<!ELEMENT testAuthentication (user) >
<!ELEMENT user EMPTY >
<!ATTLIST user login CDATA #REQUIRED >
<!ATTLIST user password CDATA #REQUIRED >
]>
<authenticationClientFactory>
<testAuthentication>
<user login="root" password="q" />
</testAuthentication>
</authenticationClientFactory>

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="localhost" port="80"
path="/livesupportStorageServer/xmlrpc/xrLocStor.php" />
</webAuthentication>
</authenticationClientFactory>

View File

@ -1,16 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE webStorage [
<!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 >
]>
<webStorage tempFiles="file:///tmp/webStorageClient" >
<location server="localhost" port="80"
path="/livesupportStorageServer/xmlrpc/xrLocStor.php" />
</webStorage>
<storageClientFactory>
<webStorage tempFiles="file:///tmp/webStorageClient" >
<location server="localhost" port="80"
path="/livesupportStorageServer/xmlrpc/xrLocStor.php" />
</webStorage>
</storageClientFactory>

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.14 $
Version : $Revision: 1.15 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/UploadPlaylistMethod.cxx,v $
------------------------------------------------------------------------------*/
@ -143,7 +143,7 @@ UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter,
Ptr<Playlist>::Ref playlist;
try {
playlist = storage->getPlaylist(sessionId, playlistId);
} catch (XmlRpcException &e) {
} catch (Core::XmlRpcException &e) {
std::string eMsg = "playlist not found:\n";
eMsg += e.what();
XmlRpcTools::markError(errorId+4, eMsg, returnValue);