|
|
Choosing A Webhost: |
[mb-commits] r7756 - in libmusicbrainz/branches/xmlws: include include/musi: msg#00364audio.musicbrainz.cvs
Author: luks Date: 2006-05-30 20:38:48 +0000 (Tue, 30 May 2006) New Revision: 7756 Modified: libmusicbrainz/branches/xmlws/include/Makefile.am libmusicbrainz/branches/xmlws/include/musicbrainz3/Makefile.am libmusicbrainz/branches/xmlws/include/musicbrainz3/metadata.h libmusicbrainz/branches/xmlws/include/musicbrainz3/query.h libmusicbrainz/branches/xmlws/include/musicbrainz3/webservice.h libmusicbrainz/branches/xmlws/src/Makefile.am libmusicbrainz/branches/xmlws/src/metadata.cpp libmusicbrainz/branches/xmlws/src/query.cpp libmusicbrainz/branches/xmlws/src/utilspriv.cpp libmusicbrainz/branches/xmlws/src/utilspriv.h libmusicbrainz/branches/xmlws/src/webservice.cpp libmusicbrainz/branches/xmlws/test/Makefile.am libmusicbrainz/branches/xmlws/test/test_ws.cpp Log: * Query::getUserByName, HTTP authentification * svn:eol-style=native Property changes on: libmusicbrainz/branches/xmlws/include/Makefile.am ___________________________________________________________________ Name: svn:eol-style + native Property changes on: libmusicbrainz/branches/xmlws/include/musicbrainz3/Makefile.am ___________________________________________________________________ Name: svn:eol-style + native Modified: libmusicbrainz/branches/xmlws/include/musicbrainz3/metadata.h =================================================================== --- libmusicbrainz/branches/xmlws/include/musicbrainz3/metadata.h 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/include/musicbrainz3/metadata.h 2006-05-30 20:38:48 UTC (rev 7756) @@ -107,6 +107,7 @@ * @note This is a MusicBrainz extension. */ UserList &getUserList(); + UserList getUserList(bool remove); /** * Returns a artist result list. @@ -114,6 +115,7 @@ * @return a vector of pointers to ArtistResult objects */ ArtistResultList &getArtistResults(); + ArtistResultList getArtistResults(bool remove); /** * Returns a track result list. @@ -121,6 +123,7 @@ * @return a vector of pointers to TrackResult objects */ TrackResultList &getTrackResults(); + TrackResultList getTrackResults(bool remove); /** * Returns a release result list. @@ -128,6 +131,7 @@ * @return a vector of pointers to ReleaseResult objects */ ReleaseResultList &getReleaseResults(); + ReleaseResultList getReleaseResults(bool remove); private: Modified: libmusicbrainz/branches/xmlws/include/musicbrainz3/query.h =================================================================== --- libmusicbrainz/branches/xmlws/include/musicbrainz3/query.h 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/include/musicbrainz3/query.h 2006-05-30 20:38:48 UTC (rev 7756) @@ -1,167 +1,192 @@ -/* - * MusicBrainz -- The Internet music metadatabase - * - * Copyright (C) 2006 Lukas Lalinsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __MUSICBRAINZ3_QUERY_H__ -#define __MUSICBRAINZ3_QUERY_H__ - -#include <string> -#include <musicbrainz3/webservice.h> -#include <musicbrainz3/metadata.h> -#include <musicbrainz3/model.h> - -namespace MusicBrainz -{ - - /** - * A simple interface to the MusicBrainz web service. - * - * This is a facade which provides a simple interface to the MusicBrainz - * web service. It hides all the details like fetching data from a server, - * parsing the XML and creating an object tree. Using this class, you can - * request data by ID or search the \e collection of all resources - * (artists, releases, or tracks) to retrieve those matching given - * criteria. - * - * @todo Add examples here. - */ - - class MB_API Query - { - public: - - /** - * Constructor. - * - * The \a ws parameter has to be a subclass of IWebService. - * If it isn't given, the default WebService class is used to - * create an IWebService instance. - * - * If the constructor is called without arguments, an instance - * of WebService is used, preconfigured to use the MusicBrainz - * server. This should be enough for most users. - * - * If you want to use queries which require authentication you - * have to pass a WebService instance where user name and - * password have been set. - * - * The \a clientId parameter is required for data submission. - * The format is \c "application-version", where \c application - * is your application's name and \c version is a version - * number which may not contain a '-' character. - * - * @param ws a pointer to subclass instance of IWebService, or \c NULL - * @param clientId a string containing the application's ID - */ - Query(IWebService *ws, const std::string &clientId); - - /** - * Destructor. - */ - virtual ~Query(); - - /** - * Returns an artist. - * - * If no artist with that ID can be found, \a include contains - * invalid tags or there's a server problem, an exception is - * raised. - * - * @param id a string containing the artist's ID - * @param include an ArtistIncludes instance - * - * @return a pointer to Artist instance, or \c NULL - * - * @note If the returned pointer is not \c NULL, the caller takes - * responsibility for deleting it when it is no longer needed. - * - * @throw ConnectionError couldn't connect to server - * @throw RequestError invalid ID or include tags - * @throw ResourceNotFoundError artist doesn't exist - * @throw ResponseError server returned invalid data - */ - - Artist *getArtistById(const std::string &id, - const ArtistIncludes &include = ArtistIncludes()); - - /** - * Returns a release. - * - * If no release with that ID can be found, C{include} contains - * invalid tags or there's a server problem, and exception is - * raised. - * - * @param id a string containing the release's ID - * @param include an ReleaseIncludes instance - * - * @return a pointer to Release instance, or \c NULL - * - * @note If the returned pointer is not \c NULL, the caller takes - * responsibility for deleting it when it is no longer needed. - * - * @throw ConnectionError couldn't connect to server - * @throw RequestError invalid ID or include tags - * @throw ResourceNotFoundError artist doesn't exist - * @throw ResponseError server returned invalid data - */ - - Release *getReleaseById(const std::string &id, - const ReleaseIncludes &include = ReleaseIncludes()); - - /** - * Returns a track. - * - * If no track with that ID can be found, \a include contains - * invalid tags or there's a server problem, and exception is - * raised. - * - * @param id a string containing the track's ID - * @param include an TrackIncludes instance - * - * @return a pointer to Track instance, or \c NULL - * - * @note If the returned pointer is not \c NULL, the caller takes - * responsibility for deleting it when it is no longer needed. - * - * @throw ConnectionError couldn't connect to server - * @throw RequestError invalid ID or include tags - * @throw ResourceNotFoundError artist doesn't exist - * @throw ResponseError server returned invalid data - */ - - Track *getTrackById(const std::string &id, - const TrackIncludes &include = TrackIncludes()); - - protected: - - template<typename IT, typename FT> - Metadata *getFromWebService(const std::string &entity, - const std::string &id, - const IT &include = IT(), - const FT &filter = FT()); - - private: - - IWebService *ws; - std::string clientId; - }; - -} - -#endif +/* + * MusicBrainz -- The Internet music metadatabase + * + * Copyright (C) 2006 Lukas Lalinsky + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __MUSICBRAINZ3_QUERY_H__ +#define __MUSICBRAINZ3_QUERY_H__ + +#include <string> +#include <musicbrainz3/webservice.h> +#include <musicbrainz3/metadata.h> +#include <musicbrainz3/model.h> + +namespace MusicBrainz +{ + + /** + * A simple interface to the MusicBrainz web service. + * + * This is a facade which provides a simple interface to the MusicBrainz + * web service. It hides all the details like fetching data from a server, + * parsing the XML and creating an object tree. Using this class, you can + * request data by ID or search the \e collection of all resources + * (artists, releases, or tracks) to retrieve those matching given + * criteria. + * + * @todo Add examples here. + */ + + class MB_API Query + { + public: + + /** + * Constructor. + * + * The \a ws parameter has to be a subclass of IWebService. + * If it isn't given, the default WebService class is used to + * create an IWebService instance. + * + * If the constructor is called without arguments, an instance + * of WebService is used, preconfigured to use the MusicBrainz + * server. This should be enough for most users. + * + * If you want to use queries which require authentication you + * have to pass a WebService instance where user name and + * password have been set. + * + * The \a clientId parameter is required for data submission. + * The format is \c "application-version", where \c application + * is your application's name and \c version is a version + * number which may not contain a '-' character. + * + * @param ws a pointer to subclass instance of IWebService, or \c NULL + * @param clientId a string containing the application's ID + */ + Query(IWebService *ws, const std::string &clientId); + + /** + * Destructor. + */ + virtual ~Query(); + + /** + * Returns an artist. + * + * If no artist with that ID can be found, \a include contains + * invalid tags or there's a server problem, an exception is + * raised. + * + * @param id a string containing the artist's ID + * @param include an ArtistIncludes instance + * + * @return a pointer to Artist instance, or \c NULL + * + * @note If the returned pointer is not \c NULL, the caller takes + * responsibility for deleting it when it is no longer needed. + * + * @throw ConnectionError couldn't connect to server + * @throw RequestError invalid ID or include tags + * @throw ResourceNotFoundError artist doesn't exist + * @throw ResponseError server returned invalid data + */ + + Artist *getArtistById(const std::string &id, + const ArtistIncludes &include = ArtistIncludes()); + + /** + * Returns a release. + * + * If no release with that ID can be found, C{include} contains + * invalid tags or there's a server problem, and exception is + * raised. + * + * @param id a string containing the release's ID + * @param include an ReleaseIncludes instance + * + * @return a pointer to Release instance, or \c NULL + * + * @note If the returned pointer is not \c NULL, the caller takes + * responsibility for deleting it when it is no longer needed. + * + * @throw ConnectionError couldn't connect to server + * @throw RequestError invalid ID or include tags + * @throw ResourceNotFoundError artist doesn't exist + * @throw ResponseError server returned invalid data + */ + + Release *getReleaseById(const std::string &id, + const ReleaseIncludes &include = ReleaseIncludes()); + + /** + * Returns a track. + * + * If no track with that ID can be found, \a include contains + * invalid tags or there's a server problem, and exception is + * raised. + * + * @param id a string containing the track's ID + * @param include an TrackIncludes instance + * + * @return a pointer to Track instance, or \c NULL + * + * @note If the returned pointer is not \c NULL, the caller takes + * responsibility for deleting it when it is no longer needed. + * + * @throw ConnectionError couldn't connect to server + * @throw RequestError invalid ID or include tags + * @throw ResourceNotFoundError artist doesn't exist + * @throw ResponseError server returned invalid data + */ + + Track *getTrackById(const std::string &id, + const TrackIncludes &include = TrackIncludes()); + + /** + * Returns information about a MusicBrainz user. + * + * You can only request user data if you know the user name and + * password for that account. If username and/or password are + * incorrect, an L{AuthenticationError} is raised. + * + * See the example in L{Query} on how to supply user name and + * password. + * + * @param name a string containing the user's name + * + * @return a pointer to User instance, or \c NULL + * + * @note If the returned pointer is not \c NULL, the caller takes + * responsibility for deleting it when it is no longer needed. + * + * @throw ConnectionError couldn't connect to server + * @throw RequestError invalid ID or include tags + * @throw ResourceNotFoundError artist doesn't exist + * @throw ResponseError server returned invalid data + */ + + User *getUserByName(const std::string &name); + + protected: + + template<typename IT, typename FT> + Metadata *getFromWebService(const std::string &entity, + const std::string &id, + const IT &include = IT(), + const FT &filter = FT()); + + private: + + IWebService *ws; + std::string clientId; + }; + +} + +#endif Property changes on: libmusicbrainz/branches/xmlws/include/musicbrainz3/query.h ___________________________________________________________________ Name: svn:eol-style + native Modified: libmusicbrainz/branches/xmlws/include/musicbrainz3/webservice.h =================================================================== --- libmusicbrainz/branches/xmlws/include/musicbrainz3/webservice.h 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/include/musicbrainz3/webservice.h 2006-05-30 20:38:48 UTC (rev 7756) @@ -193,6 +193,8 @@ private: + static int httpAuth(void *userdata, const char *realm, int attempts, + char *username, char *password); static int httpResponseReader(void *userdata, const char *buf, size_t len); std::string host; Property changes on: libmusicbrainz/branches/xmlws/src/Makefile.am ___________________________________________________________________ Name: svn:eol-style + native Modified: libmusicbrainz/branches/xmlws/src/metadata.cpp =================================================================== --- libmusicbrainz/branches/xmlws/src/metadata.cpp 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/src/metadata.cpp 2006-05-30 20:38:48 UTC (rev 7756) @@ -129,3 +129,35 @@ return releaseResults; } +UserList +Metadata::getUserList(bool remove) +{ + UserList list = userList; + userList.clear(); + return list; +} + +ArtistResultList +Metadata::getArtistResults(bool remove) +{ + ArtistResultList list = artistResults; + artistResults.clear(); + return list; +} + +TrackResultList +Metadata::getTrackResults(bool remove) +{ + TrackResultList list = trackResults; + trackResults.clear(); + return list; +} + +ReleaseResultList +Metadata::getReleaseResults(bool remove) +{ + ReleaseResultList list = releaseResults; + releaseResults.clear(); + return list; +} + Modified: libmusicbrainz/branches/xmlws/src/query.cpp =================================================================== --- libmusicbrainz/branches/xmlws/src/query.cpp 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/src/query.cpp 2006-05-30 20:38:48 UTC (rev 7756) @@ -1,90 +1,102 @@ -/* - * MusicBrainz -- The Internet music metadatabase - * - * Copyright (C) 2006 Lukas Lalinsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <string> -#include <iostream> -#include <musicbrainz3/utils.h> -#include <musicbrainz3/query.h> -#include <musicbrainz3/mbxmlparser.h> - -using namespace std; -using namespace MusicBrainz; - -Query::Query(IWebService *ws, const string &clientId) - : ws(ws), clientId(clientId) -{ -} - -Query::~Query() -{ -} - -Artist * -Query::getArtistById(const string &id, - const ArtistIncludes &include) -{ - string uuid = extractUuid(id); - Metadata *metadata = getFromWebService<ArtistIncludes, ArtistFilter>("artist", uuid, include); - Artist *artist = metadata->getArtist(true); - delete metadata; - return artist; -} - -Release * -Query::getReleaseById(const string &id, - const ReleaseIncludes &include) -{ - string uuid = extractUuid(id); - Metadata *metadata = getFromWebService<ReleaseIncludes, ReleaseFilter>("release", uuid, include); - Release *release = metadata->getRelease(true); - delete metadata; - return release; -} - -Track * -Query::getTrackById(const string &id, - const TrackIncludes &include) -{ - string uuid = extractUuid(id); - Metadata *metadata = getFromWebService<TrackIncludes, TrackFilter>("track", uuid, include); - Track *track = metadata->getTrack(true); - delete metadata; - return track; -} - -template<typename IT, typename FT> -Metadata * -Query::getFromWebService(const string &entity, - const string &id, - const IT &include, - const FT &filter) -{ - const IIncludes::IncludeList includeParams(include.createIncludeTags()); - const IFilter::ParameterList filterParams(filter.createParameters()); - string content = ws->get(entity, id, includeParams, filterParams); - try { - MbXmlParser parser; - return parser.parse(content); - } - catch (ParseError &e) { - throw ResponseError(e.what()); - } -} - +/* + * MusicBrainz -- The Internet music metadatabase + * + * Copyright (C) 2006 Lukas Lalinsky + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <string> +#include <iostream> +#include <musicbrainz3/utils.h> +#include <musicbrainz3/query.h> +#include <musicbrainz3/mbxmlparser.h> + +using namespace std; +using namespace MusicBrainz; + +Query::Query(IWebService *ws, const string &clientId) + : ws(ws), clientId(clientId) +{ +} + +Query::~Query() +{ +} + +Artist * +Query::getArtistById(const string &id, + const ArtistIncludes &include) +{ + string uuid = extractUuid(id); + Metadata *metadata = getFromWebService<ArtistIncludes, ArtistFilter>("artist", uuid, include); + Artist *artist = metadata->getArtist(true); + delete metadata; + return artist; +} + +Release * +Query::getReleaseById(const string &id, + const ReleaseIncludes &include) +{ + string uuid = extractUuid(id); + Metadata *metadata = getFromWebService<ReleaseIncludes, ReleaseFilter>("release", uuid, include); + Release *release = metadata->getRelease(true); + delete metadata; + return release; +} + +Track * +Query::getTrackById(const string &id, + const TrackIncludes &include) +{ + string uuid = extractUuid(id); + Metadata *metadata = getFromWebService<TrackIncludes, TrackFilter>("track", uuid, include); + Track *track = metadata->getTrack(true); + delete metadata; + return track; +} + +User * +Query::getUserByName(const string &name) +{ + Metadata *metadata = getFromWebService<TrackIncludes, UserFilter>("user", "", TrackIncludes(), UserFilter().name(name)); + UserList &list = metadata->getUserList(true); + delete metadata; + if (list.size() > 0) + return list[0]; + else + throw ResponseError("response didn't contain user data"); +} + +template<typename IT, typename FT> +Metadata * +Query::getFromWebService(const string &entity, + const string &id, + const IT &include, + const FT &filter) +{ + const IIncludes::IncludeList includeParams(include.createIncludeTags()); + const IFilter::ParameterList filterParams(filter.createParameters()); + string content = ws->get(entity, id, includeParams, filterParams); + try { + MbXmlParser parser; + return parser.parse(content); + } + catch (ParseError &e) { + throw ResponseError(e.what()); + } +} + Property changes on: libmusicbrainz/branches/xmlws/src/query.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: libmusicbrainz/branches/xmlws/src/utilspriv.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: libmusicbrainz/branches/xmlws/src/utilspriv.h ___________________________________________________________________ Name: svn:eol-style + native Modified: libmusicbrainz/branches/xmlws/src/webservice.cpp =================================================================== --- libmusicbrainz/branches/xmlws/src/webservice.cpp 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/src/webservice.cpp 2006-05-30 20:38:48 UTC (rev 7756) @@ -32,6 +32,7 @@ #include <ne_session.h> #include <ne_request.h> #include <ne_utils.h> +#include <ne_auth.h> #include <ne_uri.h> using namespace std; @@ -64,6 +65,16 @@ } int +WebService::httpAuth(void *userdata, const char *realm, int attempts, + char *username, char *password) +{ + WebService *ws = (WebService *)userdata; + strncpy(username, ws->username.c_str(), NE_ABUFSIZ); + strncpy(password, ws->password.c_str(), NE_ABUFSIZ); + return attempts; +} + +int WebService::httpResponseReader(void *userdata, const char *buf, size_t len) { string *str = (string *)userdata; @@ -97,6 +108,7 @@ sess = ne_session_create("http", host.c_str(), port); if (!sess) throw WebServiceError("ne_session_create() failed."); + ne_set_server_auth(sess, httpAuth, this); map<string, string> params; params["type"] = "xml"; Property changes on: libmusicbrainz/branches/xmlws/test/Makefile.am ___________________________________________________________________ Name: svn:eol-style + native Modified: libmusicbrainz/branches/xmlws/test/test_ws.cpp =================================================================== --- libmusicbrainz/branches/xmlws/test/test_ws.cpp 2006-05-30 20:07:11 UTC (rev 7755) +++ libmusicbrainz/branches/xmlws/test/test_ws.cpp 2006-05-30 20:38:48 UTC (rev 7756) @@ -1,36 +1,48 @@ -#include <vector> -#include <algorithm> -#include <cppunit/extensions/HelperMacros.h> -#include <musicbrainz3/filters.h> -#include <musicbrainz3/webservice.h> -#include <musicbrainz3/query.h> - -using namespace std; -using namespace MusicBrainz; - -#ifdef BUILD_WS_TESTS - -class WebServiceTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE(WebServiceTest); - CPPUNIT_TEST(testGetArtistById); - CPPUNIT_TEST_SUITE_END(); - -protected: - - void testGetArtistById() - { - WebService::init(); - WebService ws("test.musicbrainz.org"); - Query q(&ws, "test-1"); - Artist *a = q.getArtistById("72c536dc-7137-4477-a521-567eeb840fa8"); - CPPUNIT_ASSERT(a != NULL); - CPPUNIT_ASSERT_EQUAL(string("Bob Dylan"), a->getName()); - WebService::cleanup(); - } - -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(WebServiceTest); - -#endif +#include <vector> +#include <algorithm> +#include <cppunit/extensions/HelperMacros.h> +#include <musicbrainz3/filters.h> +#include <musicbrainz3/webservice.h> +#include <musicbrainz3/query.h> + +using namespace std; +using namespace MusicBrainz; + +#ifdef BUILD_WS_TESTS + +class WebServiceTest : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE(WebServiceTest); + CPPUNIT_TEST(testGetArtistById); + CPPUNIT_TEST(testGetUserByName); + CPPUNIT_TEST_SUITE_END(); + +protected: + + void testGetArtistById() + { + WebService::init(); + WebService ws("test.musicbrainz.org"); + Query q(&ws, "test-1"); + Artist *a = q.getArtistById("72c536dc-7137-4477-a521-567eeb840fa8"); + CPPUNIT_ASSERT(a != NULL); + CPPUNIT_ASSERT_EQUAL(string("Bob Dylan"), a->getName()); + WebService::cleanup(); + } + + void testGetUserByName() + { + WebService::init(); + WebService ws("test.musicbrainz.org", 80, "/ws", "libmb_test", "libmb_test"); + Query q(&ws, "test-1"); + User *a = q.getUserByName("libmb_test"); + CPPUNIT_ASSERT(a != NULL); + CPPUNIT_ASSERT_EQUAL(string("libmb_test"), a->getName()); + WebService::cleanup(); + } + +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(WebServiceTest); + +#endif Property changes on: libmusicbrainz/branches/xmlws/test/test_ws.cpp ___________________________________________________________________ Name: svn:eol-style + native
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [mb-commits] r7755 - in libmusicbrainz/branches/xmlws: . src, root |
|---|---|
| Next by Date: | [mb-commits] r7757 - libmusicbrainz/branches/xmlws, root |
| Previous by Thread: | [mb-commits] r7755 - in libmusicbrainz/branches/xmlws: . src, root |
| Next by Thread: | [mb-commits] r7757 - libmusicbrainz/branches/xmlws, root |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |