|
@@ -14,14 +14,13 @@
|
|
|
|
|
|
#include <exceptions/exceptions.h>
|
|
|
|
|
|
-#include <util/memory_segment_local.h>
|
|
|
-
|
|
|
#include <dns/masterload.h>
|
|
|
#include <dns/name.h>
|
|
|
#include <dns/rrclass.h>
|
|
|
|
|
|
#include <datasrc/zone.h>
|
|
|
#include <datasrc/memory/memory_client.h>
|
|
|
+#include <datasrc/memory/zone_table_segment.h>
|
|
|
#include <datasrc/database.h>
|
|
|
#include <datasrc/sqlite3_accessor.h>
|
|
|
|
|
@@ -41,10 +40,12 @@
|
|
|
using namespace std;
|
|
|
using boost::shared_ptr;
|
|
|
|
|
|
+using namespace isc::data;
|
|
|
using namespace isc::util;
|
|
|
using namespace isc::dns;
|
|
|
using namespace isc::datasrc;
|
|
|
using isc::datasrc::memory::InMemoryClient;
|
|
|
+using isc::datasrc::memory::ZoneTableSegment;
|
|
|
using namespace isc::testutils;
|
|
|
|
|
|
namespace {
|
|
@@ -58,15 +59,17 @@ typedef shared_ptr<DataSourceClient> DataSourceClientPtr;
|
|
|
// This is the type used as the test parameter. Note that this is
|
|
|
// intentionally a plain old type (i.e. a function pointer), not a class;
|
|
|
// otherwise it could cause initialization fiasco at the instantiation time.
|
|
|
-typedef DataSourceClientPtr (*ClientCreator)(MemorySegment&, RRClass,
|
|
|
- const Name&);
|
|
|
+typedef DataSourceClientPtr (*ClientCreator)(RRClass, const Name&);
|
|
|
|
|
|
// Creator for the in-memory client to be tested
|
|
|
DataSourceClientPtr
|
|
|
-createInMemoryClient(MemorySegment& mem_sgmt, RRClass zclass,
|
|
|
- const Name& zname)
|
|
|
+createInMemoryClient(RRClass zclass, const Name& zname)
|
|
|
{
|
|
|
- shared_ptr<InMemoryClient> client(new InMemoryClient(mem_sgmt, zclass));
|
|
|
+ const ElementPtr config(Element::fromJSON("{}"));
|
|
|
+ shared_ptr<ZoneTableSegment> ztable_segment(
|
|
|
+ ZoneTableSegment::create(*config.get()));
|
|
|
+ shared_ptr<InMemoryClient> client(new InMemoryClient(ztable_segment,
|
|
|
+ zclass));
|
|
|
client->load(zname, TEST_ZONE_FILE);
|
|
|
|
|
|
return (client);
|
|
@@ -78,7 +81,7 @@ addRRset(ZoneUpdaterPtr updater, ConstRRsetPtr rrset) {
|
|
|
}
|
|
|
|
|
|
DataSourceClientPtr
|
|
|
-createSQLite3Client(MemorySegment&, RRClass zclass, const Name& zname) {
|
|
|
+createSQLite3Client(RRClass zclass, const Name& zname) {
|
|
|
// We always begin with an empty template SQLite3 DB file and install
|
|
|
// the zone data from the zone file to ensure both cases have the
|
|
|
// same test data.
|
|
@@ -105,7 +108,7 @@ class ZoneFinderContextTest :
|
|
|
{
|
|
|
protected:
|
|
|
ZoneFinderContextTest() : qclass_(RRClass::IN()), qzone_("example.org") {
|
|
|
- client_ = (*GetParam())(mem_sgmt_, qclass_, qzone_);
|
|
|
+ client_ = (*GetParam())(qclass_, qzone_);
|
|
|
REQUESTED_A.push_back(RRType::A());
|
|
|
REQUESTED_AAAA.push_back(RRType::AAAA());
|
|
|
REQUESTED_BOTH.push_back(RRType::A());
|
|
@@ -116,7 +119,6 @@ protected:
|
|
|
ASSERT_TRUE(finder_);
|
|
|
}
|
|
|
|
|
|
- MemorySegmentLocal mem_sgmt_;
|
|
|
const RRClass qclass_;
|
|
|
const Name qzone_;
|
|
|
DataSourceClientPtr client_;
|