}
shared_ptr<InMemoryZoneFinder>
finder(new
- InMemoryZoneFinder(zone.zone_finder->getClass(),
- origin));
+ InMemoryZoneFinder(rrclass_, origin));
ZoneIteratorPtr iterator(client->getIterator(origin));
if (!iterator) {
isc_throw(isc::Unexpected, "Got NULL iterator for "
#define DATASRC_CONTAINER_H
#include <dns/name.h>
+#include <dns/rrclass.h>
#include <cc/data.h>
#include <exceptions/exceptions.h>
/// inherited except for tests.
class ConfigurableClientList : public ClientList {
public:
+ /// \brief Constructor
+ ///
+ /// \param rrclass For which class the list should work.
+ ConfigurableClientList(const isc::dns::RRClass &rrclass) :
+ rrclass_(rrclass)
+ {}
/// \brief Exception thrown when there's an error in configuration.
class ConfigurationError : public Exception {
public:
/// it might be, so it is just made public (there's no real reason to
/// hide it).
const DataSources& getDataSources() const { return (data_sources_); }
+private:
+ const isc::dns::RRClass rrclass_;
};
} // namespace datasrc
Name getOrigin() const { return (origin_); }
// The rest is not to be called, so just have them
RRClass getClass() const {
- return (RRClass::IN());
+ isc_throw(isc::NotImplemented, "Not implemented");
}
shared_ptr<Context> find(const Name&, const RRType&,
const FindOptions)
// some methods to dig directly in the internals, for the tests.
class TestedList : public ConfigurableClientList {
public:
+ TestedList(const RRClass& rrclass) :
+ ConfigurableClientList(rrclass)
+ {}
DataSources& getDataSources() { return (data_sources_); }
// Overwrite the list's method to get a data source with given type
// and configuration. We mock the data source and don't create the
public:
ListTest() :
// The empty list corresponds to a list with no elements inside
- list_(new TestedList()),
+ list_(new TestedList(RRClass::IN())),
config_elem_(Element::fromJSON("["
"{"
" \"type\": \"test_type\","
EXPECT_EQ(result::SUCCESS, cache->findZone(Name("example.org")).code);
EXPECT_EQ(result::SUCCESS, cache->findZone(Name("example.com")).code);
EXPECT_EQ(result::NOTFOUND, cache->findZone(Name("example.cz")).code);
+ EXPECT_EQ(RRClass::IN(),
+ cache->findZone(Name("example.org")).zone_finder->getClass());
// These are cached and answered from the cache
positiveResult(list_->find(Name("example.com.")), ds_[0],