diff --git a/livesupport/modules/storage/src/TestStorageClientTest.cxx b/livesupport/modules/storage/src/TestStorageClientTest.cxx index a299dd8a6..fef16e3aa 100644 --- a/livesupport/modules/storage/src/TestStorageClientTest.cxx +++ b/livesupport/modules/storage/src/TestStorageClientTest.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -117,3 +117,30 @@ TestStorageClientTest :: firstTest(void) CPPUNIT_ASSERT(playlist->getId()->getId() == id1->getId()); } + +/*------------------------------------------------------------------------------ + * Testing the deletePlaylist method + *----------------------------------------------------------------------------*/ +void +TestStorageClientTest :: deletePlaylistTest(void) + throw (CPPUNIT_NS::Exception) +{ + Ptr::Ref id1(new UniqueId(1)); + Ptr::Ref id2(new UniqueId(2)); + + try { + tsc->deletePlaylist(id2); + CPPUNIT_FAIL("allowed to delete non-existent playlist"); + } catch (std::invalid_argument &e) { + } + try { + tsc->deletePlaylist(id1); + } catch (std::invalid_argument &e) { + CPPUNIT_FAIL("cannot delete existing playlist"); + } + try { + tsc->deletePlaylist(id1); + CPPUNIT_FAIL("allowed to delete non-existent playlist"); + } catch (std::invalid_argument &e) { + } +} diff --git a/livesupport/modules/storage/src/TestStorageClientTest.h b/livesupport/modules/storage/src/TestStorageClientTest.h index e672b363a..bd3a12e15 100644 --- a/livesupport/modules/storage/src/TestStorageClientTest.h +++ b/livesupport/modules/storage/src/TestStorageClientTest.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Author : $Author: fgerlits $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/TestStorageClientTest.h,v $ ------------------------------------------------------------------------------*/ @@ -57,14 +57,15 @@ namespace Storage { /** * Unit test for the UploadPlaylistMetohd class. * - * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @author $Author: fgerlits $ + * @version $Revision: 1.2 $ * @see TestStorageClient */ class TestStorageClientTest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(TestStorageClientTest); CPPUNIT_TEST(firstTest); + CPPUNIT_TEST(deletePlaylistTest); CPPUNIT_TEST_SUITE_END(); private: @@ -83,6 +84,15 @@ class TestStorageClientTest : public CPPUNIT_NS::TestFixture void firstTest(void) throw (CPPUNIT_NS::Exception); + /** + * Testing deletePlaylist(). + * + * @exception CPPUNIT_NS::Exception on test failures. + */ + void + deletePlaylistTest(void) + throw (CPPUNIT_NS::Exception); + public: /**