6
#include <boost/test/auto_unit_test.hpp>
8
#include "zypp/parser/ws/WebpinResultFileReader.h"
9
#include "zypp/ws/WebpinResult.h"
12
#include "zypp/PathInfo.h"
16
using namespace boost::unit_test;
18
using namespace zypp::ws;
19
using namespace zypp::parser::ws;
21
#define DATADIR (Pathname(TESTS_SRC_DIR) + "parser/ws/data")
29
bool callback( const WebpinResult &result )
31
items.push_back(result);
32
//items.push_back(loc);
33
//cout << items.size() << endl;
37
vector<WebpinResult> items;
40
BOOST_AUTO_TEST_CASE(result_read)
45
// this testcase represents this search:
46
// http://api.opensuse-community.org/searchservice/Search/Simple/openSUSE_103/kopete
48
file = DATADIR + "/search-kopete.xml";
50
WebpinResultFileReader reader( file, bind( &Collector::callback, &collect, _1));
51
BOOST_CHECK_EQUAL( collect.items.size(), 17);
53
WebpinResult first = collect.items[0];
54
BOOST_CHECK_EQUAL( first.name(), "kopete-otr");
55
BOOST_CHECK_EQUAL( first.edition(), "0.6");
56
BOOST_CHECK_EQUAL( first.repositoryUrl(), Url("http://download.opensuse.org/repositories/home:/burnickl_andreas/openSUSE_10.3"));
57
BOOST_CHECK_EQUAL( first.distribution(), "openSUSE_103");
58
BOOST_CHECK_EQUAL( first.checksum(), CheckSum::sha1("2a4d9e95f87abe16c28e4aefa0b3a0ae52220429"));
59
BOOST_CHECK_EQUAL( first.priority(), 0);
60
BOOST_CHECK_EQUAL( first.summary(), "OTR Plugin for Kopete");
64
// vim: set ts=2 sts=2 sw=2 ai et: