BIND 10 master, updated. 6699e12852ba1f4bdd6971c7d3f1b973bfd93964 [master] Merge branch 'trac2679'

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Feb 15 04:11:03 UTC 2013


The branch, master has been updated
       via  6699e12852ba1f4bdd6971c7d3f1b973bfd93964 (commit)
       via  919a87f1210c64263f3b06ca93e3bf6b771d23b2 (commit)
       via  3a8141cf7bff5642a70edac8b9dec1e458e552a9 (commit)
       via  dc4af29ccb665d56b5262cd3db947ef5852c6ff9 (commit)
       via  3e06e05268d8316d275a5a9987a3d8ed5af4f993 (commit)
       via  16930b0baef10c65efa010f09464b55bd208f0b2 (commit)
       via  4694c98d55d5fc5c26c540ce81c0c73e597578a4 (commit)
       via  4f5d524dd601a838dc0647b15e99cac00b9ce7dd (commit)
       via  eb018c9d3c3a60989492dda959a9c932e7cf2e71 (commit)
       via  b2ac76a62e2d18ec16251c57a4b3d8d5776d1bcb (commit)
       via  f866170c9af2ddb0eb4ca0dc3f060ee62d2f92f7 (commit)
       via  b20cc153bcbe3914a610ea5c9a03663ba788555f (commit)
       via  4792e513f5dc087a6dc5e51f72acf0efd0cc4f37 (commit)
       via  79f65e1240e0104f6d425ce63821e1297b78a3ce (commit)
       via  905792e57908a04539e76abdd32e67289ca9d4c6 (commit)
       via  b68752a7e48f86bdc07c9a6e34929a9202d0e039 (commit)
       via  b4546edb4138647efa2e2129f5461d80d4486630 (commit)
      from  6714481ecee6046a62fc351158f8c5c7d9e0bf30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6699e12852ba1f4bdd6971c7d3f1b973bfd93964
Merge: 6714481 919a87f
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Feb 14 20:09:50 2013 -0800

    [master] Merge branch 'trac2679'

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/tests/Makefile.am                  |    3 +-
 src/lib/datasrc/tests/database_sqlite3_unittest.cc |   68 +
 src/lib/datasrc/tests/database_unittest.cc         | 3466 +++++++++-----------
 src/lib/datasrc/tests/database_unittest.h          |  278 ++
 4 files changed, 1970 insertions(+), 1845 deletions(-)
 create mode 100644 src/lib/datasrc/tests/database_sqlite3_unittest.cc
 create mode 100644 src/lib/datasrc/tests/database_unittest.h

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/Makefile.am b/src/lib/datasrc/tests/Makefile.am
index c1e7d4e..7960963 100644
--- a/src/lib/datasrc/tests/Makefile.am
+++ b/src/lib/datasrc/tests/Makefile.am
@@ -50,7 +50,8 @@ run_unittests_SOURCES = $(common_sources)
 run_unittests_SOURCES += test_client.h test_client.cc
 run_unittests_SOURCES += logger_unittest.cc
 run_unittests_SOURCES += client_unittest.cc
-run_unittests_SOURCES += database_unittest.cc
+run_unittests_SOURCES += database_unittest.h database_unittest.cc
+run_unittests_SOURCES += database_sqlite3_unittest.cc
 run_unittests_SOURCES += sqlite3_accessor_unittest.cc
 run_unittests_SOURCES += zone_finder_context_unittest.cc
 run_unittests_SOURCES += faked_nsec3.h faked_nsec3.cc
diff --git a/src/lib/datasrc/tests/database_sqlite3_unittest.cc b/src/lib/datasrc/tests/database_sqlite3_unittest.cc
new file mode 100644
index 0000000..0dd356a
--- /dev/null
+++ b/src/lib/datasrc/tests/database_sqlite3_unittest.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2013  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#include <datasrc/tests/database_unittest.h>
+
+#include <datasrc/database.h>
+#include <datasrc/sqlite3_accessor.h>
+
+#include <exceptions/exceptions.h>
+
+#include <gtest/gtest.h>
+
+#include <boost/shared_ptr.hpp>
+
+#include <cstdlib>
+#include <string>
+
+using std::string;
+
+using namespace isc::datasrc;
+using namespace isc::datasrc::test;
+
+namespace {
+boost::shared_ptr<DatabaseAccessor>
+createSQLite3Accessor() {
+    // To make sure we always have empty diffs table at the beginning of
+    // each test, we re-install the writable data source here.
+    const char* const install_cmd = INSTALL_PROG " -c " TEST_DATA_COMMONDIR
+        "/rwtest.sqlite3 " TEST_DATA_BUILDDIR "/rwtest.sqlite3.copied";
+    if (std::system(install_cmd) != 0) {
+        // any exception will do, this is failure in test setup, but nice
+        // to show the command that fails, and shouldn't be caught
+        isc_throw(isc::Unexpected,
+                  "Error setting up; command failed: " << install_cmd);
+    }
+
+    // The SQLite accessor implements all API, so we can use the generic
+    // loadTestDataGeneric once accessor is created.
+    boost::shared_ptr<DatabaseAccessor> accessor(
+        new SQLite3Accessor(TEST_DATA_BUILDDIR "/rwtest.sqlite3.copied",
+                            "IN"));
+    loadTestDataGeneric(*accessor);
+
+    return (accessor);
+}
+
+// The test parameter for the SQLite3 accessor.  We can use enableNSEC3Generic
+// as this accessor fully supports NSEC3 related APIs.
+const DatabaseClientTestParam sqlite3_param = { createSQLite3Accessor,
+                                                enableNSEC3Generic };
+
+INSTANTIATE_TEST_CASE_P(SQLite3, DatabaseClientTest,
+                        ::testing::Values(&sqlite3_param));
+
+INSTANTIATE_TEST_CASE_P(SQLite3, RRsetCollectionTest,
+                        ::testing::Values(&sqlite3_param));
+}
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 58af193..83ff004 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -12,9 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include "faked_nsec3.h"
-
-#include <exceptions/exceptions.h>
+#include <datasrc/tests/database_unittest.h>
+#include <datasrc/tests/faked_nsec3.h>
 
 #include <dns/masterload.h>
 #include <dns/name.h>
@@ -28,7 +27,6 @@
 #include <datasrc/zone_finder.h>
 #include <datasrc/data_source.h>
 #include <datasrc/zone_iterator.h>
-#include <datasrc/sqlite3_accessor.h>
 
 #include <testutils/dnsmessage_test.h>
 
@@ -38,8 +36,8 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/lexical_cast.hpp>
 
-#include <cstdlib>
 #include <map>
+#include <string>
 #include <vector>
 
 using namespace isc::datasrc;
@@ -52,207 +50,62 @@ using namespace isc::dns;
 using namespace isc::testutils;
 using namespace isc::datasrc::test;
 
-namespace {
+namespace isc {
+namespace datasrc {
+namespace test {
+/// Single journal entry in the mock database.
+///
+/// All the members there are public for simplicity, as it only stores data.
+/// We use the implicit constructor and operator. The members can't be const
+/// because of the assignment operator (used in the vectors).
+struct JournalEntry {
+    JournalEntry(int id, uint32_t serial,
+                 DatabaseAccessor::DiffOperation operation,
+                 const std::string (&data)[DatabaseAccessor::DIFF_PARAM_COUNT])
+        : id_(id), serial_(serial), operation_(operation)
+    {
+        data_[DatabaseAccessor::DIFF_NAME] = data[DatabaseAccessor::DIFF_NAME];
+        data_[DatabaseAccessor::DIFF_TYPE] = data[DatabaseAccessor::DIFF_TYPE];
+        data_[DatabaseAccessor::DIFF_TTL] = data[DatabaseAccessor::DIFF_TTL];
+        data_[DatabaseAccessor::DIFF_RDATA] =
+            data[DatabaseAccessor::DIFF_RDATA];
+    }
+    JournalEntry(int id, uint32_t serial,
+                 DatabaseAccessor::DiffOperation operation,
+                 const std::string& name, const std::string& type,
+                 const std::string& ttl, const std::string& rdata):
+        id_(id), serial_(serial), operation_(operation)
+    {
+        data_[DatabaseAccessor::DIFF_NAME] = name;
+        data_[DatabaseAccessor::DIFF_TYPE] = type;
+        data_[DatabaseAccessor::DIFF_TTL] = ttl;
+        data_[DatabaseAccessor::DIFF_RDATA] = rdata;
+    }
+    int id_;
+    uint32_t serial_;
+    DatabaseAccessor::DiffOperation operation_;
+    std::string data_[DatabaseAccessor::DIFF_PARAM_COUNT];
+    bool operator==(const JournalEntry& other) const {
+        for (size_t i = 0; i < DatabaseAccessor::DIFF_PARAM_COUNT; ++ i) {
+            if (data_[i] != other.data_[i]) {
+                return false;
+            }
+        }
+        // No need to check data here, checked above
+        return (id_ == other.id_ && serial_ == other.serial_ &&
+                operation_ == other.operation_);
+    }
+};
+}
+}
+}
 
+namespace {
 // Imaginary zone IDs used in the mock accessor below.
 const int READONLY_ZONE_ID = 42;
 const int NEW_ZONE_ID = 420;
 const int WRITABLE_ZONE_ID = 4200;
 
-// Commonly used test data
-const char* const TEST_RECORDS[][5] = {
-    // some plain data
-    {"www.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"www.example.org.", "AAAA", "3600", "", "2001:db8::1"},
-    {"www.example.org.", "AAAA", "3600", "", "2001:db8::2"},
-    {"www.example.org.", "NSEC", "3600", "", "www2.example.org. A AAAA NSEC RRSIG"},
-    {"www.example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    {"www2.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"www2.example.org.", "AAAA", "3600", "", "2001:db8::1"},
-    {"www2.example.org.", "A", "3600", "", "192.0.2.2"},
-
-    {"cname.example.org.", "CNAME", "3600", "", "www.example.org."},
-
-    // some DNSSEC-'signed' data
-    {"signed1.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"signed1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    {"signed1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE"},
-    {"signed1.example.org.", "AAAA", "3600", "", "2001:db8::1"},
-    {"signed1.example.org.", "AAAA", "3600", "", "2001:db8::2"},
-    {"signed1.example.org.", "RRSIG", "3600", "", "AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    {"signedcname1.example.org.", "CNAME", "3600", "", "www.example.org."},
-    {"signedcname1.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    // special case might fail; sig is for cname, which isn't there (should be ignored)
-    // (ignoring of 'normal' other type is done above by www.)
-    {"acnamesig1.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"acnamesig1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"acnamesig1.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    // let's pretend we have a database that is not careful
-    // about the order in which it returns data
-    {"signed2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"signed2.example.org.", "AAAA", "3600", "", "2001:db8::2"},
-    {"signed2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE"},
-    {"signed2.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"signed2.example.org.", "RRSIG", "3600", "", "AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"signed2.example.org.", "AAAA", "3600", "", "2001:db8::1"},
-
-    {"signedcname2.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"signedcname2.example.org.", "CNAME", "3600", "", "www.example.org."},
-
-    {"acnamesig2.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"acnamesig2.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"acnamesig2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    {"acnamesig3.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"acnamesig3.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"acnamesig3.example.org.", "A", "3600", "", "192.0.2.1"},
-
-    {"ttldiff1.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"ttldiff1.example.org.", "A", "360", "", "192.0.2.2"},
-
-    {"ttldiff2.example.org.", "A", "360", "", "192.0.2.1"},
-    {"ttldiff2.example.org.", "A", "3600", "", "192.0.2.2"},
-
-    // also add some intentionally bad data
-    {"badcname1.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"badcname1.example.org.", "CNAME", "3600", "", "www.example.org."},
-
-    {"badcname2.example.org.", "CNAME", "3600", "", "www.example.org."},
-    {"badcname2.example.org.", "A", "3600", "", "192.0.2.1"},
-
-    {"badcname3.example.org.", "CNAME", "3600", "", "www.example.org."},
-    {"badcname3.example.org.", "CNAME", "3600", "", "www.example2.org."},
-
-    {"badrdata.example.org.", "A", "3600", "", "bad"},
-
-    {"badtype.example.org.", "BAD_TYPE", "3600", "", "192.0.2.1"},
-
-    {"badttl.example.org.", "A", "badttl", "", "192.0.2.1"},
-
-    {"badsig.example.org.", "A", "badttl", "", "192.0.2.1"},
-    {"badsig.example.org.", "RRSIG", "3600", "", "A 5 3 3600 somebaddata 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    {"badsigtype.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"badsigtype.example.org.", "RRSIG", "3600", "TXT", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    // Data for testing delegation (with NS and DNAME)
-    {"delegation.example.org.", "NS", "3600", "", "ns.example.com."},
-    {"delegation.example.org.", "NS", "3600", "",
-     "ns.delegation.example.org."},
-    {"delegation.example.org.", "DS", "3600", "", "1 1 2 abcd"},
-    {"delegation.example.org.", "RRSIG", "3600", "", "NS 5 3 3600 "
-     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"delegation.example.org.", "RRSIG", "3600", "", "DS 5 3 3600 "
-     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"ns.delegation.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"deep.below.delegation.example.org.", "A", "3600", "", "192.0.2.1"},
-
-    {"dname.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"dname.example.org.", "DNAME", "3600", "", "dname.example.com."},
-    {"dname.example.org.", "RRSIG", "3600", "",
-     "DNAME 5 3 3600 20000101000000 20000201000000 12345 "
-     "example.org. FAKEFAKEFAKE"},
-
-    {"below.dname.example.org.", "A", "3600", "", "192.0.2.1"},
-
-    // Insecure delegation (i.e., no DS at the delegation point)
-    {"insecdelegation.example.org.", "NS", "3600", "", "ns.example.com."},
-    {"insecdelegation.example.org.", "NSEC", "3600", "",
-     "dummy.example.org. NS NSEC"},
-    // and a DS under the zone cut. Such an RR shouldn't exist in a sane zone,
-    // but it could by error or some malicious attempt.  It shouldn't confuse
-    // the implementation)
-    {"child.insecdelegation.example.org.", "DS", "3600", "", "DS 5 3 3600 "
-     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    // Delegation NS and other ordinary type of RR coexist at the same
-    // name.  This is deviant (except for some special cases like the other
-    // RR could be used for addressing the NS name), but as long as the
-    // other records are hidden behind the delegation for normal queries
-    // it's not necessarily harmful. (so "broken" may be too strong, but we
-    // keep the name since it could be in a chain of sorted names for DNSSEC
-    // processing and renaming them may have other bad effects for tests).
-    {"brokenns1.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"brokenns1.example.org.", "NS", "3600", "", "ns.example.com."},
-
-    // Now double DNAME, to test failure mode
-    {"baddname.example.org.", "DNAME", "3600", "", "dname1.example.com."},
-    {"baddname.example.org.", "DNAME", "3600", "", "dname2.example.com."},
-
-    // Put some data into apex (including NS) so we can check our NS
-    // doesn't break anything
-    {"example.org.", "SOA", "3600", "", "ns1.example.org. admin.example.org. "
-     "1234 3600 1800 2419200 7200" },
-    {"example.org.", "NS", "3600", "", "ns.example.com."},
-    {"example.org.", "A", "3600", "", "192.0.2.1"},
-    // Note that the RDATA text is "normalized", i.e., identical to what
-    // Rdata::toText() would produce.  some tests rely on that behavior.
-    {"example.org.", "NSEC", "3600", "",
-     "acnamesig1.example.org. A NS RRSIG NSEC"},
-    {"example.org.", "RRSIG", "3600", "", "SOA 5 3 3600 20000101000000 "
-              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 "
-              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"example.org.", "RRSIG", "3600", "", "NS 5 3 3600 20000101000000 "
-              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
-
-    // This is because of empty domain test
-    {"a.b.example.org.", "A", "3600", "", "192.0.2.1"},
-
-    // Something for wildcards
-    {"*.wild.example.org.", "A", "3600", "", "192.0.2.5"},
-    {"*.wild.example.org.", "RRSIG", "3600", "A", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"*.wild.example.org.", "NSEC", "3600", "", "cancel.here.wild.example.org. A NSEC RRSIG"},
-    {"*.wild.example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {"cancel.here.wild.example.org.", "AAAA", "3600", "", "2001:db8::5"},
-    {"delegatedwild.example.org.", "NS", "3600", "", "ns.example.com."},
-    {"*.delegatedwild.example.org.", "A", "3600", "", "192.0.2.5"},
-    {"wild.*.foo.example.org.", "A", "3600", "", "192.0.2.5"},
-    {"wild.*.foo.*.bar.example.org.", "A", "3600", "", "192.0.2.5"},
-    {"wild.*.foo.*.bar.example.org.", "NSEC", "3600", "",
-     "brokenns1.example.org. A NSEC"},
-    {"bao.example.org.", "NSEC", "3600", "", "wild.*.foo.*.bar.example.org. NSEC"},
-    {"*.cnamewild.example.org.", "CNAME", "3600", "", "www.example.org."},
-    {"*.dnamewild.example.org.", "DNAME", "3600", "", "dname.example.com."},
-    {"*.nswild.example.org.", "NS", "3600", "", "ns.example.com."},
-    // For NSEC empty non-terminal
-    {"l.example.org.", "NSEC", "3600", "", "empty.nonterminal.example.org. NSEC"},
-    {"empty.nonterminal.example.org.", "A", "3600", "", "192.0.2.1"},
-    // Invalid rdata
-    {"invalidrdata.example.org.", "A", "3600", "", "Bunch of nonsense"},
-    {"invalidrdata2.example.org.", "A", "3600", "", "192.0.2.1"},
-    {"invalidrdata2.example.org.", "RRSIG", "3600", "", "Nonsense"},
-
-    {NULL, NULL, NULL, NULL, NULL},
-};
-
-// NSEC3PARAM at the zone origin and its RRSIG.  These will be added
-// separately for some NSEC3 related tests.
-const char* TEST_NSEC3PARAM_RECORDS[][5] = {
-    {"example.org.", "NSEC3PARAM", "3600", "", "1 0 12 aabbccdd"},
-    {"example.org.", "RRSIG", "3600", "", "NSEC3PARAM 5 3 3600 20000101000000 "
-     "20000201000000 12345 example.org. FAKEFAKEFAKE"},
-    {NULL, NULL, NULL, NULL, NULL}
-};
-
-// FIXME: Taken from a different test. Fill with proper data when creating a test.
-const char* TEST_NSEC3_RECORDS[][5] = {
-    {apex_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
-    {apex_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
-    {ns1_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
-    {ns1_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
-    {w_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
-    {w_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
-    {zzz_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
-    {zzz_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
-    {NULL, NULL, NULL, NULL, NULL}
-};
-
 /*
  * An accessor with minimum implementation, keeping the original
  * "NotImplemented" methods.
@@ -359,52 +212,6 @@ private:
     std::map<std::string, int> zones_;
 };
 
-/**
- * Single journal entry in the mock database.
- *
- * All the members there are public for simplicity, as it only stores data.
- * We use the implicit constructor and operator. The members can't be const
- * because of the assignment operator (used in the vectors).
- */
-struct JournalEntry {
-    JournalEntry(int id, uint32_t serial,
-                 DatabaseAccessor::DiffOperation operation,
-                 const std::string (&data)[DatabaseAccessor::DIFF_PARAM_COUNT])
-        : id_(id), serial_(serial), operation_(operation)
-    {
-        data_[DatabaseAccessor::DIFF_NAME] = data[DatabaseAccessor::DIFF_NAME];
-        data_[DatabaseAccessor::DIFF_TYPE] = data[DatabaseAccessor::DIFF_TYPE];
-        data_[DatabaseAccessor::DIFF_TTL] = data[DatabaseAccessor::DIFF_TTL];
-        data_[DatabaseAccessor::DIFF_RDATA] =
-            data[DatabaseAccessor::DIFF_RDATA];
-    }
-    JournalEntry(int id, uint32_t serial,
-                 DatabaseAccessor::DiffOperation operation,
-                 const std::string& name, const std::string& type,
-                 const std::string& ttl, const std::string& rdata):
-        id_(id), serial_(serial), operation_(operation)
-    {
-        data_[DatabaseAccessor::DIFF_NAME] = name;
-        data_[DatabaseAccessor::DIFF_TYPE] = type;
-        data_[DatabaseAccessor::DIFF_TTL] = ttl;
-        data_[DatabaseAccessor::DIFF_RDATA] = rdata;
-    }
-    int id_;
-    uint32_t serial_;
-    DatabaseAccessor::DiffOperation operation_;
-    std::string data_[DatabaseAccessor::DIFF_PARAM_COUNT];
-    bool operator==(const JournalEntry& other) const {
-        for (size_t i = 0; i < DatabaseAccessor::DIFF_PARAM_COUNT; ++ i) {
-            if (data_[i] != other.data_[i]) {
-                return false;
-            }
-        }
-        // No need to check data here, checked above
-        return (id_ == other.id_ && serial_ == other.serial_ &&
-                operation_ == other.operation_);
-    }
-};
-
 /*
  * A virtual database accessor that pretends it contains single zone --
  * example.org.
@@ -1082,379 +889,521 @@ private:
         cur_name_.clear();
     }
 
-    // Fills the database with zone data.
-    // This method constructs a number of resource records (with addRecord),
-    // which will all be added for one domain name to the fake database
-    // (with addCurName). So for instance the first set of calls create
-    // data for the name 'www.example.org', which will consist of one A RRset
-    // of one record, and one AAAA RRset of two records.
-    // The order in which they are added is the order in which getNextRecord()
-    // will return them (so we can test whether find() etc. support data that
-    // might not come in 'normal' order)
-    // It shall immediately fail if you try to add the same name twice.
-    void fillData() {
-        const char* prev_name = NULL;
-        for (int i = 0; TEST_RECORDS[i][0] != NULL; ++i) {
-            if (prev_name != NULL &&
-                strcmp(prev_name, TEST_RECORDS[i][0]) != 0) {
-                addCurName(prev_name);
-            }
-            prev_name = TEST_RECORDS[i][0];
-            addRecord(TEST_RECORDS[i][1], TEST_RECORDS[i][2],
-                      TEST_RECORDS[i][3], TEST_RECORDS[i][4]);
-        }
-        addCurName(prev_name);
-        prev_name = NULL;
-        for (int i = 0; TEST_NSEC3_RECORDS[i][0] != NULL; ++i) {
-            if (prev_name != NULL &&
-                strcmp(prev_name, TEST_NSEC3_RECORDS[i][0]) != 0) {
-                addCurHash(prev_name);
-            }
-            prev_name = TEST_NSEC3_RECORDS[i][0];
-            addRecord(TEST_NSEC3_RECORDS[i][1], TEST_NSEC3_RECORDS[i][2],
-                      TEST_NSEC3_RECORDS[i][3], TEST_NSEC3_RECORDS[i][4]);
-        }
-        addCurHash(prev_name);
-    }
+    // Fills the database with zone data.
+    // This method constructs a number of resource records (with addRecord),
+    // which will all be added for one domain name to the fake database
+    // (with addCurName). So for instance the first set of calls create
+    // data for the name 'www.example.org', which will consist of one A RRset
+    // of one record, and one AAAA RRset of two records.
+    // The order in which they are added is the order in which getNextRecord()
+    // will return them (so we can test whether find() etc. support data that
+    // might not come in 'normal' order)
+    // It shall immediately fail if you try to add the same name twice.
+    void fillData() {
+        const char* prev_name = NULL;
+        for (int i = 0; TEST_RECORDS[i][0] != NULL; ++i) {
+            if (prev_name != NULL &&
+                strcmp(prev_name, TEST_RECORDS[i][0]) != 0) {
+                addCurName(prev_name);
+            }
+            prev_name = TEST_RECORDS[i][0];
+            addRecord(TEST_RECORDS[i][1], TEST_RECORDS[i][2],
+                      TEST_RECORDS[i][3], TEST_RECORDS[i][4]);
+        }
+        addCurName(prev_name);
+        prev_name = NULL;
+        for (int i = 0; TEST_NSEC3_RECORDS[i][0] != NULL; ++i) {
+            if (prev_name != NULL &&
+                strcmp(prev_name, TEST_NSEC3_RECORDS[i][0]) != 0) {
+                addCurHash(prev_name);
+            }
+            prev_name = TEST_NSEC3_RECORDS[i][0];
+            addRecord(TEST_NSEC3_RECORDS[i][1], TEST_NSEC3_RECORDS[i][2],
+                      TEST_NSEC3_RECORDS[i][3], TEST_NSEC3_RECORDS[i][4]);
+        }
+        addCurHash(prev_name);
+    }
+
+public:
+    // This adds the NSEC3PARAM into the apex, so we can perform some NSEC3
+    // tests. Note that the NSEC3 namespace is available in other tests, but
+    // it should not be accessed at that time.
+    void enableNSEC3() {
+        for (int i = 0; TEST_NSEC3PARAM_RECORDS[i][0] != NULL; ++i) {
+            vector<string> param;
+            param.push_back(TEST_NSEC3PARAM_RECORDS[i][1]); // RRtype
+            param.push_back(TEST_NSEC3PARAM_RECORDS[i][2]); // TTL
+            param.push_back("");                            // sigtype, unused
+            param.push_back(TEST_NSEC3PARAM_RECORDS[i][4]); // RDATA
+            param.push_back(TEST_NSEC3PARAM_RECORDS[i][0]); // owner name
+            (*readonly_records_)[param.back()].push_back(param);
+        }
+    }
+};
+}
+
+namespace isc {
+namespace datasrc {
+namespace test {
+
+const char* const TEST_RECORDS[][5] = {
+    // some plain data
+    {"www.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"www.example.org.", "AAAA", "3600", "", "2001:db8::1"},
+    {"www.example.org.", "AAAA", "3600", "", "2001:db8::2"},
+    {"www.example.org.", "NSEC", "3600", "", "www2.example.org. A AAAA NSEC RRSIG"},
+    {"www.example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    {"www2.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"www2.example.org.", "AAAA", "3600", "", "2001:db8::1"},
+    {"www2.example.org.", "A", "3600", "", "192.0.2.2"},
+
+    {"cname.example.org.", "CNAME", "3600", "", "www.example.org."},
+
+    // some DNSSEC-'signed' data
+    {"signed1.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"signed1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    {"signed1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE"},
+    {"signed1.example.org.", "AAAA", "3600", "", "2001:db8::1"},
+    {"signed1.example.org.", "AAAA", "3600", "", "2001:db8::2"},
+    {"signed1.example.org.", "RRSIG", "3600", "", "AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    {"signedcname1.example.org.", "CNAME", "3600", "", "www.example.org."},
+    {"signedcname1.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    // special case might fail; sig is for cname, which isn't there (should be ignored)
+    // (ignoring of 'normal' other type is done above by www.)
+    {"acnamesig1.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"acnamesig1.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"acnamesig1.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    // let's pretend we have a database that is not careful
+    // about the order in which it returns data
+    {"signed2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"signed2.example.org.", "AAAA", "3600", "", "2001:db8::2"},
+    {"signed2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE"},
+    {"signed2.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"signed2.example.org.", "RRSIG", "3600", "", "AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"signed2.example.org.", "AAAA", "3600", "", "2001:db8::1"},
+
+    {"signedcname2.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"signedcname2.example.org.", "CNAME", "3600", "", "www.example.org."},
+
+    {"acnamesig2.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"acnamesig2.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"acnamesig2.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    {"acnamesig3.example.org.", "RRSIG", "3600", "", "CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"acnamesig3.example.org.", "RRSIG", "3600", "", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"acnamesig3.example.org.", "A", "3600", "", "192.0.2.1"},
+
+    {"ttldiff1.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"ttldiff1.example.org.", "A", "360", "", "192.0.2.2"},
+
+    {"ttldiff2.example.org.", "A", "360", "", "192.0.2.1"},
+    {"ttldiff2.example.org.", "A", "3600", "", "192.0.2.2"},
+
+    // also add some intentionally bad data
+    {"badcname1.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"badcname1.example.org.", "CNAME", "3600", "", "www.example.org."},
+
+    {"badcname2.example.org.", "CNAME", "3600", "", "www.example.org."},
+    {"badcname2.example.org.", "A", "3600", "", "192.0.2.1"},
+
+    {"badcname3.example.org.", "CNAME", "3600", "", "www.example.org."},
+    {"badcname3.example.org.", "CNAME", "3600", "", "www.example2.org."},
+
+    {"badrdata.example.org.", "A", "3600", "", "bad"},
+
+    {"badtype.example.org.", "BAD_TYPE", "3600", "", "192.0.2.1"},
+
+    {"badttl.example.org.", "A", "badttl", "", "192.0.2.1"},
+
+    {"badsig.example.org.", "A", "badttl", "", "192.0.2.1"},
+    {"badsig.example.org.", "RRSIG", "3600", "", "A 5 3 3600 somebaddata 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    {"badsigtype.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"badsigtype.example.org.", "RRSIG", "3600", "TXT", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    // Data for testing delegation (with NS and DNAME)
+    {"delegation.example.org.", "NS", "3600", "", "ns.example.com."},
+    {"delegation.example.org.", "NS", "3600", "",
+     "ns.delegation.example.org."},
+    {"delegation.example.org.", "DS", "3600", "", "1 1 2 abcd"},
+    {"delegation.example.org.", "RRSIG", "3600", "", "NS 5 3 3600 "
+     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"delegation.example.org.", "RRSIG", "3600", "", "DS 5 3 3600 "
+     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"ns.delegation.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"deep.below.delegation.example.org.", "A", "3600", "", "192.0.2.1"},
+
+    {"dname.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"dname.example.org.", "DNAME", "3600", "", "dname.example.com."},
+    {"dname.example.org.", "RRSIG", "3600", "",
+     "DNAME 5 3 3600 20000101000000 20000201000000 12345 "
+     "example.org. FAKEFAKEFAKE"},
+
+    {"below.dname.example.org.", "A", "3600", "", "192.0.2.1"},
+
+    // Insecure delegation (i.e., no DS at the delegation point)
+    {"insecdelegation.example.org.", "NS", "3600", "", "ns.example.com."},
+    {"insecdelegation.example.org.", "NSEC", "3600", "",
+     "dummy.example.org. NS NSEC"},
+    // and a DS under the zone cut. Such an RR shouldn't exist in a sane zone,
+    // but it could by error or some malicious attempt.  It shouldn't confuse
+    // the implementation)
+    {"child.insecdelegation.example.org.", "DS", "3600", "", "DS 5 3 3600 "
+     "20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    // Delegation NS and other ordinary type of RR coexist at the same
+    // name.  This is deviant (except for some special cases like the other
+    // RR could be used for addressing the NS name), but as long as the
+    // other records are hidden behind the delegation for normal queries
+    // it's not necessarily harmful. (so "broken" may be too strong, but we
+    // keep the name since it could be in a chain of sorted names for DNSSEC
+    // processing and renaming them may have other bad effects for tests).
+    {"brokenns1.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"brokenns1.example.org.", "NS", "3600", "", "ns.example.com."},
+
+    // Now double DNAME, to test failure mode
+    {"baddname.example.org.", "DNAME", "3600", "", "dname1.example.com."},
+    {"baddname.example.org.", "DNAME", "3600", "", "dname2.example.com."},
+
+    // Put some data into apex (including NS) so we can check our NS
+    // doesn't break anything
+    {"example.org.", "SOA", "3600", "", "ns1.example.org. admin.example.org. "
+     "1234 3600 1800 2419200 7200" },
+    {"example.org.", "NS", "3600", "", "ns.example.com."},
+    {"example.org.", "A", "3600", "", "192.0.2.1"},
+    // Note that the RDATA text is "normalized", i.e., identical to what
+    // Rdata::toText() would produce.  some tests rely on that behavior.
+    {"example.org.", "NSEC", "3600", "",
+     "acnamesig1.example.org. A NS RRSIG NSEC"},
+    {"example.org.", "RRSIG", "3600", "", "SOA 5 3 3600 20000101000000 "
+              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 "
+              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"example.org.", "RRSIG", "3600", "", "NS 5 3 3600 20000101000000 "
+              "20000201000000 12345 example.org. FAKEFAKEFAKE"},
+
+    // This is because of empty domain test
+    {"a.b.example.org.", "A", "3600", "", "192.0.2.1"},
+
+    // Something for wildcards
+    {"*.wild.example.org.", "A", "3600", "", "192.0.2.5"},
+    {"*.wild.example.org.", "RRSIG", "3600", "A", "A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"*.wild.example.org.", "NSEC", "3600", "", "cancel.here.wild.example.org. A NSEC RRSIG"},
+    {"*.wild.example.org.", "RRSIG", "3600", "", "NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {"cancel.here.wild.example.org.", "AAAA", "3600", "", "2001:db8::5"},
+    {"delegatedwild.example.org.", "NS", "3600", "", "ns.example.com."},
+    {"*.delegatedwild.example.org.", "A", "3600", "", "192.0.2.5"},
+    {"wild.*.foo.example.org.", "A", "3600", "", "192.0.2.5"},
+    {"wild.*.foo.*.bar.example.org.", "A", "3600", "", "192.0.2.5"},
+    {"wild.*.foo.*.bar.example.org.", "NSEC", "3600", "",
+     "brokenns1.example.org. A NSEC"},
+    {"bao.example.org.", "NSEC", "3600", "", "wild.*.foo.*.bar.example.org. NSEC"},
+    {"*.cnamewild.example.org.", "CNAME", "3600", "", "www.example.org."},
+    {"*.dnamewild.example.org.", "DNAME", "3600", "", "dname.example.com."},
+    {"*.nswild.example.org.", "NS", "3600", "", "ns.example.com."},
+    // For NSEC empty non-terminal
+    {"l.example.org.", "NSEC", "3600", "", "empty.nonterminal.example.org. NSEC"},
+    {"empty.nonterminal.example.org.", "A", "3600", "", "192.0.2.1"},
+    // Invalid rdata
+    {"invalidrdata.example.org.", "A", "3600", "", "Bunch of nonsense"},
+    {"invalidrdata2.example.org.", "A", "3600", "", "192.0.2.1"},
+    {"invalidrdata2.example.org.", "RRSIG", "3600", "", "Nonsense"},
+
+    {NULL, NULL, NULL, NULL, NULL},
+};
 
-public:
-    // This adds the NSEC3PARAM into the apex, so we can perform some NSEC3
-    // tests. Note that the NSEC3 namespace is available in other tests, but
-    // it should not be accessed at that time.
-    void enableNSEC3() {
-        for (int i = 0; TEST_NSEC3PARAM_RECORDS[i][0] != NULL; ++i) {
-            vector<string> param;
-            param.push_back(TEST_NSEC3PARAM_RECORDS[i][1]); // RRtype
-            param.push_back(TEST_NSEC3PARAM_RECORDS[i][2]); // TTL
-            param.push_back("");                            // sigtype, unused
-            param.push_back(TEST_NSEC3PARAM_RECORDS[i][4]); // RDATA
-            param.push_back(TEST_NSEC3PARAM_RECORDS[i][0]); // owner name
-            (*readonly_records_)[param.back()].push_back(param);
-        }
-    }
+const char* TEST_NSEC3PARAM_RECORDS[][5] = {
+    {"example.org.", "NSEC3PARAM", "3600", "", "1 0 12 aabbccdd"},
+    {"example.org.", "RRSIG", "3600", "", "NSEC3PARAM 5 3 3600 20000101000000 "
+     "20000201000000 12345 example.org. FAKEFAKEFAKE"},
+    {NULL, NULL, NULL, NULL, NULL}
 };
 
-// This tests the default getRecords behaviour, throwing NotImplemented
-TEST(DatabaseConnectionTest, getRecords) {
-    EXPECT_THROW(NopAccessor().getRecords(".", 1, false),
-                 isc::NotImplemented);
-}
+const char* TEST_NSEC3_RECORDS[][5] = {
+    {apex_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
+    {apex_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
+    {ns1_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
+    {ns1_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
+    {w_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
+    {w_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
+    {zzz_hash, "NSEC3", "300", "", "1 1 12 AABBCCDD 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG"},
+    {zzz_hash, "RRSIG", "300", "", "NSEC3 5 4 7200 20100410172647 20100311172647 63192 example.org. gNIVj4T8t51fEU6kOPpvK7HOGBFZGbalN5ZK mInyrww6UWZsUNdw07ge6/U6HfG+/s61RZ/L is2M6yUWHyXbNbj/QqwqgadG5dhxTArfuR02 xP600x0fWX8LXzW4yLMdKVxGbzYT+vvGz71o 8gHSY5vYTtothcZQa4BMKhmGQEk="},
+    {NULL, NULL, NULL, NULL, NULL}
+};
 
-// This tests the default getAllRecords behaviour, throwing NotImplemented
-TEST(DatabaseConnectionTest, getAllRecords) {
-    // The parameters don't matter
-    EXPECT_THROW(NopAccessor().getAllRecords(1),
-                 isc::NotImplemented);
+DatabaseClientTest::DatabaseClientTest() :
+    zname_("example.org"), qname_("www.example.org"),
+    qclass_(dns::RRClass::IN()),
+    qtype_(dns::RRType::A()),
+    rrttl_(3600)
+{
+    // Test IN/A RDATA to be added in update tests.  Intentionally using
+    // different data than the initial data configured in the MockAccessor.
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(),
+                                        rrset_->getClass(), "192.0.2.2"));
+    soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
+                                      "ns1.example.org. admin.example.org. "
+                                      "1234 3600 1800 2419200 7200"));
+
+    // And its RRSIG.  Also different from the configured one.
+    rrsigset_.reset(new RRset(qname_, qclass_, RRType::RRSIG(),
+                              rrttl_));
+    rrsigset_->addRdata(rdata::createRdata(rrsigset_->getType(),
+                                           rrsigset_->getClass(),
+                                           "A 5 3 0 20000101000000 "
+                                           "20000201000000 0 example.org. "
+                                           "FAKEFAKEFAKE"));
 }
 
-// This test fixture is templated so that we can share (most of) the test
-// cases with different types of data sources.  Note that in test cases
-// we need to use 'this' to refer to member variables of the test class.
-template <typename ACCESSOR_TYPE>
-class DatabaseClientTest : public ::testing::Test {
-public:
-    DatabaseClientTest() : zname_("example.org"), qname_("www.example.org"),
-                           qclass_(RRClass::IN()), qtype_(RRType::A()),
-                           rrttl_(3600)
-    {
-        createClient();
-
-        // set up the commonly used finder.
-        DataSourceClient::FindResult zone(client_->findZone(zname_));
-        assert(zone.code == result::SUCCESS);
-        finder_ = dynamic_pointer_cast<DatabaseClient::Finder>(
-            zone.zone_finder);
-
-        // Test IN/A RDATA to be added in update tests.  Intentionally using
-        // different data than the initial data configured in the MockAccessor.
-        rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
-        rrset_->addRdata(rdata::createRdata(rrset_->getType(),
-                                            rrset_->getClass(), "192.0.2.2"));
-        soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
-        soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
-                                         "ns1.example.org. admin.example.org. "
-                                         "1234 3600 1800 2419200 7200"));
+void
+DatabaseClientTest::createClient(const DatabaseClientTestParam* test_param) {
+    current_accessor_ = test_param->accessor_creator();
+    is_mock_ = (dynamic_cast<MockAccessor*>(current_accessor_.get()) != NULL);
+    client_.reset(new DatabaseClient(qclass_, current_accessor_));
+
+    // set up the commonly used finder.
+    const DataSourceClient::FindResult result(client_->findZone(zname_));
+    assert(result.code == result::SUCCESS);
+    finder_ = dynamic_pointer_cast<DatabaseClient::Finder>(
+        result.zone_finder);
+}
 
-        // And its RRSIG.  Also different from the configured one.
-        rrsigset_.reset(new RRset(qname_, qclass_, RRType::RRSIG(),
-                                  rrttl_));
-        rrsigset_->addRdata(rdata::createRdata(rrsigset_->getType(),
-                                               rrsigset_->getClass(),
-                                               "A 5 3 0 20000101000000 "
-                                               "20000201000000 0 example.org. "
-                                               "FAKEFAKEFAKE"));
+void
+DatabaseClientTest::checkZoneFinder(const DataSourceClient::FindResult& zone) {
+    ASSERT_NE(ZoneFinderPtr(), zone.zone_finder) << "No zone finder";
+    boost::shared_ptr<DatabaseClient::Finder> finder(
+        boost::dynamic_pointer_cast<DatabaseClient::Finder>(
+            zone.zone_finder));
+    ASSERT_NE(boost::shared_ptr<DatabaseClient::Finder>(), finder) <<
+        "Wrong type of finder";
+    if (is_mock_) {
+        EXPECT_EQ(READONLY_ZONE_ID, finder->zone_id());
     }
+    EXPECT_EQ(current_accessor_.get(), &finder->getAccessor());
+}
 
-    ~ DatabaseClientTest() {
-        // Make sure we return the default creator no matter if we set it or not
-        setNSEC3HashCreator(NULL);
+boost::shared_ptr<DatabaseClient::Finder>
+DatabaseClientTest::getFinder() {
+    DataSourceClient::FindResult zone(client_->findZone(zname_));
+    EXPECT_EQ(result::SUCCESS, zone.code);
+    boost::shared_ptr<DatabaseClient::Finder> finder(
+        boost::dynamic_pointer_cast<DatabaseClient::Finder>(
+            zone.zone_finder));
+    if (is_mock_) {
+        EXPECT_EQ(READONLY_ZONE_ID, finder->zone_id());
     }
 
-    /*
-     * We initialize the client from a function, so we can call it multiple
-     * times per test.
-     */
-    void createClient() {
-        // To make sure we always have empty diffs table at the beginning of
-        // each test, we re-install the writable data source here.
-        // Note: this is SQLite3 specific and a waste (though otherwise
-        // harmless) for other types of data sources.  If and when we support
-        // more types of data sources in this test framework, we should
-        // probably move this to some specialized templated method specific
-        // to SQLite3 (or for even a longer term we should add an API to
-        // purge the diffs table).
-        const char* const install_cmd = INSTALL_PROG " -c " TEST_DATA_COMMONDIR
-            "/rwtest.sqlite3 " TEST_DATA_BUILDDIR
-            "/rwtest.sqlite3.copied";
-        if (system(install_cmd) != 0) {
-            // any exception will do, this is failure in test setup, but nice
-            // to show the command that fails, and shouldn't be caught
-            isc_throw(isc::Exception,
-                      "Error setting up; command failed: " << install_cmd);
-        }
+    return (finder);
+}
 
-        current_accessor_ = new ACCESSOR_TYPE();
-        is_mock_ = (dynamic_cast<MockAccessor*>(current_accessor_) != NULL);
-        client_.reset(new DatabaseClient(qclass_,
-                                         boost::shared_ptr<ACCESSOR_TYPE>(
-                                             current_accessor_)));
+bool
+DatabaseClientTest::isRollbacked(bool expected) const {
+    if (is_mock_) {
+        const MockAccessor& mock_accessor =
+            dynamic_cast<const MockAccessor&>(*update_accessor_);
+        return (mock_accessor.isRollbacked());
+    } else {
+        return (expected);
     }
+}
 
-    /**
-     * Check the zone finder is a valid one and references the zone ID and
-     * database available here.
-     */
-    void checkZoneFinder(const DataSourceClient::FindResult& zone) {
-        ASSERT_NE(ZoneFinderPtr(), zone.zone_finder) << "No zone finder";
-        boost::shared_ptr<DatabaseClient::Finder> finder(
-            dynamic_pointer_cast<DatabaseClient::Finder>(zone.zone_finder));
-        ASSERT_NE(boost::shared_ptr<DatabaseClient::Finder>(), finder) <<
-            "Wrong type of finder";
-        if (is_mock_) {
-            EXPECT_EQ(READONLY_ZONE_ID, finder->zone_id());
+void
+DatabaseClientTest::checkLastAdded(const char* const expected[]) const {
+    if (is_mock_) {
+        const MockAccessor* mock_accessor =
+            dynamic_cast<const MockAccessor*>(current_accessor_.get());
+        for (int i = 0; i < DatabaseAccessor::ADD_COLUMN_COUNT; ++i) {
+            EXPECT_EQ(expected[i],
+                      mock_accessor->getLatestClone()->getLastAdded()[i]);
         }
-        EXPECT_EQ(current_accessor_, &finder->getAccessor());
     }
+}
 
-    boost::shared_ptr<DatabaseClient::Finder> getFinder() {
-        DataSourceClient::FindResult zone(client_->findZone(zname_));
-        EXPECT_EQ(result::SUCCESS, zone.code);
-        boost::shared_ptr<DatabaseClient::Finder> finder(
-            dynamic_pointer_cast<DatabaseClient::Finder>(zone.zone_finder));
-        if (is_mock_) {
-            EXPECT_EQ(READONLY_ZONE_ID, finder->zone_id());
-        }
-
-        return (finder);
+void
+DatabaseClientTest::setUpdateAccessor() {
+    if (is_mock_) {
+        const MockAccessor* mock_accessor =
+            dynamic_cast<const MockAccessor*>(current_accessor_.get());
+        update_accessor_ = mock_accessor->getLatestClone();
     }
+}
 
-    // Helper methods for update tests
-    bool isRollbacked(bool expected = false) const {
-        if (is_mock_) {
-            const MockAccessor& mock_accessor =
-                dynamic_cast<const MockAccessor&>(*update_accessor_);
-            return (mock_accessor.isRollbacked());
-        } else {
-            return (expected);
+void
+DatabaseClientTest::checkJournal(const std::vector<JournalEntry>& expected) {
+    if (is_mock_) {
+        const MockAccessor* mock_accessor =
+            dynamic_cast<const MockAccessor*>(current_accessor_.get());
+        mock_accessor->checkJournal(expected);
+    } else {
+        // For other generic databases, retrieve the diff using the
+        // reader class and compare the resulting sequence of RRset.
+        // For simplicity we only consider the case where the expected
+        // sequence is not empty.
+        ASSERT_FALSE(expected.empty());
+        const Name zone_name(expected.front().
+                             data_[DatabaseAccessor::DIFF_NAME]);
+        ZoneJournalReaderPtr jnl_reader =
+            client_->getJournalReader(zone_name,
+                                      expected.front().serial_,
+                                      expected.back().serial_).second;
+        ASSERT_TRUE(jnl_reader);
+        ConstRRsetPtr rrset;
+        std::vector<JournalEntry>::const_iterator it = expected.begin();
+        for (rrset = jnl_reader->getNextDiff();
+             rrset && it != expected.end();
+             rrset = jnl_reader->getNextDiff(), ++it) {
+            typedef DatabaseAccessor Accessor;
+            RRsetPtr expected_rrset(
+                new RRset(Name((*it).data_[Accessor::DIFF_NAME]),
+                          qclass_,
+                          RRType((*it).data_[Accessor::DIFF_TYPE]),
+                          RRTTL((*it).data_[Accessor::DIFF_TTL])));
+            expected_rrset->addRdata(
+                rdata::createRdata(expected_rrset->getType(),
+                                   expected_rrset->getClass(),
+                                   (*it).data_[Accessor::DIFF_RDATA]));
+            rrsetCheck(expected_rrset, rrset);
         }
+        // We should have examined all entries of both expected and
+        // actual data.
+        EXPECT_TRUE(it == expected.end());
+        ASSERT_FALSE(rrset);
     }
+}
 
-    void checkLastAdded(const char* const expected[]) const {
-        if (is_mock_) {
-            const MockAccessor* mock_accessor =
-                dynamic_cast<const MockAccessor*>(current_accessor_);
-            for (int i = 0; i < DatabaseAccessor::ADD_COLUMN_COUNT; ++i) {
-                EXPECT_EQ(expected[i],
-                          mock_accessor->getLatestClone()->getLastAdded()[i]);
-            }
-        }
+void
+DatabaseClientTest::allowMoreTransaction(bool is_allowed) {
+    if (is_mock_) {
+        // Use a separate variable for MockAccessor&; some compilers
+        // would be confused otherwise.
+        MockAccessor& mock_accessor =
+            dynamic_cast<MockAccessor&>(*current_accessor_);
+        mock_accessor.allowMoreTransaction(is_allowed);
     }
+}
 
-    void setUpdateAccessor() {
-        if (is_mock_) {
-            const MockAccessor* mock_accessor =
-                dynamic_cast<const MockAccessor*>(current_accessor_);
-            update_accessor_ = mock_accessor->getLatestClone();
-        }
+void
+loadTestDataGeneric(DatabaseAccessor& accessor) {
+    accessor.startUpdateZone("example.org.", true);
+    string columns[DatabaseAccessor::ADD_COLUMN_COUNT];
+    for (int i = 0; TEST_RECORDS[i][0] != NULL; ++i) {
+        columns[DatabaseAccessor::ADD_NAME] = TEST_RECORDS[i][0];
+        columns[DatabaseAccessor::ADD_REV_NAME] =
+            Name(columns[DatabaseAccessor::ADD_NAME]).reverse().toText();
+        columns[DatabaseAccessor::ADD_TYPE] = TEST_RECORDS[i][1];
+        columns[DatabaseAccessor::ADD_TTL] = TEST_RECORDS[i][2];
+        columns[DatabaseAccessor::ADD_SIGTYPE] = TEST_RECORDS[i][3];
+        columns[DatabaseAccessor::ADD_RDATA] = TEST_RECORDS[i][4];
+
+        accessor.addRecordToZone(columns);
     }
+    // We don't add NSEC3s until we are explicitly told we need them
+    // in enableNSEC3(); these would break some non NSEC3 tests.
+    accessor.commit();
+}
 
-    void checkJournal(const vector<JournalEntry>& expected) {
-        if (is_mock_) {
-            const MockAccessor* mock_accessor =
-                dynamic_cast<const MockAccessor*>(current_accessor_);
-            mock_accessor->checkJournal(expected);
-        } else {
-            // For other generic databases, retrieve the diff using the
-            // reader class and compare the resulting sequence of RRset.
-            // For simplicity we only consider the case where the expected
-            // sequence is not empty.
-            ASSERT_FALSE(expected.empty());
-            const Name zone_name(expected.front().
-                                 data_[DatabaseAccessor::DIFF_NAME]);
-            ZoneJournalReaderPtr jnl_reader =
-                client_->getJournalReader(zone_name,
-                                          expected.front().serial_,
-                                          expected.back().serial_).second;
-            ASSERT_TRUE(jnl_reader);
-            ConstRRsetPtr rrset;
-            vector<JournalEntry>::const_iterator it = expected.begin();
-            for (rrset = jnl_reader->getNextDiff();
-                 rrset && it != expected.end();
-                 rrset = jnl_reader->getNextDiff(), ++it) {
-                typedef DatabaseAccessor Accessor;
-                RRsetPtr expected_rrset(
-                    new RRset(Name((*it).data_[Accessor::DIFF_NAME]),
-                              qclass_,
-                              RRType((*it).data_[Accessor::DIFF_TYPE]),
-                              RRTTL((*it).data_[Accessor::DIFF_TTL])));
-                expected_rrset->addRdata(
-                    rdata::createRdata(expected_rrset->getType(),
-                                       expected_rrset->getClass(),
-                                       (*it).data_[Accessor::DIFF_RDATA]));
-                rrsetCheck(expected_rrset, rrset);
-            }
-            // We should have examined all entries of both expected and
-            // actual data.
-            EXPECT_TRUE(it == expected.end());
-            ASSERT_FALSE(rrset);
-        }
+void
+enableNSEC3Generic(DatabaseAccessor& accessor) {
+    accessor.startUpdateZone("example.org.", false);
+
+    // Add NSECPARAM at the zone origin
+    for (int i = 0; TEST_NSEC3PARAM_RECORDS[i][0] != NULL; ++i) {
+        const string param_columns[DatabaseAccessor::ADD_COLUMN_COUNT] = {
+            TEST_NSEC3PARAM_RECORDS[i][0], // name
+            Name(param_columns[DatabaseAccessor::ADD_NAME]).reverse().toText(),
+            // revname
+            TEST_NSEC3PARAM_RECORDS[i][2],   // TTL
+            TEST_NSEC3PARAM_RECORDS[i][1],   // RR type
+            TEST_NSEC3PARAM_RECORDS[i][3],   // sigtype
+            TEST_NSEC3PARAM_RECORDS[i][4] }; // RDATA
+        accessor.addRecordToZone(param_columns);
     }
 
-    // Mock-only; control whether to allow subsequent transaction.
-    void allowMoreTransaction(bool is_allowed) {
-        if (is_mock_) {
-            // Use a separate variable for MockAccessor&; some compilers
-            // would be confused otherwise.
-            MockAccessor& mock_accessor =
-                dynamic_cast<MockAccessor&>(*current_accessor_);
-            mock_accessor.allowMoreTransaction(is_allowed);
-        }
+    // Add NSEC3s
+    for (int i = 0; TEST_NSEC3_RECORDS[i][0] != NULL; ++i) {
+        const string nsec3_columns[DatabaseAccessor::ADD_NSEC3_COLUMN_COUNT] =
+            {
+                TEST_NSEC3_RECORDS[i][0], // Hash
+                TEST_NSEC3_RECORDS[i][2], // TTL
+                TEST_NSEC3_RECORDS[i][1], // RR type
+                TEST_NSEC3_RECORDS[i][4]  // RDATA
+            };
+        accessor.addNSEC3RecordToZone(nsec3_columns);
     }
 
-    // Some tests only work for MockAccessor.  We remember whether our accessor
-    // is of that type.
-    bool is_mock_;
-
-    // Will be deleted by client_, just keep the current value for comparison.
-    ACCESSOR_TYPE* current_accessor_;
-    boost::shared_ptr<DatabaseClient> client_;
-    const std::string database_name_;
+    accessor.commit();
+}
 
-    // The zone finder of the test zone commonly used in various tests.
-    boost::shared_ptr<DatabaseClient::Finder> finder_;
-
-    // Some shortcut variables for commonly used test parameters
-    const Name zname_; // the zone name stored in the test data source
-    const Name qname_; // commonly used name to be found
-    const RRClass qclass_;      // commonly used RR class used with qname
-    const RRType qtype_;        // commonly used RR type used with qname
-    const RRTTL rrttl_;         // commonly used RR TTL
-    RRsetPtr rrset_;            // for adding/deleting an RRset
-    RRsetPtr rrsigset_;         // for adding/deleting an RRset
-    RRsetPtr soa_;              // for adding/deleting an RRset
-
-    // update related objects to be tested
-    ZoneUpdaterPtr updater_;
-    boost::shared_ptr<const DatabaseAccessor> update_accessor_;
-
-    // placeholders
-    const std::vector<std::string> empty_rdatas_; // for NXRRSET/NXDOMAIN
-    std::vector<std::string> expected_rdatas_;
-    std::vector<std::string> expected_sig_rdatas_;
-
-    // A creator for use in several NSEC3 related tests.
-    TestNSEC3HashCreator test_nsec3_hash_creator_;
-};
+} // namespace test
+} // namespace datasrc
+} // namespace isc
 
-class TestSQLite3Accessor : public SQLite3Accessor {
-public:
-    TestSQLite3Accessor() : SQLite3Accessor(
-        TEST_DATA_BUILDDIR "/rwtest.sqlite3.copied", "IN")
-    {
-        startUpdateZone("example.org.", true);
-        string columns[ADD_COLUMN_COUNT];
-        for (int i = 0; TEST_RECORDS[i][0] != NULL; ++i) {
-            columns[ADD_NAME] = TEST_RECORDS[i][0];
-            columns[ADD_REV_NAME] = Name(columns[ADD_NAME]).reverse().toText();
-            columns[ADD_TYPE] = TEST_RECORDS[i][1];
-            columns[ADD_TTL] = TEST_RECORDS[i][2];
-            columns[ADD_SIGTYPE] = TEST_RECORDS[i][3];
-            columns[ADD_RDATA] = TEST_RECORDS[i][4];
-
-            addRecordToZone(columns);
-        }
-        // We don't add NSEC3s until we are explicitly told we need them
-        // in enableNSEC3(); these would break some non NSEC3 tests.
-        commit();
-    }
+namespace {
+// This tests the default getRecords behaviour, throwing NotImplemented
+TEST(DatabaseConnectionTest, getRecords) {
+    EXPECT_THROW(NopAccessor().getRecords(".", 1, false),
+                 isc::NotImplemented);
+}
 
-    void enableNSEC3() {
-        startUpdateZone("example.org.", false);
+// This tests the default getAllRecords behaviour, throwing NotImplemented
+TEST(DatabaseConnectionTest, getAllRecords) {
+    // The parameters don't matter
+    EXPECT_THROW(NopAccessor().getAllRecords(1),
+                 isc::NotImplemented);
+}
 
-        // Add NSECPARAM at the zone origin
-        for (int i = 0; TEST_NSEC3PARAM_RECORDS[i][0] != NULL; ++i) {
-            const string param_columns[ADD_COLUMN_COUNT] = {
-                TEST_NSEC3PARAM_RECORDS[i][0], // name
-                Name(param_columns[ADD_NAME]).reverse().toText(), // revname
-                TEST_NSEC3PARAM_RECORDS[i][2],   // TTL
-                TEST_NSEC3PARAM_RECORDS[i][1],   // RR type
-                TEST_NSEC3PARAM_RECORDS[i][3],   // sigtype
-                TEST_NSEC3PARAM_RECORDS[i][4] }; // RDATA
-            addRecordToZone(param_columns);
-        }
+// The following two lines instantiate test cases with concrete accessor
+// classes to be tested.
 
-        // Add NSEC3s
-        for (int i = 0; TEST_NSEC3_RECORDS[i][0] != NULL; ++i) {
-            const string nsec3_columns[ADD_NSEC3_COLUMN_COUNT] = {
-                Name(TEST_NSEC3_RECORDS[i][0]).split(0, 1).toText(true),
-                TEST_NSEC3_RECORDS[i][2], // TTL
-                TEST_NSEC3_RECORDS[i][1], // RR type
-                TEST_NSEC3_RECORDS[i][4] }; // RDATA
-            addNSEC3RecordToZone(nsec3_columns);
-        }
+boost::shared_ptr<DatabaseAccessor>
+createMockAccessor() {
+    return (boost::shared_ptr<DatabaseAccessor>(new MockAccessor()));
+}
 
-        commit();
-    }
-};
+void
+mockEnableNSEC3(DatabaseAccessor& accessor) {
+    dynamic_cast<MockAccessor&>(accessor).enableNSEC3();
+}
 
-// The following two lines instantiate test cases with concrete accessor
-// classes to be tested.
-// XXX: clang++ installed on our FreeBSD buildbot cannot complete compiling
-// this file, seemingly due to the size of the code.  We'll consider more
-// complete workaround, but for a short term workaround we'll reduce the
-// number of tested accessor classes (thus reducing the amount of code
-// to be compiled) for this particular environment.
-#if defined(__clang__) && defined(__FreeBSD__)
-typedef ::testing::Types<MockAccessor> TestAccessorTypes;
-#else
-typedef ::testing::Types<MockAccessor, TestSQLite3Accessor> TestAccessorTypes;
-#endif
+const DatabaseClientTestParam mock_param = { createMockAccessor,
+                                             mockEnableNSEC3 };
 
-TYPED_TEST_CASE(DatabaseClientTest, TestAccessorTypes);
+INSTANTIATE_TEST_CASE_P(, DatabaseClientTest, ::testing::Values(&mock_param));
 
-// In some cases the entire test fixture is for the mock accessor only.
-// We use the usual TEST_F for them with the corresponding specialized class
-// to make the code simpler.
-typedef DatabaseClientTest<MockAccessor> MockDatabaseClientTest;
+// This inherit the DatabaseClientTest cases except for the parameterized
+// setup; it's intended to be used selected test cases that only work for mock
+// data sources.
+class MockDatabaseClientTest : public DatabaseClientTest {
+protected:
+    // Override SetUp() to avoid parameterized setup
+    virtual void SetUp() {
+        createClient(&mock_param);
+    }
+};
 
-TYPED_TEST(DatabaseClientTest, zoneNotFound) {
-    DataSourceClient::FindResult zone(
-        this->client_->findZone(Name("example.com")));
-    EXPECT_EQ(result::NOTFOUND, zone.code);
+TEST_P(DatabaseClientTest, zoneNotFound) {
+    EXPECT_EQ(result::NOTFOUND, client_->findZone(Name("example.com")).code);
 }
 
-TYPED_TEST(DatabaseClientTest, exactZone) {
-    DataSourceClient::FindResult zone(
-        this->client_->findZone(Name("example.org")));
-    EXPECT_EQ(result::SUCCESS, zone.code);
-    this->checkZoneFinder(zone);
+TEST_P(DatabaseClientTest, exactZone) {
+    const DataSourceClient::FindResult result =
+        client_->findZone(Name("example.org"));
+    EXPECT_EQ(result::SUCCESS, result.code);
+    checkZoneFinder(result);
 }
 
-TYPED_TEST(DatabaseClientTest, superZone) {
-    DataSourceClient::FindResult zone(this->client_->findZone(Name(
-        "sub.example.org")));
-    EXPECT_EQ(result::PARTIALMATCH, zone.code);
-    this->checkZoneFinder(zone);
+TEST_P(DatabaseClientTest, superZone) {
+    const DataSourceClient::FindResult result =
+        client_->findZone(Name("sub.example.org"));
+    EXPECT_EQ(result::PARTIALMATCH, result.code);
+    checkZoneFinder(result);
 }
 
 // This test doesn't depend on derived accessor class, so we use TEST().
@@ -1467,9 +1416,8 @@ TEST(GenericDatabaseClientTest, noAccessorException) {
 }
 
 // If the zone doesn't exist, exception is thrown
-TYPED_TEST(DatabaseClientTest, noZoneIterator) {
-    EXPECT_THROW(this->client_->getIterator(Name("example.com")),
-                 DataSourceError);
+TEST_P(DatabaseClientTest, noZoneIterator) {
+    EXPECT_THROW(client_->getIterator(Name("example.com")), DataSourceError);
 }
 
 // If the zone doesn't exist and iteration is not implemented, it still throws
@@ -1492,14 +1440,14 @@ TEST(GenericDatabaseClientTest, notImplementedIterator) {
 // Pretend a bug in the connection and pass NULL as the context
 // Should not crash, but gracefully throw.  Works for the mock accessor only.
 TEST_F(MockDatabaseClientTest, nullIteratorContext) {
-    EXPECT_THROW(this->client_->getIterator(Name("null.example.org")),
+    EXPECT_THROW(client_->getIterator(Name("null.example.org")),
                  isc::Unexpected);
 }
 
 // It doesn't crash or anything if the zone is completely empty.
 // Works for the mock accessor only.
 TEST_F(MockDatabaseClientTest, emptyIterator) {
-    ZoneIteratorPtr it(this->client_->getIterator(Name("empty.example.org")));
+    ZoneIteratorPtr it(client_->getIterator(Name("empty.example.org")));
     EXPECT_EQ(ConstRRsetPtr(), it->getNextRRset());
     // This is past the end, it should throw
     EXPECT_THROW(it->getNextRRset(), isc::Unexpected);
@@ -1525,13 +1473,13 @@ checkRRset(isc::dns::ConstRRsetPtr rrset,
 }
 
 // Iterate through a zone, common case
-TYPED_TEST(DatabaseClientTest, iterator) {
-    ZoneIteratorPtr it(this->client_->getIterator(Name("example.org")));
+TEST_P(DatabaseClientTest, iterator) {
+    ZoneIteratorPtr it(client_->getIterator(Name("example.org")));
     ConstRRsetPtr rrset(it->getNextRRset());
     ASSERT_NE(ConstRRsetPtr(), rrset);
 
     // The first name should be the zone origin.
-    EXPECT_EQ(this->zname_, rrset->getName());
+    EXPECT_EQ(zname_, rrset->getName());
 }
 
 // Supplemental structure used in the couple of tests below.  It represents
@@ -1632,19 +1580,18 @@ TEST_F(MockDatabaseClientTest, iteratorSeparateRRs) {
 // the data is handled in rdata itself).  Works for the mock accessor only.
 TEST_F(MockDatabaseClientTest, badIterator) {
     // It should not throw, but get the lowest one of them
-    ZoneIteratorPtr it(this->client_->getIterator(Name("bad.example.org")));
+    ZoneIteratorPtr it(client_->getIterator(Name("bad.example.org")));
     EXPECT_EQ(it->getNextRRset()->getTTL(), isc::dns::RRTTL(300));
 }
 
-TYPED_TEST(DatabaseClientTest, getSOAFromIterator) {
+TEST_P(DatabaseClientTest, getSOAFromIterator) {
     vector<string> soa_data;
     soa_data.push_back("ns1.example.org. admin.example.org. "
                        "1234 3600 1800 2419200 7200");
 
-    ZoneIteratorPtr it(this->client_->getIterator(this->zname_));
+    ZoneIteratorPtr it(client_->getIterator(zname_));
     ASSERT_TRUE(it);
-    checkRRset(it->getSOA(), this->zname_, this->qclass_, RRType::SOA(),
-               this->rrttl_, soa_data);
+    checkRRset(it->getSOA(), zname_, qclass_, RRType::SOA(), rrttl_, soa_data);
 
     // Iterate over the zone until we find an SOA.  Although there's a broken
     // RDATA that would trigger an exception in getNextRRset(), we should
@@ -1660,19 +1607,19 @@ TYPED_TEST(DatabaseClientTest, getSOAFromIterator) {
     rrsetCheck(it->getSOA(), rrset);
 }
 
-TYPED_TEST(DatabaseClientTest, noSOAFromIterator) {
+TEST_P(DatabaseClientTest, noSOAFromIterator) {
     // First, empty the zone.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->commit();
 
     // Then getSOA() should return NULL.
-    ZoneIteratorPtr it(this->client_->getIterator(this->zname_));
+    ZoneIteratorPtr it(client_->getIterator(zname_));
     ASSERT_TRUE(it);
     EXPECT_FALSE(it->getSOA());
 }
 
-TYPED_TEST(DatabaseClientTest, iterateThenUpdate) {
-    ZoneIteratorPtr it(this->client_->getIterator(this->zname_));
+TEST_P(DatabaseClientTest, iterateThenUpdate) {
+    ZoneIteratorPtr it(client_->getIterator(zname_));
     ASSERT_TRUE(it);
 
     // Try to empty the zone after getting the iterator.  Depending on the
@@ -1680,12 +1627,12 @@ TYPED_TEST(DatabaseClientTest, iterateThenUpdate) {
     // transaction for the iterator.  In either case the integrity of the
     // iterator result should be reserved.
     try {
-        this->updater_ = this->client_->getUpdater(this->zname_, true);
-        this->updater_->commit();
+        updater_ = client_->getUpdater(zname_, true);
+        updater_->commit();
 
         // Confirm at least it doesn't contain any SOA
         EXPECT_EQ(ZoneFinder::NXDOMAIN,
-                  this->getFinder()->find(this->zname_, RRType::SOA())->code);
+                  getFinder()->find(zname_, RRType::SOA())->code);
     } catch (const DataSourceError&) {}
 
     ConstRRsetPtr rrset;
@@ -1698,34 +1645,34 @@ TYPED_TEST(DatabaseClientTest, iterateThenUpdate) {
     rrsetCheck(it->getSOA(), rrset);
 }
 
-TYPED_TEST(DatabaseClientTest, updateThenIterateThenUpdate) {
+TEST_P(DatabaseClientTest, updateThenIterateThenUpdate) {
     // First clear the zone.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->commit();
 
     // Then iterate over it.  It should immediately reach the end, at which
     // point the transaction should be committed.
-    ZoneIteratorPtr it(this->client_->getIterator(this->zname_));
+    ZoneIteratorPtr it(client_->getIterator(zname_));
     ASSERT_TRUE(it);
     EXPECT_FALSE(it->getNextRRset());
 
     // So another update attempt should succeed, too.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->commit();
 }
 
-TYPED_TEST(DatabaseClientTest, updateAfterDeleteIterator) {
+TEST_P(DatabaseClientTest, updateAfterDeleteIterator) {
     // Similar to the previous case, but we delete the iterator in the
     // middle of zone.  The transaction should be canceled (actually no
     // different from commit though) at that point.
-    ZoneIteratorPtr it(this->client_->getIterator(this->zname_));
+    ZoneIteratorPtr it(client_->getIterator(zname_));
     ASSERT_TRUE(it);
     EXPECT_TRUE(it->getNextRRset());
     it.reset();
 
     // So another update attempt should succeed.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->commit();
 }
 
 void
@@ -1758,8 +1705,7 @@ findTestCommon(ZoneFinder& finder, const isc::dns::Name& name,
                 actual_result->rrset->getRRsig()) {
                 checkRRset(actual_result->rrset->getRRsig(),
                            expected_name != Name::ROOT_NAME() ?
-                           expected_name : name,
-                           finder.getClass(),
+                           expected_name : name, finder.getClass(),
                            isc::dns::RRType::RRSIG(), expected_ttl,
                            expected_sig_rdatas);
             } else if (expected_sig_rdatas.empty()) {
@@ -1876,14 +1822,14 @@ doFindAllTestResult(ZoneFinder& finder, const isc::dns::Name& name,
 // When asking for an RRset where RRs somehow have different TTLs, it should
 // convert to the lowest one.
 TEST_F(MockDatabaseClientTest, ttldiff) {
-    ZoneIteratorPtr it(this->client_->getIterator(Name("example.org")));
+    ZoneIteratorPtr it(client_->getIterator(Name("example.org")));
     // Walk through the full iterator, we should see 1 rrset with name
     // ttldiff1.example.org., and two rdatas. Same for ttldiff2
-    Name name("ttldiff.example.org.");
+    const Name name("ttldiff.example.org.");
     bool found = false;
     //bool found2 = false;
     ConstRRsetPtr rrset = it->getNextRRset();
-    while(rrset != ConstRRsetPtr()) {
+    while (rrset != ConstRRsetPtr()) {
         if (rrset->getName() == name) {
             ASSERT_FALSE(found);
             ASSERT_EQ(2, rrset->getRdataCount());
@@ -1898,15 +1844,15 @@ TEST_F(MockDatabaseClientTest, ttldiff) {
 // Unless we ask for individual RRs in our iterator request. In that case
 // every RR should go into its own 'rrset'
 TEST_F(MockDatabaseClientTest, ttldiff_separate_rrs) {
-    ZoneIteratorPtr it(this->client_->getIterator(Name("example.org"), true));
+    ZoneIteratorPtr it(client_->getIterator(Name("example.org"), true));
 
     // Walk through the full iterator, we should see 1 rrset with name
     // ttldiff1.example.org., and two rdatas. Same for ttldiff2
-    Name name("ttldiff.example.org.");
+    const Name name("ttldiff.example.org.");
     int found1 = false;
     int found2 = false;
     ConstRRsetPtr rrset = it->getNextRRset();
-    while(rrset != ConstRRsetPtr()) {
+    while (rrset != ConstRRsetPtr()) {
         if (rrset->getName() == name) {
             ASSERT_EQ(1, rrset->getRdataCount());
             // We should find 1 'rrset' with TTL 300 and one with TTL 600
@@ -1927,766 +1873,741 @@ TEST_F(MockDatabaseClientTest, ttldiff_separate_rrs) {
     ASSERT_TRUE(found2);
 }
 
-TYPED_TEST(DatabaseClientTest, find) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, find) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
     doFindTest(*finder, isc::dns::Name("www.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     doFindTest(*finder, isc::dns::Name("www2.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::1");
-    this->expected_rdatas_.push_back("2001:db8::2");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::1");
+    expected_rdatas_.push_back("2001:db8::2");
     doFindTest(*finder, isc::dns::Name("www.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_,
-               ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("www.example.org."),
                isc::dns::RRType::TXT(), isc::dns::RRType::TXT(),
-               this->rrttl_,
-               ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::NXRRSET,
+               expected_rdatas_, expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
     doFindTest(*finder, isc::dns::Name("cname.example.org."),
-               this->qtype_, isc::dns::RRType::CNAME(), this->rrttl_,
-               ZoneFinder::CNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               qtype_, isc::dns::RRType::CNAME(), rrttl_,
+               ZoneFinder::CNAME, expected_rdatas_,
+               expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
     doFindTest(*finder, isc::dns::Name("cname.example.org."),
                isc::dns::RRType::CNAME(), isc::dns::RRType::CNAME(),
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("doesnotexist.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE");
+               qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN,
+               expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12346 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signed1.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::1");
-    this->expected_rdatas_.push_back("2001:db8::2");
-    this->expected_sig_rdatas_.push_back("AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::1");
+    expected_rdatas_.push_back("2001:db8::2");
+    expected_sig_rdatas_.push_back("AAAA 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signed1.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("signed1.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), this->rrttl_,
-               ZoneFinder::NXRRSET, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
-    this->expected_sig_rdatas_.push_back("CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
+    expected_sig_rdatas_.push_back("CNAME 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signedcname1.example.org."),
-               this->qtype_, isc::dns::RRType::CNAME(), this->rrttl_,
-               ZoneFinder::CNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12346 example.org. FAKEFAKEFAKE");
+               qtype_, isc::dns::RRType::CNAME(), rrttl_,
+               ZoneFinder::CNAME, expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12346 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signed2.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::2");
-    this->expected_rdatas_.push_back("2001:db8::1");
-    this->expected_sig_rdatas_.push_back("AAAA 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::2");
+    expected_rdatas_.push_back("2001:db8::1");
+    expected_sig_rdatas_.push_back("AAAA 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signed2.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("signed2.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), this->rrttl_,
-               ZoneFinder::NXRRSET, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
-    this->expected_sig_rdatas_.push_back("CNAME 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
+    expected_sig_rdatas_.push_back("CNAME 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("signedcname2.example.org."),
-               this->qtype_, isc::dns::RRType::CNAME(), this->rrttl_,
-               ZoneFinder::CNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               qtype_, isc::dns::RRType::CNAME(), rrttl_,
+               ZoneFinder::CNAME, expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("acnamesig1.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("acnamesig2.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("acnamesig3.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     doFindTest(*finder, isc::dns::Name("ttldiff1.example.org."),
-               this->qtype_, this->qtype_, isc::dns::RRTTL(360),
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+               qtype_, qtype_, isc::dns::RRTTL(360),
+               ZoneFinder::SUCCESS, expected_rdatas_, expected_sig_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     doFindTest(*finder, isc::dns::Name("ttldiff2.example.org."),
-               this->qtype_, this->qtype_, isc::dns::RRTTL(360),
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               qtype_, qtype_, isc::dns::RRTTL(360),
+               ZoneFinder::SUCCESS, expected_rdatas_, expected_sig_rdatas_);
 
     EXPECT_THROW(finder->find(isc::dns::Name("badcname1.example.org."),
-                                              this->qtype_,
+                                              qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badcname2.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badcname2.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badcname3.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badcname3.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badrdata.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badrdata.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badtype.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badtype.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badttl.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badttl.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
-    EXPECT_THROW(finder->find(isc::dns::Name("badsig.example.org."),
-                                              this->qtype_,
+    EXPECT_THROW(finder->find(isc::dns::Name("badsig.example.org."), qtype_,
                                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
 
     // Trigger the hardcoded exceptions and see if find() has cleaned up
-    if (this->is_mock_) {
-        EXPECT_THROW(finder->find(Name("dsexception.example.org."),
-                                  this->qtype_,
+    if (is_mock_) {
+        EXPECT_THROW(finder->find(Name("dsexception.example.org."), qtype_,
                                   ZoneFinder::FIND_DEFAULT),
                      DataSourceError);
-        EXPECT_THROW(finder->find(Name("iscexception.example.org."),
-                                  this->qtype_,
+        EXPECT_THROW(finder->find(Name("iscexception.example.org."), qtype_,
                                   ZoneFinder::FIND_DEFAULT),
                      isc::Exception);
-        EXPECT_THROW(finder->find(Name("basicexception.example.org."),
-                                  this->qtype_,
+        EXPECT_THROW(finder->find(Name("basicexception.example.org."), qtype_,
                                   ZoneFinder::FIND_DEFAULT),
                      std::exception);
         EXPECT_THROW(finder->find(Name("dsexception.getnext.example.org"),
-                                  this->qtype_,
-                                  ZoneFinder::FIND_DEFAULT),
+                                  qtype_, ZoneFinder::FIND_DEFAULT),
                      DataSourceError);
         EXPECT_THROW(finder->find(Name("iscexception.getnext.example.org."),
-                                  this->qtype_,
-                                  ZoneFinder::FIND_DEFAULT),
+                                  qtype_, ZoneFinder::FIND_DEFAULT),
                      isc::Exception);
         EXPECT_THROW(finder->find(Name("basicexception.getnext.example.org."),
-                                  this->qtype_,
-                                  ZoneFinder::FIND_DEFAULT),
+                                  qtype_, ZoneFinder::FIND_DEFAULT),
                      std::exception);
     }
 
     // This RRSIG has the wrong sigtype field, which should be
     // an error if we decide to keep using that field
     // Right now the field is ignored, so it does not error
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("badsigtype.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
 }
 
-TYPED_TEST(DatabaseClientTest, findAtOrigin) {
-    ZoneFinderPtr finder(this->getFinder());
+TEST_P(DatabaseClientTest, findAtOrigin) {
+    ZoneFinderPtr finder(getFinder());
 
     // Specified type of RR exists, no DNSSEC
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    doFindAtOriginTest(*finder, this->zname_, RRType::NS(), RRType::NS(),
-                       this->rrttl_, ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    doFindAtOriginTest(*finder, zname_, RRType::NS(), RRType::NS(),
+                       rrttl_, ZoneFinder::SUCCESS,
+                       expected_rdatas_, expected_sig_rdatas_);
 
     // Specified type of RR exists, with DNSSEC
-    this->expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
-    doFindAtOriginTest(*finder, this->zname_, RRType::NS(), RRType::NS(),
-                       this->rrttl_, ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
-                       false, ZoneFinder::RESULT_DEFAULT, this->zname_,
+    expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
+    doFindAtOriginTest(*finder, zname_, RRType::NS(), RRType::NS(),
+                       rrttl_, ZoneFinder::SUCCESS,
+                       expected_rdatas_, expected_sig_rdatas_,
+                       false, ZoneFinder::RESULT_DEFAULT, zname_,
                        ZoneFinder::FIND_DNSSEC);
 
     // Specified type of RR doesn't exist, no DNSSEC
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    doFindAtOriginTest(*finder, this->zname_, RRType::TXT(), this->qtype_,
-                       this->rrttl_, ZoneFinder::NXRRSET,
-                       this->expected_rdatas_, this->expected_sig_rdatas_);
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    doFindAtOriginTest(*finder, zname_, RRType::TXT(), qtype_,
+                       rrttl_, ZoneFinder::NXRRSET,
+                       expected_rdatas_, expected_sig_rdatas_);
 
     // Specified type of RR doesn't exist, with DNSSEC
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back(
-        "acnamesig1.example.org. A NS RRSIG NSEC");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
-    doFindAtOriginTest(*finder, this->zname_, RRType::TXT(), RRType::NSEC(),
-                       this->rrttl_, ZoneFinder::NXRRSET,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("acnamesig1.example.org. A NS RRSIG NSEC");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
+    doFindAtOriginTest(*finder, zname_, RRType::TXT(), RRType::NSEC(),
+                       rrttl_, ZoneFinder::NXRRSET,
+                       expected_rdatas_, expected_sig_rdatas_,
                        false, ZoneFinder::RESULT_NSEC_SIGNED,
-                       this->zname_, ZoneFinder::FIND_DNSSEC);
+                       zname_, ZoneFinder::FIND_DNSSEC);
 
     // Specified type of RR doesn't exist, with DNSSEC, enabling NSEC3
-    this->current_accessor_->enableNSEC3();
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    doFindAtOriginTest(*finder, this->zname_, RRType::TXT(), RRType::TXT(),
-                       this->rrttl_, ZoneFinder::NXRRSET,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
+    (GetParam()->enable_nsec3_fn)(*current_accessor_);
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    doFindAtOriginTest(*finder, zname_, RRType::TXT(), RRType::TXT(),
+                       rrttl_, ZoneFinder::NXRRSET,
+                       expected_rdatas_, expected_sig_rdatas_,
                        false, ZoneFinder::RESULT_NSEC3_SIGNED,
-                       this->zname_, ZoneFinder::FIND_DNSSEC);
+                       zname_, ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, findAtOriginWithMinTTL) {
+TEST_P(DatabaseClientTest, findAtOriginWithMinTTL) {
     // First, replace the SOA of the test zone so that its RR TTL is larger
     // than MINTTL (the original data are used in many places, so replacing
     // them just for this doesn't make sense).
-    RRsetPtr old_soa(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                               this->rrttl_));
-    old_soa->addRdata(rdata::createRdata(RRType::SOA(), this->qclass_,
+    RRsetPtr old_soa(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    old_soa->addRdata(rdata::createRdata(RRType::SOA(), qclass_,
                                          "ns1.example.org. admin.example.org. "
                                          "1234 3600 1800 2419200 7200"));
 
     const string new_soa_rdata = "ns1.example.org. admin.example.org. "
         "1234 3600 1800 2419200 1200";
-    RRsetPtr new_soa(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                               this->rrttl_));
-    new_soa->addRdata(rdata::createRdata(RRType::SOA(), this->qclass_,
+    RRsetPtr new_soa(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    new_soa->addRdata(rdata::createRdata(RRType::SOA(), qclass_,
                                          new_soa_rdata));
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*old_soa);
-    this->updater_->addRRset(*new_soa);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*old_soa);
+    updater_->addRRset(*new_soa);
+    updater_->commit();
 
-    ZoneFinderPtr finder = this->getFinder();
+    ZoneFinderPtr finder = getFinder();
 
     // Specify the use of min TTL, then the resulting TTL should be derived
     // from the SOA MINTTL (which is smaller).
-    this->expected_rdatas_.push_back(new_soa_rdata);
-    doFindAtOriginTest(*finder, this->zname_, RRType::SOA(), RRType::SOA(),
+    expected_rdatas_.push_back(new_soa_rdata);
+    doFindAtOriginTest(*finder, zname_, RRType::SOA(), RRType::SOA(),
                        RRTTL(1200), ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
-                       true);
+                       expected_rdatas_, expected_sig_rdatas_, true);
 
     // If DNSSEC is requested, TTL of the RRSIG should also be the min.
-    this->expected_sig_rdatas_.push_back(
+    expected_sig_rdatas_.push_back(
         "SOA 5 3 3600 20000101000000 "
         "20000201000000 12345 example.org. FAKEFAKEFAKE");
-    doFindAtOriginTest(*finder, this->zname_, RRType::SOA(), RRType::SOA(),
+    doFindAtOriginTest(*finder, zname_, RRType::SOA(), RRType::SOA(),
                        RRTTL(1200), ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
-                       true, ZoneFinder::RESULT_DEFAULT, this->zname_,
+                       expected_rdatas_, expected_sig_rdatas_,
+                       true, ZoneFinder::RESULT_DEFAULT, zname_,
                        ZoneFinder::FIND_DNSSEC);
 
     // Not really intended usage, but specify the use of min TTL for non SOA.
     // It should still work as specified.
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    doFindAtOriginTest(*finder, this->zname_, RRType::NS(), RRType::NS(),
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    doFindAtOriginTest(*finder, zname_, RRType::NS(), RRType::NS(),
                        RRTTL(1200), ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
-                       true);
+                       expected_rdatas_, expected_sig_rdatas_, true);
 
     // If we don't request the use of min TTL, the original TTL will be used.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back(new_soa_rdata);
-    doFindAtOriginTest(*finder, this->zname_, RRType::SOA(), RRType::SOA(),
-                       this->rrttl_, ZoneFinder::SUCCESS,
-                       this->expected_rdatas_, this->expected_sig_rdatas_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back(new_soa_rdata);
+    doFindAtOriginTest(*finder, zname_, RRType::SOA(), RRType::SOA(),
+                       rrttl_, ZoneFinder::SUCCESS,
+                       expected_rdatas_, expected_sig_rdatas_);
 
     // If no RRset is returned, use_minttl doesn't matter (it shouldn't cause
     // disruption)
-    this->expected_rdatas_.clear();
-    doFindAtOriginTest(*finder, this->zname_, RRType::TXT(), this->qtype_,
-                       this->rrttl_, ZoneFinder::NXRRSET,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
-                       true);
+    expected_rdatas_.clear();
+    doFindAtOriginTest(*finder, zname_, RRType::TXT(), qtype_,
+                       rrttl_, ZoneFinder::NXRRSET,
+                       expected_rdatas_, expected_sig_rdatas_, true);
 
     // If it results in NXRRSET with NSEC, and if we specify the use of min
     // TTL, the NSEC and RRSIG should have the min TTL (again, though, this
     // use case is not really the intended one)
-    this->expected_rdatas_.push_back(
-        "acnamesig1.example.org. A NS RRSIG NSEC");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
-    doFindAtOriginTest(*finder, this->zname_, RRType::TXT(), RRType::NSEC(),
+    expected_rdatas_.push_back("acnamesig1.example.org. A NS RRSIG NSEC");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
+    doFindAtOriginTest(*finder, zname_, RRType::TXT(), RRType::NSEC(),
                        RRTTL(1200), ZoneFinder::NXRRSET,
-                       this->expected_rdatas_, this->expected_sig_rdatas_,
+                       expected_rdatas_, expected_sig_rdatas_,
                        true, ZoneFinder::RESULT_NSEC_SIGNED,
-                       this->zname_, ZoneFinder::FIND_DNSSEC);
+                       zname_, ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, findAtOriginWithMinTTLBroken) {
+TEST_P(DatabaseClientTest, findAtOriginWithMinTTLBroken) {
     // Similar to the previous case, but we intentionally remove the SOA
     // (assuming the underlying data source doesn't complain about it).
     // This will cause exception in subsequent findAtOrigin() with use_minttl
     // being true.
-    RRsetPtr old_soa(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                               this->rrttl_));
-    old_soa->addRdata(rdata::createRdata(RRType::SOA(), this->qclass_,
+    RRsetPtr old_soa(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    old_soa->addRdata(rdata::createRdata(RRType::SOA(), qclass_,
                                          "ns1.example.org. admin.example.org. "
                                          "1234 3600 1800 2419200 7200"));
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*old_soa);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*old_soa);
+    updater_->commit();
 
-    EXPECT_THROW(this->getFinder()->findAtOrigin(RRType::NS(), true,
-                                                 ZoneFinder::FIND_DEFAULT),
+    EXPECT_THROW(getFinder()->findAtOrigin(RRType::NS(), true,
+                                           ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, findOutOfZone) {
+TEST_P(DatabaseClientTest, findOutOfZone) {
     // If the query name is out-of-zone it should result in an exception
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
     vector<ConstRRsetPtr> target;
 
     // Superdomain
-    EXPECT_THROW(finder->find(Name("org"), this->qtype_), OutOfZone);
+    EXPECT_THROW(finder->find(Name("org"), qtype_), OutOfZone);
     EXPECT_THROW(finder->findAll(Name("org"), target), OutOfZone);
 
     // sharing a common ancestor
-    EXPECT_THROW(finder->find(Name("noexample.org"), this->qtype_), OutOfZone);
+    EXPECT_THROW(finder->find(Name("noexample.org"), qtype_), OutOfZone);
     EXPECT_THROW(finder->findAll(Name("noexample.org"), target), OutOfZone);
 
     // totally unrelated domain, smaller number of labels
-    EXPECT_THROW(finder->find(Name("com"), this->qtype_), OutOfZone);
+    EXPECT_THROW(finder->find(Name("com"), qtype_), OutOfZone);
     EXPECT_THROW(finder->findAll(Name("com"), target), OutOfZone);
 
     // totally unrelated domain, same number of labels
-    EXPECT_THROW(finder->find(Name("example.com"), this->qtype_), OutOfZone);
+    EXPECT_THROW(finder->find(Name("example.com"), qtype_), OutOfZone);
     EXPECT_THROW(finder->findAll(Name("example.com"), target), OutOfZone);
 
     // totally unrelated domain, larger number of labels
-    EXPECT_THROW(finder->find(Name("more.example.com"), this->qtype_),
-                 OutOfZone);
+    EXPECT_THROW(finder->find(Name("more.example.com"), qtype_), OutOfZone);
     EXPECT_THROW(finder->findAll(Name("more.example.com"), target), OutOfZone);
 }
 
-TYPED_TEST(DatabaseClientTest, findDelegation) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, findDelegation) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // The apex should not be considered delegation point and we can access
     // data
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
     doFindTest(*finder, isc::dns::Name("example.org."),
-               this->qtype_, this->qtype_,
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               qtype_, qtype_,
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    this->expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 20000201000000 "
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 20000201000000 "
                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("example.org."),
                isc::dns::RRType::NS(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
     // Check when we ask for something below delegation point, we get the NS
     // (Both when the RRset there exists and doesn't)
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    this->expected_rdatas_.push_back("ns.delegation.example.org.");
-    this->expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 20000201000000 "
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.push_back("ns.delegation.example.org.");
+    expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 20000201000000 "
                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("ns.delegation.example.org."),
-               this->qtype_, isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, isc::dns::RRType::NS(),
+               rrttl_, ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegation.example.org."));
     doFindTest(*finder, isc::dns::Name("ns.delegation.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegation.example.org."));
     doFindTest(*finder, isc::dns::Name("deep.below.delegation.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegation.example.org."));
 
     // Even when we check directly at the delegation point, we should get
     // the NS
     doFindTest(*finder, isc::dns::Name("delegation.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_);
 
     // And when we ask directly for the NS, we should still get delegation
     doFindTest(*finder, isc::dns::Name("delegation.example.org."),
                isc::dns::RRType::NS(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_);
 
     // Now test delegation. If it is below the delegation point, we should get
     // the DNAME (the one with data under DNAME is invalid zone, but we test
     // the behaviour anyway just to make sure)
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("dname.example.com.");
-    this->expected_sig_rdatas_.clear();
-    this->expected_sig_rdatas_.push_back("DNAME 5 3 3600 20000101000000 "
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("dname.example.com.");
+    expected_sig_rdatas_.clear();
+    expected_sig_rdatas_.push_back("DNAME 5 3 3600 20000101000000 "
                                   "20000201000000 12345 example.org. "
                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("below.dname.example.org."),
-               this->qtype_, isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, isc::dns::RRType::DNAME(),
+               rrttl_, ZoneFinder::DNAME, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."));
     doFindTest(*finder, isc::dns::Name("below.dname.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::DNAME, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."));
     // below.dname.example.org. has an A record
     doFindTest(*finder, isc::dns::Name("below.dname.example.org."),
                isc::dns::RRType::A(), isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::DNAME, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."));
     doFindTest(*finder, isc::dns::Name("really.deep.below.dname.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::DNAME, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."));
 
     // Asking directly for DNAME should give SUCCESS
     doFindTest(*finder, isc::dns::Name("dname.example.org."),
                isc::dns::RRType::DNAME(), isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
 
     // But we don't delegate at DNAME point
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("dname.example.org."),
-               this->qtype_, this->qtype_,
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
-    this->expected_rdatas_.clear();
+               qtype_, qtype_,
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_);
+    expected_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("dname.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXRRSET, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               rrttl_, ZoneFinder::NXRRSET, expected_rdatas_,
+               expected_sig_rdatas_);
 
     // This is broken dname, it contains two targets
     EXPECT_THROW(finder->find(isc::dns::Name("below.baddname.example.org."),
-                              this->qtype_,
+                              qtype_,
                               ZoneFinder::FIND_DEFAULT),
                  DataSourceError);
 
     // NS and other type coexist: deviant and not necessarily harmful.
     // It should normally just result in DELEGATION; if GLUE_OK is specified,
     // the other RR should be visible.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    doFindTest(*finder, Name("brokenns1.example.org"), this->qtype_,
-               RRType::NS(), this->rrttl_, ZoneFinder::DELEGATION,
-               this->expected_rdatas_, this->empty_rdatas_,
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    doFindTest(*finder, Name("brokenns1.example.org"), qtype_,
+               RRType::NS(), rrttl_, ZoneFinder::DELEGATION,
+               expected_rdatas_, empty_rdatas_,
                ZoneFinder::RESULT_DEFAULT);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    doFindTest(*finder, Name("brokenns1.example.org"), this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->empty_rdatas_,
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    doFindTest(*finder, Name("brokenns1.example.org"), qtype_,
+               qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, empty_rdatas_,
                ZoneFinder::RESULT_DEFAULT, Name("brokenns1.example.org"),
                ZoneFinder::FIND_GLUE_OK);
 }
 
-TYPED_TEST(DatabaseClientTest, findDS) {
+TEST_P(DatabaseClientTest, findDS) {
     // Type DS query is an exception to the general delegation case; the NS
     // should be ignored and it should be treated just like normal
     // authoritative data.
 
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // DS exists at the delegation point.  It should be returned with result
     // code of SUCCESS.
-    this->expected_rdatas_.push_back("1 1 2 abcd"),
-    this->expected_sig_rdatas_.push_back("DS 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("1 1 2 abcd"),
+    expected_sig_rdatas_.push_back("DS 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, Name("delegation.example.org."),
-               RRType::DS(), RRType::DS(), this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               RRType::DS(), RRType::DS(), rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_DEFAULT);
 
     // DS doesn't exist at the delegation point.  The result should be
     // NXRRSET, and if DNSSEC is requested and the zone is NSEC-signed,
     // the corresponding NSEC should be returned (normally with its RRSIG,
     // but in this simplified test setup it's omitted in the test data).
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("dummy.example.org. NS NSEC");
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("dummy.example.org. NS NSEC");
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, Name("insecdelegation.example.org."),
-               RRType::DS(), RRType::NSEC(), this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               RRType::DS(), RRType::NSEC(), rrttl_, ZoneFinder::NXRRSET,
+               expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_NSEC_SIGNED,
                Name("insecdelegation.example.org."), ZoneFinder::FIND_DNSSEC);
 
     // Some insane case: DS under a zone cut.  It's included in the DB, but
     // shouldn't be visible via finder.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
     doFindTest(*finder, Name("child.insecdelegation.example.org"),
-               RRType::DS(), RRType::NS(), this->rrttl_,
-               ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               RRType::DS(), RRType::NS(), rrttl_,
+               ZoneFinder::DELEGATION, expected_rdatas_,
+               empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
                Name("insecdelegation.example.org."), ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, emptyDomain) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, emptyDomain) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // This domain doesn't exist, but a subdomain of it does.
     // Therefore we should pretend the domain is there, but contains no RRsets
-    doFindTest(*finder, isc::dns::Name("b.example.org."), this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+    doFindTest(*finder, isc::dns::Name("b.example.org."), qtype_,
+               qtype_, rrttl_, ZoneFinder::NXRRSET,
+               expected_rdatas_, expected_sig_rdatas_);
 }
 
 // Glue-OK mode. Just go through NS delegations down (but not through
 // DNAME) and pretend it is not there.
-TYPED_TEST(DatabaseClientTest, glueOK) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, glueOK) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("ns.delegation.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::NXRRSET, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("ns.delegation.example.org."),
                ZoneFinder::FIND_GLUE_OK);
     doFindTest(*finder, isc::dns::Name("nothere.delegation.example.org."),
                isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::NXDOMAIN, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("nothere.delegation.example.org."),
                ZoneFinder::FIND_GLUE_OK);
-    this->expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.1");
     doFindTest(*finder, isc::dns::Name("ns.delegation.example.org."),
-               this->qtype_, this->qtype_,
-               this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_DEFAULT,
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("ns.delegation.example.org."),
                ZoneFinder::FIND_GLUE_OK);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
-    this->expected_rdatas_.push_back("ns.delegation.example.org.");
-    this->expected_sig_rdatas_.clear();
-    this->expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 "
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.push_back("ns.delegation.example.org.");
+    expected_sig_rdatas_.clear();
+    expected_sig_rdatas_.push_back("NS 5 3 3600 20000101000000 "
                                    "20000201000000 12345 example.org. "
                                    "FAKEFAKEFAKE");
     // When we request the NS, it should be SUCCESS, not DELEGATION
     // (different in GLUE_OK)
     doFindTest(*finder, isc::dns::Name("delegation.example.org."),
                isc::dns::RRType::NS(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_DEFAULT,
+               rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegation.example.org."),
                ZoneFinder::FIND_GLUE_OK);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("dname.example.com.");
-    this->expected_sig_rdatas_.clear();
-    this->expected_sig_rdatas_.push_back("DNAME 5 3 3600 20000101000000 "
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("dname.example.com.");
+    expected_sig_rdatas_.clear();
+    expected_sig_rdatas_.push_back("DNAME 5 3 3600 20000101000000 "
                                    "20000201000000 12345 example.org. "
                                    "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("below.dname.example.org."),
-               this->qtype_, isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, isc::dns::RRType::DNAME(),
+               rrttl_, ZoneFinder::DNAME, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."), ZoneFinder::FIND_GLUE_OK);
     doFindTest(*finder, isc::dns::Name("below.dname.example.org."),
-               isc::dns::RRType::AAAA(), isc::dns::RRType::DNAME(),
-               this->rrttl_, ZoneFinder::DNAME, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               isc::dns::RRType::AAAA(), isc::dns::RRType::DNAME(), rrttl_,
+               ZoneFinder::DNAME, expected_rdatas_, expected_sig_rdatas_,
+               ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("dname.example.org."), ZoneFinder::FIND_GLUE_OK);
 }
 
-TYPED_TEST(DatabaseClientTest, wildcard) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, wildcard) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // First, simple wildcard match
     // Check also that the RRSIG is added from the wildcard (not modified)
-    this->expected_rdatas_.push_back("192.0.2.5");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("192.0.2.5");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("a.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_,
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_WILDCARD);
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_WILDCARD);
     doFindTest(*finder, isc::dns::Name("b.a.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_WILDCARD);
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_WILDCARD);
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("a.wild.example.org"),
-               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_WILDCARD);
     doFindTest(*finder, isc::dns::Name("b.a.wild.example.org"),
-               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_WILDCARD);
 
     // Direct request for this wildcard
-    this->expected_rdatas_.push_back("192.0.2.5");
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("192.0.2.5");
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("*.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-    this->expected_rdatas_.clear();
-    this->expected_sig_rdatas_.clear();
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, expected_sig_rdatas_);
+    expected_rdatas_.clear();
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("*.wild.example.org"),
-               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::NXRRSET, this->expected_rdatas_,
-               this->expected_sig_rdatas_);
+               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_);
     // This is nonsense, but check it doesn't match by some stupid accident
     doFindTest(*finder, isc::dns::Name("a.*.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN,
+               expected_rdatas_, expected_sig_rdatas_);
     // These should be canceled, since it is below a domain which exitsts
     doFindTest(*finder, isc::dns::Name("nothing.here.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN,
+               expected_rdatas_, expected_sig_rdatas_);
     doFindTest(*finder, isc::dns::Name("cancel.here.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-    doFindTest(*finder,
-               isc::dns::Name("below.cancel.here.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::NXRRSET,
+               expected_rdatas_, expected_sig_rdatas_);
+    doFindTest(*finder, isc::dns::Name("below.cancel.here.wild.example.org"),
+               qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN,
+               expected_rdatas_, expected_sig_rdatas_);
     // And this should be just plain empty non-terminal domain, check
     // the wildcard doesn't hurt it
     doFindTest(*finder, isc::dns::Name("here.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               qtype_, qtype_, rrttl_, ZoneFinder::NXRRSET,
+               expected_rdatas_, expected_sig_rdatas_);
     // Also make sure that the wildcard doesn't hurt the original data
     // below the wildcard
-    this->expected_rdatas_.push_back("2001:db8::5");
+    expected_rdatas_.push_back("2001:db8::5");
     doFindTest(*finder, isc::dns::Name("cancel.here.wild.example.org"),
-               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(),
-               this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
-    this->expected_rdatas_.clear();
+               isc::dns::RRType::AAAA(), isc::dns::RRType::AAAA(), rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, expected_sig_rdatas_);
+    expected_rdatas_.clear();
 
     // How wildcard go together with delegation
-    this->expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.push_back("ns.example.com.");
     doFindTest(*finder, isc::dns::Name("below.delegatedwild.example.org"),
-               this->qtype_, isc::dns::RRType::NS(), this->rrttl_,
-               ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, isc::dns::RRType::NS(), rrttl_,
+               ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegatedwild.example.org"));
-    // FIXME: This doesn't look logically OK, GLUE_OK should make it transparent,
-    // so the match should either work or be canceled, but return NXDOMAIN
+    // FIXME: This doesn't look logically OK, GLUE_OK should make it
+    // transparent, so the match should either work or be canceled, but return
+    // NXDOMAIN
     doFindTest(*finder, isc::dns::Name("below.delegatedwild.example.org"),
-               this->qtype_, isc::dns::RRType::NS(), this->rrttl_,
-               ZoneFinder::DELEGATION, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, isc::dns::RRType::NS(), rrttl_,
+               ZoneFinder::DELEGATION, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                isc::dns::Name("delegatedwild.example.org"),
                ZoneFinder::FIND_GLUE_OK);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.5");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.5");
     // These are direct matches
     const char* positive_names[] = {
         "wild.*.foo.example.org.",
@@ -2694,14 +2615,13 @@ TYPED_TEST(DatabaseClientTest, wildcard) {
         NULL
     };
     for (const char** name = positive_names; *name != NULL; ++ name) {
-        doFindTest(*finder, isc::dns::Name(*name), this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_,
-                   this->expected_sig_rdatas_);
+        doFindTest(*finder, isc::dns::Name(*name), qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_,
+                   expected_sig_rdatas_);
     }
 
     // These are wildcard matches against empty nonterminal asterisk
-    this->expected_rdatas_.clear();
+    expected_rdatas_.clear();
     const char* negative_names[] = {
         "a.foo.example.org.",
         "wild.bar.foo.example.org.",
@@ -2713,9 +2633,8 @@ TYPED_TEST(DatabaseClientTest, wildcard) {
     // Unless FIND_DNSSEC is specified, this is no different from other
     // NXRRSET case.
     for (const char** name = negative_names; *name != NULL; ++ name) {
-        doFindTest(*finder, isc::dns::Name(*name), this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-                   this->expected_rdatas_, this->expected_sig_rdatas_,
+        doFindTest(*finder, isc::dns::Name(*name), qtype_, qtype_, rrttl_,
+                   ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_,
                    ZoneFinder::RESULT_WILDCARD);
     }
 
@@ -2726,25 +2645,24 @@ TYPED_TEST(DatabaseClientTest, wildcard) {
         "a.foo.bar.example.org.",
         NULL
     };
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("wild.*.foo.*.bar.example.org. NSEC");
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("wild.*.foo.*.bar.example.org. NSEC");
+    expected_sig_rdatas_.clear();
     for (const char** name = negative_dnssec_names; *name != NULL; ++ name) {
-        doFindTest(*finder, isc::dns::Name(*name), this->qtype_,
-                   RRType::NSEC(), this->rrttl_, ZoneFinder::NXRRSET,
-                   this->expected_rdatas_, this->expected_sig_rdatas_,
+        doFindTest(*finder, isc::dns::Name(*name), qtype_,
+                   RRType::NSEC(), rrttl_, ZoneFinder::NXRRSET,
+                   expected_rdatas_, expected_sig_rdatas_,
                    ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC_SIGNED,
                    Name("bao.example.org."), ZoneFinder::FIND_DNSSEC);
     }
 
     // CNAME on a wildcard.  Maybe not so common, but not disallowed.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
-    this->expected_sig_rdatas_.clear();
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
+    expected_sig_rdatas_.clear();
     doFindTest(*finder, isc::dns::Name("a.cnamewild.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::CNAME(),
-               this->rrttl_, ZoneFinder::CNAME,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               isc::dns::RRType::TXT(), isc::dns::RRType::CNAME(), rrttl_,
+               ZoneFinder::CNAME, expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_WILDCARD);
 
     // DNAME on a wildcard.  In our implementation we ignore DNAMEs on a
@@ -2752,120 +2670,110 @@ TYPED_TEST(DatabaseClientTest, wildcard) {
     // rfc2672bis strongly discourages the mixture of DNAME and wildcard
     // (with SHOULD NOT).
     doFindTest(*finder, Name("a.dnamewild.example.org."),
-               this->qtype_, this->qtype_, this->rrttl_,
-               ZoneFinder::NXRRSET, this->empty_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_WILDCARD);
+               qtype_, qtype_, rrttl_, ZoneFinder::NXRRSET, empty_rdatas_,
+               empty_rdatas_, ZoneFinder::RESULT_WILDCARD);
 
     // Some strange things in the wild node
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("ns.example.com.");
     doFindTest(*finder, isc::dns::Name("a.nswild.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::NS(),
-               this->rrttl_, ZoneFinder::DELEGATION,
-               this->expected_rdatas_, this->empty_rdatas_,
+               isc::dns::RRType::TXT(), isc::dns::RRType::NS(), rrttl_,
+               ZoneFinder::DELEGATION, expected_rdatas_, empty_rdatas_,
                ZoneFinder::RESULT_WILDCARD);
 }
 
-TYPED_TEST(DatabaseClientTest, noWildcard) {
+TEST_P(DatabaseClientTest, noWildcard) {
     // Tests with the NO_WILDCARD flag.
 
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // This would match *.wild.example.org, but with NO_WILDCARD should
     // result in NXDOMAIN.
-    this->expected_rdatas_.push_back("cancel.here.wild.example.org. A "
-                                     "NSEC RRSIG");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("cancel.here.wild.example.org. A NSEC RRSIG");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("a.wild.example.org"),
-               RRType::NSEC(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXDOMAIN, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               RRType::NSEC(), RRType::NSEC(), rrttl_,
+               ZoneFinder::NXDOMAIN, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
                Name("*.wild.example.org."),
                ZoneFinder::FIND_DNSSEC | ZoneFinder::NO_WILDCARD);
 
     // Should be the same without FIND_DNSSEC (but in this case no RRsets
     // will be returned)
     doFindTest(*finder, isc::dns::Name("a.wild.example.org"),
-               RRType::NSEC(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXDOMAIN, this->empty_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               RRType::NSEC(), RRType::NSEC(), rrttl_, ZoneFinder::NXDOMAIN,
+               empty_rdatas_, empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
                Name::ROOT_NAME(), // name is dummy
                ZoneFinder::NO_WILDCARD);
 
     // Same for wildcard empty non terminal.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("brokenns1.example.org. A NSEC");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("brokenns1.example.org. A NSEC");
     doFindTest(*finder, isc::dns::Name("a.bar.example.org"),
-               RRType::NSEC(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXDOMAIN, this->expected_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               RRType::NSEC(), RRType::NSEC(), rrttl_,
+               ZoneFinder::NXDOMAIN, expected_rdatas_, empty_rdatas_,
+               ZoneFinder::RESULT_NSEC_SIGNED,
                Name("wild.*.foo.*.bar.example.org"),
                ZoneFinder::FIND_DNSSEC | ZoneFinder::NO_WILDCARD);
 
     // Search for a wildcard name with NO_WILDCARD.  There should be no
     // difference.  This is, for example, necessary to provide non existence
     // of matching wildcard for isnx.nonterminal.example.org.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("empty.nonterminal.example.org. NSEC");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("empty.nonterminal.example.org. NSEC");
     doFindTest(*finder, isc::dns::Name("*.nonterminal.example.org"),
-               RRType::NSEC(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXDOMAIN, this->expected_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
-               Name("l.example.org"),
+               RRType::NSEC(), RRType::NSEC(), rrttl_,
+               ZoneFinder::NXDOMAIN, expected_rdatas_, empty_rdatas_,
+               ZoneFinder::RESULT_NSEC_SIGNED, Name("l.example.org"),
                ZoneFinder::FIND_DNSSEC | ZoneFinder::NO_WILDCARD);
 
     // On the other hand, if there's exact match for the wildcard name
     // it should be found regardless of NO_WILDCARD.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.5");
-    this->expected_sig_rdatas_.clear();
-    this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.5");
+    expected_sig_rdatas_.clear();
+    expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("*.wild.example.org"),
-               this->qtype_, this->qtype_, this->rrttl_,
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
+               qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT,
                Name("*.wild.example.org"), ZoneFinder::NO_WILDCARD);
 }
 
-TYPED_TEST(DatabaseClientTest, NXRRSET_NSEC) {
+TEST_P(DatabaseClientTest, NXRRSET_NSEC) {
     // The domain exists, but doesn't have this RRType
     // So we should get its NSEC
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->expected_rdatas_.push_back("www2.example.org. A AAAA NSEC RRSIG");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("www2.example.org. A AAAA NSEC RRSIG");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("www.example.org."),
                isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
-               this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_NSEC_SIGNED, Name::ROOT_NAME(),
-               ZoneFinder::FIND_DNSSEC);
+               rrttl_, ZoneFinder::NXRRSET, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, wildcardNXRRSET_NSEC) {
+TEST_P(DatabaseClientTest, wildcardNXRRSET_NSEC) {
     // The domain exists, but doesn't have this RRType
     // So we should get its NSEC
     //
     // The user will have to query us again to get the correct
     // answer (eg. prove there's not an exact match)
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->expected_rdatas_.push_back("cancel.here.wild.example.org. A NSEC "
-                                     "RRSIG");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    expected_rdatas_.push_back("cancel.here.wild.example.org. A NSEC RRSIG");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     // Note that the NSEC name should NOT be synthesized.
     doFindTest(*finder, isc::dns::Name("a.wild.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
-               this->rrttl_, ZoneFinder::NXRRSET,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
+               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC_SIGNED,
                Name("*.wild.example.org"), ZoneFinder::FIND_DNSSEC);
 }
@@ -2978,7 +2886,7 @@ dnssecFlagCheck(ZoneFinder& finder, ZoneFinder::FindResultFlags sec_flag) {
     dnssecFlagCheckForAny(finder, Name("foo.wild.bar.example.org"), sec_flag);
 }
 
-TYPED_TEST(DatabaseClientTest, dnssecResultFlags) {
+TEST_P(DatabaseClientTest, dnssecResultFlags) {
     // ZoneFinder::find() for negative cases and wildcard cases should check
     // whether the zone is signed with NSEC or NSEC3.
 
@@ -2986,124 +2894,113 @@ TYPED_TEST(DatabaseClientTest, dnssecResultFlags) {
     // (the apex node has an NSEC RR).
     {
         SCOPED_TRACE("NSEC only");
-        dnssecFlagCheck(*this->getFinder(), ZoneFinder::RESULT_NSEC_SIGNED);
+        dnssecFlagCheck(*getFinder(), ZoneFinder::RESULT_NSEC_SIGNED);
     }
 
     // Then add an NSEC3PARAM RRset at the apex (it may look weird if the
     // zone only has NSEC3PARM RRset (but no NSEC3s), but it is okay for the
     // purpose of this test).  The zone should now be considered NSEC3-signed.
     // Note that the apex NSEC still exists; NSEC3 should override NSEC.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_.reset(new RRset(this->zname_, this->qclass_,
-                                 RRType::NSEC3PARAM(), this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "1 0 12 aabbccdd"));
-    this->updater_->addRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_.reset(new RRset(zname_, qclass_, RRType::NSEC3PARAM(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "1 0 12 aabbccdd"));
+    updater_->addRRset(*rrset_);
     {
         SCOPED_TRACE("NSEC and NSEC3");
-        dnssecFlagCheck(this->updater_->getFinder(),
-                        ZoneFinder::RESULT_NSEC3_SIGNED);
+        dnssecFlagCheck(updater_->getFinder(), ZoneFinder::RESULT_NSEC3_SIGNED);
     }
 
     // Next, delete the apex NSEC.  Since NSEC3PARAM remains, the zone should
     // still be considered NSEC3-signed.
-    RRsetPtr nsec_rrset(new RRset(this->zname_, this->qclass_, RRType::NSEC(),
-                                  this->rrttl_));
-    nsec_rrset->addRdata(rdata::createRdata(RRType::NSEC(), this->qclass_,
+    RRsetPtr nsec_rrset(new RRset(zname_, qclass_, RRType::NSEC(), rrttl_));
+    nsec_rrset->addRdata(rdata::createRdata(RRType::NSEC(), qclass_,
                                             "acnamesig1.example.org. NS A "
                                             "NSEC RRSIG"));
-    this->updater_->deleteRRset(*nsec_rrset);
+    updater_->deleteRRset(*nsec_rrset);
     {
         SCOPED_TRACE("NSEC3 only");
-        dnssecFlagCheck(this->updater_->getFinder(),
-                        ZoneFinder::RESULT_NSEC3_SIGNED);
+        dnssecFlagCheck(updater_->getFinder(), ZoneFinder::RESULT_NSEC3_SIGNED);
     }
 
     // Finally, delete the NSEC3PARAM we just added above.  The zone should
     // then be considered unsigned.
-    this->updater_->deleteRRset(*this->rrset_);
+    updater_->deleteRRset(*rrset_);
     {
         SCOPED_TRACE("unsigned");
-        dnssecFlagCheck(this->updater_->getFinder(),
-                        ZoneFinder::RESULT_DEFAULT);
+        dnssecFlagCheck(updater_->getFinder(), ZoneFinder::RESULT_DEFAULT);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, NXDOMAIN_NSEC) {
+TEST_P(DatabaseClientTest, NXDOMAIN_NSEC) {
     // The domain doesn't exist, so we must get the right NSEC
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
-    this->expected_rdatas_.push_back("www2.example.org. A AAAA NSEC RRSIG");
-    this->expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
-                                         "20000201000000 12345 example.org. "
-                                         "FAKEFAKEFAKE");
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
+    expected_rdatas_.push_back("www2.example.org. A AAAA NSEC RRSIG");
+    expected_sig_rdatas_.push_back("NSEC 5 3 3600 20000101000000 "
+                                   "20000201000000 12345 example.org. "
+                                   "FAKEFAKEFAKE");
     doFindTest(*finder, isc::dns::Name("www1.example.org."),
                isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
-               this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_NSEC_SIGNED, Name("www.example.org."),
-               ZoneFinder::FIND_DNSSEC);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("acnamesig1.example.org. NS A NSEC RRSIG");
+               rrttl_, ZoneFinder::NXDOMAIN, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               Name("www.example.org."), ZoneFinder::FIND_DNSSEC);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("acnamesig1.example.org. NS A NSEC RRSIG");
     // This tests it works correctly in apex (there was a bug, where a check
     // for NS-alone was there and it would throw).
     doFindTest(*finder, isc::dns::Name("aa.example.org."),
                isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
-               this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_,
-               ZoneFinder::RESULT_NSEC_SIGNED, Name("example.org."),
-               ZoneFinder::FIND_DNSSEC);
+               rrttl_, ZoneFinder::NXDOMAIN, expected_rdatas_,
+               expected_sig_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               Name("example.org."), ZoneFinder::FIND_DNSSEC);
 
     // Check that if the DB doesn't support it, the exception from there
     // is not propagated and it only does not include the NSEC
-    if (!this->is_mock_) {
+    if (!is_mock_) {
         return; // We don't make the real DB to throw
     }
     // In this case the accessor doesn't support findPreviousName(), but the
     // zone apex has NSEC, and the zone itself is considered NSEC-signed.
     doFindTest(*finder, Name("notimplnsec.example.org."),
-               RRType::TXT(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXDOMAIN, this->empty_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               RRType::TXT(), RRType::NSEC(), rrttl_, ZoneFinder::NXDOMAIN,
+               empty_rdatas_, empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
                Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, emptyNonterminalNSEC) {
+TEST_P(DatabaseClientTest, emptyNonterminalNSEC) {
     // Same as NXDOMAIN_NSEC, but with empty non-terminal
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->expected_rdatas_.push_back("empty.nonterminal.example.org. NSEC");
+    expected_rdatas_.push_back("empty.nonterminal.example.org. NSEC");
     doFindTest(*finder, isc::dns::Name("nonterminal.example.org."),
-               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXRRSET, this->expected_rdatas_,
-               this->expected_sig_rdatas_,
+               isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(), rrttl_,
+               ZoneFinder::NXRRSET, expected_rdatas_, expected_sig_rdatas_,
                ZoneFinder::RESULT_NSEC_SIGNED, Name("l.example.org."),
                ZoneFinder::FIND_DNSSEC);
 
     // Check that if the DB doesn't support it, the exception from there
     // is not propagated and it only does not include the NSEC
-    if (!this->is_mock_) {
+    if (!is_mock_) {
         return; // We don't make the real DB to throw
     }
     // See the corresponding case of NXDOMAIN_NSEC.
     doFindTest(*finder, Name("here.wild.example.org."),
-               RRType::TXT(), RRType::NSEC(), this->rrttl_,
-               ZoneFinder::NXRRSET, this->empty_rdatas_,
-               this->empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
+               RRType::TXT(), RRType::NSEC(), rrttl_, ZoneFinder::NXRRSET,
+               empty_rdatas_, empty_rdatas_, ZoneFinder::RESULT_NSEC_SIGNED,
                Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
 }
 
-TYPED_TEST(DatabaseClientTest, anyFromFind) {
+TEST_P(DatabaseClientTest, anyFromFind) {
     // Find will reject answering an ANY query
-    EXPECT_THROW(this->getFinder()->find(isc::dns::Name("www2.example.org."),
-                                         RRType::ANY()), isc::Unexpected);
+    EXPECT_THROW(getFinder()->find(isc::dns::Name("www2.example.org."),
+                                   RRType::ANY()), isc::Unexpected);
 }
 
-TYPED_TEST(DatabaseClientTest, findRRSIGsWithoutDNSSEC) {
+TEST_P(DatabaseClientTest, findRRSIGsWithoutDNSSEC) {
     // Trying to find RRSIG records directly should work even if
     // FIND_DNSSEC flag is not specified.
 
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
     ConstZoneFinderContextPtr result =
         finder->find(isc::dns::Name("signed1.example.org."), RRType::RRSIG());
 
@@ -3129,9 +3026,9 @@ TYPED_TEST(DatabaseClientTest, findRRSIGsWithoutDNSSEC) {
 }
 
 // Test the findAll method.
-TYPED_TEST(DatabaseClientTest, getAll) {
+TEST_P(DatabaseClientTest, getAll) {
     // The domain doesn't exist, so we must get the right NSEC
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // It should act the same on the "failures"
     std::vector<ConstRRsetPtr> target;
@@ -3142,22 +3039,19 @@ TYPED_TEST(DatabaseClientTest, getAll) {
     EXPECT_EQ(ZoneFinder::NXRRSET,
               finder->findAll(isc::dns::Name("here.wild.example.org."),
                               target)->code);
-    this->expected_rdatas_.push_back("ns.delegation.example.org.");
-    this->expected_rdatas_.push_back("ns.example.com.");
+    expected_rdatas_.push_back("ns.delegation.example.org.");
+    expected_rdatas_.push_back("ns.example.com.");
     doFindAllTestResult(*finder, isc::dns::Name("xx.delegation.example.org."),
-                        ZoneFinder::DELEGATION, RRType::NS(),
-                        this->expected_rdatas_,
+                        ZoneFinder::DELEGATION, RRType::NS(), expected_rdatas_,
                         isc::dns::Name("delegation.example.org."));
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("www.example.org.");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("www.example.org.");
     doFindAllTestResult(*finder, isc::dns::Name("cname.example.org"),
-                        ZoneFinder::CNAME, RRType::CNAME(),
-                        this->expected_rdatas_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("dname.example.com.");
+                        ZoneFinder::CNAME, RRType::CNAME(), expected_rdatas_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("dname.example.com.");
     doFindAllTestResult(*finder, isc::dns::Name("a.dname.example.org"),
-                        ZoneFinder::DNAME, RRType::DNAME(),
-                        this->expected_rdatas_,
+                        ZoneFinder::DNAME, RRType::DNAME(), expected_rdatas_,
                         isc::dns::Name("dname.example.org."));
     // It should get the data on success
     EXPECT_EQ(ZoneFinder::SUCCESS,
@@ -3170,7 +3064,7 @@ TYPED_TEST(DatabaseClientTest, getAll) {
     size_t count(0);
     for (RdataIteratorPtr it(target[a_idx]->getRdataIterator());
          !it->isLast(); it->next()) {
-        count ++;
+        ++count;
         EXPECT_NE(previous, it->getCurrent().toText());
         EXPECT_TRUE(it->getCurrent().toText() == "192.0.2.1" ||
                     it->getCurrent().toText() == "192.0.2.2");
@@ -3204,8 +3098,8 @@ TYPED_TEST(DatabaseClientTest, getAll) {
     ConstRRsetPtr sig(target[a_idx]->getRRsig());
     ASSERT_TRUE(sig);
     EXPECT_EQ(RRType::RRSIG(), sig->getType());
-    EXPECT_EQ("A 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE",
-              sig->getRdataIterator()->getCurrent().toText());
+    EXPECT_EQ("A 5 3 3600 20000101000000 20000201000000 12345 example.org. "
+              "FAKEFAKEFAKE", sig->getRdataIterator()->getCurrent().toText());
     EXPECT_EQ(RRType::NSEC(), target[1 - a_idx]->getType());
     it = target[1 - a_idx]->getRdataIterator();
     ASSERT_FALSE(it->isLast());
@@ -3216,171 +3110,159 @@ TYPED_TEST(DatabaseClientTest, getAll) {
     sig = target[1 - a_idx]->getRRsig();
     ASSERT_TRUE(sig);
     EXPECT_EQ(RRType::RRSIG(), sig->getType());
-    EXPECT_EQ("NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. FAKEFAKEFAKE",
-              sig->getRdataIterator()->getCurrent().toText());
+    EXPECT_EQ("NSEC 5 3 3600 20000101000000 20000201000000 12345 example.org. "
+              "FAKEFAKEFAKE", sig->getRdataIterator()->getCurrent().toText());
 }
 
-TYPED_TEST(DatabaseClientTest, getOrigin) {
-    DataSourceClient::FindResult
-        zone(this->client_->findZone(Name("example.org")));
-    ASSERT_EQ(result::SUCCESS, zone.code);
+TEST_P(DatabaseClientTest, getOrigin) {
+    const DataSourceClient::FindResult result =
+        client_->findZone(Name("example.org"));
+    ASSERT_EQ(result::SUCCESS, result.code);
     boost::shared_ptr<DatabaseClient::Finder> finder(
-        dynamic_pointer_cast<DatabaseClient::Finder>(zone.zone_finder));
-    if (this->is_mock_) {
+        dynamic_pointer_cast<DatabaseClient::Finder>(result.zone_finder));
+    if (is_mock_) {
         EXPECT_EQ(READONLY_ZONE_ID, finder->zone_id());
     }
-    EXPECT_EQ(this->zname_, finder->getOrigin());
+    EXPECT_EQ(zname_, finder->getOrigin());
 }
 
-TYPED_TEST(DatabaseClientTest, updaterFinder) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    ASSERT_TRUE(this->updater_);
+TEST_P(DatabaseClientTest, updaterFinder) {
+    updater_ = client_->getUpdater(zname_, false);
+    ASSERT_TRUE(updater_);
 
     // If this update isn't replacing the zone, the finder should work
     // just like the normal find() case.
-    if (this->is_mock_) {
+    if (is_mock_) {
         DatabaseClient::Finder& finder = dynamic_cast<DatabaseClient::Finder&>(
-            this->updater_->getFinder());
+            updater_->getFinder());
         EXPECT_EQ(WRITABLE_ZONE_ID, finder.zone_id());
     }
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    doFindTest(this->updater_->getFinder(), this->qname_,
-               this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->empty_rdatas_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // When replacing the zone, the updater's finder shouldn't see anything
     // in the zone until something is added.
-    this->updater_.reset();
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    ASSERT_TRUE(this->updater_);
-    if (this->is_mock_) {
+    updater_.reset();
+    updater_ = client_->getUpdater(zname_, true);
+    ASSERT_TRUE(updater_);
+    if (is_mock_) {
         DatabaseClient::Finder& finder = dynamic_cast<DatabaseClient::Finder&>(
-            this->updater_->getFinder());
+            updater_->getFinder());
         EXPECT_EQ(WRITABLE_ZONE_ID, finder.zone_id());
     }
-    doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->empty_rdatas_, this->empty_rdatas_);
+    doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+               ZoneFinder::NXDOMAIN, empty_rdatas_, empty_rdatas_);
 }
 
-TYPED_TEST(DatabaseClientTest, flushZone) {
+TEST_P(DatabaseClientTest, flushZone) {
     // A simple update case: flush the entire zone
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     // Before update, the name exists.
-    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(this->qname_,
-                                                this->qtype_)->code);
+    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(qname_, qtype_)->code);
 
     // start update in the replace mode.  the normal finder should still
     // be able to see the record, but the updater's finder shouldn't.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->setUpdateAccessor();
-    EXPECT_EQ(ZoneFinder::SUCCESS,
-              finder->find(this->qname_, this->qtype_)->code);
+    updater_ = client_->getUpdater(zname_, true);
+    setUpdateAccessor();
+    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(qname_, qtype_)->code);
     EXPECT_EQ(ZoneFinder::NXDOMAIN,
-              this->updater_->getFinder().find(this->qname_,
-                                               this->qtype_)->code);
+              updater_->getFinder().find(qname_, qtype_)->code);
 
     // commit the update.  now the normal finder shouldn't see it.
-    this->updater_->commit();
-    EXPECT_EQ(ZoneFinder::NXDOMAIN, finder->find(this->qname_,
-                                                 this->qtype_)->code);
+    updater_->commit();
+    EXPECT_EQ(ZoneFinder::NXDOMAIN, finder->find(qname_, qtype_)->code);
 
     // Check rollback wasn't accidentally performed.
-    EXPECT_FALSE(this->isRollbacked());
+    EXPECT_FALSE(isRollbacked());
 }
 
-TYPED_TEST(DatabaseClientTest, updateCancel) {
+TEST_P(DatabaseClientTest, updateCancel) {
     // similar to the previous test, but destruct the updater before commit.
 
-    ZoneFinderPtr finder = this->client_->findZone(this->zname_).zone_finder;
-    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(this->qname_,
-                                                this->qtype_)->code);
+    ZoneFinderPtr finder = client_->findZone(zname_).zone_finder;
+    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(qname_, qtype_)->code);
 
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->setUpdateAccessor();
+    updater_ = client_->getUpdater(zname_, true);
+    setUpdateAccessor();
     EXPECT_EQ(ZoneFinder::NXDOMAIN,
-              this->updater_->getFinder().find(this->qname_,
-                                               this->qtype_)->code);
+              updater_->getFinder().find(qname_, qtype_)->code);
     // DB should not have been rolled back yet.
-    EXPECT_FALSE(this->isRollbacked());
-    this->updater_.reset();            // destruct without commit
+    EXPECT_FALSE(isRollbacked());
+    updater_.reset();            // destruct without commit
 
     // reset() should have triggered rollback (although it doesn't affect
     // anything to the mock accessor implementation except for the result of
     // isRollbacked())
-    EXPECT_TRUE(this->isRollbacked(true));
-    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(this->qname_,
-                                                this->qtype_)->code);
+    EXPECT_TRUE(isRollbacked(true));
+    EXPECT_EQ(ZoneFinder::SUCCESS, finder->find(qname_, qtype_)->code);
 }
 
-TYPED_TEST(DatabaseClientTest, exceptionFromRollback) {
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
+TEST_P(DatabaseClientTest, exceptionFromRollback) {
+    updater_ = client_->getUpdater(zname_, true);
 
-    this->rrset_.reset(new RRset(Name("throw.example.org"), this->qclass_,
-                                 this->qtype_, this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.1"));
-    this->updater_->addRRset(*this->rrset_);
+    rrset_.reset(new RRset(Name("throw.example.org"), qclass_,
+                                 qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.1"));
+    updater_->addRRset(*rrset_);
     // destruct without commit.  The added name will result in an exception
     // in the MockAccessor's rollback method.  It shouldn't be propagated.
-    EXPECT_NO_THROW(this->updater_.reset());
+    EXPECT_NO_THROW(updater_.reset());
 }
 
-TYPED_TEST(DatabaseClientTest, duplicateCommit) {
+TEST_P(DatabaseClientTest, duplicateCommit) {
     // duplicate commit.  should result in exception.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->commit();
-    EXPECT_THROW(this->updater_->commit(), DataSourceError);
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->commit();
+    EXPECT_THROW(updater_->commit(), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, addRRsetToNewZone) {
+TEST_P(DatabaseClientTest, addRRsetToNewZone) {
     // Add a single RRset to a fresh empty zone
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->addRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->addRRset(*rrset_);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.2");
     {
         SCOPED_TRACE("add RRset");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 
     // Similar to the previous case, but with RRSIG
-    this->updater_.reset();
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
-    this->updater_->addRRset(*this->rrset_);
-    this->updater_->addRRset(*this->rrsigset_);
+    updater_.reset();
+    updater_ = client_->getUpdater(zname_, true);
+    updater_->addRRset(*rrset_);
+    updater_->addRRset(*rrsigset_);
 
     // confirm the expected columns were passed to the accessor (if checkable).
     const char* const rrsig_added[] = {
         "www.example.org.", "org.example.www.", "3600", "RRSIG", "A",
         "A 5 3 0 20000101000000 20000201000000 0 example.org. FAKEFAKEFAKE"
     };
-    this->checkLastAdded(rrsig_added);
+    checkLastAdded(rrsig_added);
 
-    this->expected_sig_rdatas_.clear();
-    this->expected_sig_rdatas_.push_back(
-        rrsig_added[DatabaseAccessor::ADD_RDATA]);
+    expected_sig_rdatas_.clear();
+    expected_sig_rdatas_.push_back(rrsig_added[DatabaseAccessor::ADD_RDATA]);
     {
         SCOPED_TRACE("add RRset with RRSIG");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->expected_sig_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_,
+                   expected_sig_rdatas_);
     }
 
     // Add the non RRSIG RRset again, to see the attempt of adding RRSIG
     // causes any unexpected effect, in particular, whether the SIGTYPE
     // field might remain.
-    this->updater_->addRRset(*this->rrset_);
+    updater_->addRRset(*rrset_);
     const char* const rrset_added[] = {
         "www.example.org.", "org.example.www.", "3600", "A", "", "192.0.2.2"
     };
-    this->checkLastAdded(rrset_added);
+    checkLastAdded(rrset_added);
 }
 
 //
@@ -3425,31 +3307,30 @@ nsec3Check(const vector<ConstRRsetPtr>& expected_rrsets,
                 actual_rrsets.begin(), actual_rrsets.end());
 }
 
-TYPED_TEST(DatabaseClientTest, addDeleteNSEC3InZone) {
+TEST_P(DatabaseClientTest, addDeleteNSEC3InZone) {
     // Add one NSEC3 RR to the zone, delete it, and add another one.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
+    updater_ = client_->getUpdater(zname_, true);
     const ConstRRsetPtr nsec3_rrset =
         textToRRset(string(nsec3_hash) + ".example.org. 3600 IN NSEC3 " +
                     string(nsec3_rdata));
     const ConstRRsetPtr nsec3_rrset2 =
         textToRRset(string(nsec3_hash) + ".example.org. 3600 IN NSEC3 " +
                     string(nsec3_rdata2));
-    this->updater_->addRRset(*nsec3_rrset);
-    this->updater_->deleteRRset(*nsec3_rrset);
-    this->updater_->addRRset(*nsec3_rrset2);
-    this->updater_->commit();
+    updater_->addRRset(*nsec3_rrset);
+    updater_->deleteRRset(*nsec3_rrset);
+    updater_->addRRset(*nsec3_rrset2);
+    updater_->commit();
 
     // Check if we can get the expected record.
     vector<ConstRRsetPtr> expected_rrsets;
     expected_rrsets.push_back(nsec3_rrset2);
-    nsec3Check(expected_rrsets, this->zname_, nsec3_hash,
-               *this->current_accessor_);
+    nsec3Check(expected_rrsets, zname_, nsec3_hash, *current_accessor_);
 }
 
-TYPED_TEST(DatabaseClientTest, addDeleteNSEC3AndRRSIGToZone) {
+TEST_P(DatabaseClientTest, addDeleteNSEC3AndRRSIGToZone) {
     // Add one NSEC3 RR and its RRSIG to the zone, delete the RRSIG and add
     // a new one.
-    this->updater_ = this->client_->getUpdater(this->zname_, true);
+    updater_ = client_->getUpdater(zname_, true);
     const ConstRRsetPtr nsec3_rrset =
         textToRRset(string(nsec3_hash) + ".example.org. 3600 IN NSEC3 " +
                     string(nsec3_rdata));
@@ -3459,471 +3340,413 @@ TYPED_TEST(DatabaseClientTest, addDeleteNSEC3AndRRSIGToZone) {
     const ConstRRsetPtr nsec3_sig_rrset2 =
         textToRRset(string(nsec3_hash) + ".example.org. 3600 IN RRSIG " +
                     string(nsec3_sig_rdata2));
-    this->updater_->addRRset(*nsec3_rrset);
-    this->updater_->addRRset(*nsec3_sig_rrset);
-    this->updater_->deleteRRset(*nsec3_sig_rrset);
-    this->updater_->addRRset(*nsec3_sig_rrset2);
-    this->updater_->commit();
+    updater_->addRRset(*nsec3_rrset);
+    updater_->addRRset(*nsec3_sig_rrset);
+    updater_->deleteRRset(*nsec3_sig_rrset);
+    updater_->addRRset(*nsec3_sig_rrset2);
+    updater_->commit();
 
     // Check if we can get the expected record.
     vector<ConstRRsetPtr> expected_rrsets;
     expected_rrsets.push_back(nsec3_rrset);
     expected_rrsets.push_back(nsec3_sig_rrset2);
-    nsec3Check(expected_rrsets, this->zname_, nsec3_hash,
-               *this->current_accessor_);
+    nsec3Check(expected_rrsets, zname_, nsec3_hash, *current_accessor_);
 }
 
-TYPED_TEST(DatabaseClientTest, addRRsetToCurrentZone) {
+TEST_P(DatabaseClientTest, addRRsetToCurrentZone) {
     // Similar to the previous test, but not replacing the existing data.
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->addRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->addRRset(*rrset_);
 
     // We should see both old and new data.
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     {
         SCOPED_TRACE("add RRset");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
-    this->updater_->commit();
+    updater_->commit();
     {
         SCOPED_TRACE("add RRset after commit");
-        doFindTest(*finder, this->qname_, this->qtype_, this->qtype_,
-                   this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-                   this->empty_rdatas_);
+        doFindTest(*finder, qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addMultipleRRs) {
+TEST_P(DatabaseClientTest, addMultipleRRs) {
     // Similar to the previous case, but the added RRset contains multiple
     // RRs.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.3"));
-    this->updater_->addRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
-    this->expected_rdatas_.push_back("192.0.2.3");
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.3"));
+    updater_->addRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.push_back("192.0.2.3");
     {
         SCOPED_TRACE("add multiple RRs");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addRRsetOfLargerTTL) {
+TEST_P(DatabaseClientTest, addRRsetOfLargerTTL) {
     // Similar to the previous one, but the TTL of the added RRset is larger
     // than that of the existing record.  The finder should use the smaller
     // one.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_->setTTL(RRTTL(7200));
-    this->updater_->addRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_->setTTL(RRTTL(7200));
+    updater_->addRRset(*rrset_);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     {
         SCOPED_TRACE("add RRset of larger TTL");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addRRsetOfSmallerTTL) {
+TEST_P(DatabaseClientTest, addRRsetOfSmallerTTL) {
     // Similar to the previous one, but the added RRset has a smaller TTL.
     // The added TTL should be used by the finder.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_->setTTL(RRTTL(1800));
-    this->updater_->addRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_->setTTL(RRTTL(1800));
+    updater_->addRRset(*rrset_);
 
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
     {
         SCOPED_TRACE("add RRset of smaller TTL");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, RRTTL(1800), ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, RRTTL(1800),
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addSameRR) {
+TEST_P(DatabaseClientTest, addSameRR) {
     // Add the same RR as that is already in the data source.
     // Currently the add interface doesn't try to suppress the duplicate,
     // neither does the finder.  We may want to revisit it in future versions.
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, this->qtype_,
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.1"));
-    this->updater_->addRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.1");
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.1"));
+    updater_->addRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.1");
     {
         SCOPED_TRACE("add same RR");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addDeviantRR) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
+TEST_P(DatabaseClientTest, addDeviantRR) {
+    updater_ = client_->getUpdater(zname_, false);
 
     // RR class mismatch.  This should be detected and rejected.
-    this->rrset_.reset(new RRset(this->qname_, RRClass::CH(), RRType::TXT(),
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "test text"));
-    EXPECT_THROW(this->updater_->addRRset(*this->rrset_), DataSourceError);
+    rrset_.reset(new RRset(qname_, RRClass::CH(), RRType::TXT(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "test text"));
+    EXPECT_THROW(updater_->addRRset(*rrset_), DataSourceError);
 
     // Out-of-zone owner name.  At a higher level this should be rejected,
     // but it doesn't happen in this interface.
-    this->rrset_.reset(new RRset(Name("example.com"), this->qclass_,
-                                 this->qtype_, this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.100"));
-    this->updater_->addRRset(*this->rrset_);
-
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.100");
+    rrset_.reset(new RRset(Name("example.com"), qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.100"));
+    updater_->addRRset(*rrset_);
+
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.100");
     {
         // Note: find() rejects out-of-zone query name with an exception
         // regardless of whether adding the RR succeeded, so this check
         // actually doesn't confirm it.
         SCOPED_TRACE("add out-of-zone RR");
-        EXPECT_THROW(this->updater_->getFinder().find(Name("example.com"),
-                                                      this->qtype_),
+        EXPECT_THROW(updater_->getFinder().find(Name("example.com"), qtype_),
                      OutOfZone);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, addEmptyRRset) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, this->qtype_,
-                                 this->rrttl_));
-    EXPECT_THROW(this->updater_->addRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, addEmptyRRset) {
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
+    EXPECT_THROW(updater_->addRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, addAfterCommit) {
-   this->updater_ = this->client_->getUpdater(this->zname_, false);
-   this->updater_->commit();
-   EXPECT_THROW(this->updater_->addRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, addAfterCommit) {
+   updater_ = client_->getUpdater(zname_, false);
+   updater_->commit();
+   EXPECT_THROW(updater_->addRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, addRRsetWithRRSIG) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_->addRRsig(*this->rrsigset_);
-    EXPECT_THROW(this->updater_->addRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, addRRsetWithRRSIG) {
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_->addRRsig(*rrsigset_);
+    EXPECT_THROW(updater_->addRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, deleteRRset) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, deleteRRset) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, this->qtype_,
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.1"));
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.1"));
 
     // Delete one RR from an RRset
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
 
     // Delete the only RR of a name
-    this->rrset_.reset(new RRset(Name("cname.example.org"), this->qclass_,
-                          RRType::CNAME(), this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "www.example.org."));
-    this->updater_->deleteRRset(*this->rrset_);
-
-    // The this->updater_ finder should immediately see the deleted results.
+    rrset_.reset(new RRset(Name("cname.example.org"), qclass_,
+                           RRType::CNAME(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "www.example.org."));
+    updater_->deleteRRset(*rrset_);
+
+    // The updater_ finder should immediately see the deleted results.
     {
         SCOPED_TRACE("delete RRset");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-                   this->empty_rdatas_, this->empty_rdatas_);
-        doFindTest(this->updater_->getFinder(), Name("cname.example.org"),
-                   this->qtype_, this->qtype_, this->rrttl_,
-                   ZoneFinder::NXDOMAIN, this->empty_rdatas_,
-                   this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::NXRRSET, empty_rdatas_, empty_rdatas_);
+        doFindTest(updater_->getFinder(), Name("cname.example.org"),
+                   qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN, empty_rdatas_,
+                   empty_rdatas_);
     }
 
     // before committing the change, the original finder should see the
     // original record.
     {
         SCOPED_TRACE("delete RRset before commit");
-        this->expected_rdatas_.push_back("192.0.2.1");
-        doFindTest(*finder, this->qname_, this->qtype_, this->qtype_,
-                   this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-                   this->empty_rdatas_);
-
-        this->expected_rdatas_.clear();
-        this->expected_rdatas_.push_back("www.example.org.");
-        doFindTest(*finder, Name("cname.example.org"), this->qtype_,
-                   RRType::CNAME(), this->rrttl_, ZoneFinder::CNAME,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        expected_rdatas_.push_back("192.0.2.1");
+        doFindTest(*finder, qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
+
+        expected_rdatas_.clear();
+        expected_rdatas_.push_back("www.example.org.");
+        doFindTest(*finder, Name("cname.example.org"), qtype_, RRType::CNAME(),
+                   rrttl_, ZoneFinder::CNAME, expected_rdatas_, empty_rdatas_);
     }
 
     // once committed, the record should be removed from the original finder's
     // view, too.
-    this->updater_->commit();
+    updater_->commit();
     {
         SCOPED_TRACE("delete RRset after commit");
-        doFindTest(*finder, this->qname_, this->qtype_, this->qtype_,
-                   this->rrttl_, ZoneFinder::NXRRSET, this->empty_rdatas_,
-                   this->empty_rdatas_);
-        doFindTest(*finder, Name("cname.example.org"), this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
-                   this->empty_rdatas_, this->empty_rdatas_);
+        doFindTest(*finder, qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::NXRRSET, empty_rdatas_, empty_rdatas_);
+        doFindTest(*finder, Name("cname.example.org"), qtype_, qtype_, rrttl_,
+                   ZoneFinder::NXDOMAIN, empty_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, deleteRRsetToNXDOMAIN) {
+TEST_P(DatabaseClientTest, deleteRRsetToNXDOMAIN) {
     // similar to the previous case, but it removes the only record of the
     // given name.  a subsequent find() should result in NXDOMAIN.
-    this->rrset_.reset(new RRset(Name("cname.example.org"), this->qclass_,
-                           RRType::CNAME(), this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "www.example.org."));
-
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    rrset_.reset(new RRset(Name("cname.example.org"), qclass_,
+                           RRType::CNAME(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "www.example.org."));
+
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
     {
         SCOPED_TRACE("delete RRset to NXDOMAIN");
-        doFindTest(this->updater_->getFinder(), Name("cname.example.org"),
-                   this->qtype_, this->qtype_, this->rrttl_,
-                   ZoneFinder::NXDOMAIN, this->empty_rdatas_,
-                   this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), Name("cname.example.org"),
+                   qtype_, qtype_, rrttl_, ZoneFinder::NXDOMAIN, empty_rdatas_,
+                   empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, deleteMultipleRRs) {
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, RRType::AAAA(),
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::1"));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::2"));
+TEST_P(DatabaseClientTest, deleteMultipleRRs) {
+    rrset_.reset(new RRset(qname_, qclass_, RRType::AAAA(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::1"));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::2"));
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
 
     {
         SCOPED_TRACE("delete multiple RRs");
-        doFindTest(this->updater_->getFinder(), this->qname_, RRType::AAAA(),
-                   this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-                   this->empty_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, RRType::AAAA(),
+                   qtype_, rrttl_, ZoneFinder::NXRRSET,
+                   empty_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, partialDelete) {
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, RRType::AAAA(),
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::1"));
+TEST_P(DatabaseClientTest, partialDelete) {
+    rrset_.reset(new RRset(qname_, qclass_, RRType::AAAA(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::1"));
     // This does not exist in the test data source:
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::3"));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::3"));
 
     // deleteRRset should succeed "silently", and subsequent find() should
     // find the remaining RR.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
     {
         SCOPED_TRACE("partial delete");
-        this->expected_rdatas_.push_back("2001:db8::2");
-        doFindTest(this->updater_->getFinder(), this->qname_, RRType::AAAA(),
-                   RRType::AAAA(), this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        expected_rdatas_.push_back("2001:db8::2");
+        doFindTest(updater_->getFinder(), qname_, RRType::AAAA(),
+                   RRType::AAAA(), rrttl_, ZoneFinder::SUCCESS,
+                   expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, deleteNoMatch) {
+TEST_P(DatabaseClientTest, deleteNoMatch) {
     // similar to the previous test, but there's not even a match in the
     // specified RRset.  Essentially there's no difference in the result.
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
     {
         SCOPED_TRACE("delete no match");
-        this->expected_rdatas_.push_back("192.0.2.1");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-                   this->expected_rdatas_, this->empty_rdatas_);
+        expected_rdatas_.push_back("192.0.2.1");
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, deleteWithDifferentTTL) {
+TEST_P(DatabaseClientTest, deleteWithDifferentTTL) {
     // Our delete interface simply ignores TTL (may change in a future version)
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, this->qtype_,
-                                 RRTTL(1800)));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.1"));
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->deleteRRset(*this->rrset_);
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, RRTTL(1800)));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.1"));
+    updater_ = client_->getUpdater(zname_, false);
+    updater_->deleteRRset(*rrset_);
     {
         SCOPED_TRACE("delete RRset with a different TTL");
-        doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-                   this->qtype_, this->rrttl_, ZoneFinder::NXRRSET,
-                   this->empty_rdatas_, this->empty_rdatas_);
+        doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+                   ZoneFinder::NXRRSET, empty_rdatas_, empty_rdatas_);
     }
 }
 
-TYPED_TEST(DatabaseClientTest, deleteDeviantRR) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
+TEST_P(DatabaseClientTest, deleteDeviantRR) {
+    updater_ = client_->getUpdater(zname_, false);
 
     // RR class mismatch.  This should be detected and rejected.
-    this->rrset_.reset(new RRset(this->qname_, RRClass::CH(), RRType::TXT(),
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "test text"));
-    EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_), DataSourceError);
+    rrset_.reset(new RRset(qname_, RRClass::CH(), RRType::TXT(), rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "test text"));
+    EXPECT_THROW(updater_->deleteRRset(*rrset_), DataSourceError);
 
     // Out-of-zone owner name.  At a higher level this should be rejected,
     // but it doesn't happen in this interface.
-    this->rrset_.reset(new RRset(Name("example.com"), this->qclass_,
-                                 this->qtype_, this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.100"));
-    EXPECT_NO_THROW(this->updater_->deleteRRset(*this->rrset_));
+    rrset_.reset(new RRset(Name("example.com"), qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.100"));
+    EXPECT_NO_THROW(updater_->deleteRRset(*rrset_));
 }
 
-TYPED_TEST(DatabaseClientTest, deleteAfterCommit) {
-   this->updater_ = this->client_->getUpdater(this->zname_, false);
-   this->updater_->commit();
-   EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, deleteAfterCommit) {
+   updater_ = client_->getUpdater(zname_, false);
+   updater_->commit();
+   EXPECT_THROW(updater_->deleteRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, deleteEmptyRRset) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_.reset(new RRset(this->qname_, this->qclass_, this->qtype_,
-                                 this->rrttl_));
-    EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, deleteEmptyRRset) {
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_.reset(new RRset(qname_, qclass_, qtype_, rrttl_));
+    EXPECT_THROW(updater_->deleteRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, deleteRRsetWithRRSIG) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->rrset_->addRRsig(*this->rrsigset_);
-    EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_), DataSourceError);
+TEST_P(DatabaseClientTest, deleteRRsetWithRRSIG) {
+    updater_ = client_->getUpdater(zname_, false);
+    rrset_->addRRsig(*rrsigset_);
+    EXPECT_THROW(updater_->deleteRRset(*rrset_), DataSourceError);
 }
 
-TYPED_TEST(DatabaseClientTest, compoundUpdate) {
+TEST_P(DatabaseClientTest, compoundUpdate) {
     // This test case performs an arbitrary chosen add/delete operations
     // in a single update transaction.  Essentially there is nothing new to
     // test here, but there may be some bugs that was overlooked and can
     // only happen in the compound update scenario, so we test it.
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
+    updater_ = client_->getUpdater(zname_, false);
 
     // add a new RR to an existing RRset
-    this->updater_->addRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.1");
-    this->expected_rdatas_.push_back("192.0.2.2");
-    doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->empty_rdatas_);
+    updater_->addRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.1");
+    expected_rdatas_.push_back("192.0.2.2");
+    doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // delete an existing RR
-    this->rrset_.reset(new RRset(Name("www.example.org"), this->qclass_,
-                                 this->qtype_, this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "192.0.2.1"));
-    this->updater_->deleteRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.2");
-    doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->empty_rdatas_);
+    rrset_.reset(new RRset(Name("www.example.org"), qclass_, qtype_, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "192.0.2.1"));
+    updater_->deleteRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.2");
+    doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // re-add it
-    this->updater_->addRRset(*this->rrset_);
-    this->expected_rdatas_.push_back("192.0.2.1");
-    doFindTest(this->updater_->getFinder(), this->qname_, this->qtype_,
-               this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
-               this->expected_rdatas_, this->empty_rdatas_);
+    updater_->addRRset(*rrset_);
+    expected_rdatas_.push_back("192.0.2.1");
+    doFindTest(updater_->getFinder(), qname_, qtype_, qtype_, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // add a new RR with a new name
     const Name newname("newname.example.org");
     const RRType newtype(RRType::AAAA());
-    doFindTest(this->updater_->getFinder(), newname, newtype, newtype,
-               this->rrttl_, ZoneFinder::NXDOMAIN, this->empty_rdatas_,
-               this->empty_rdatas_);
-    this->rrset_.reset(new RRset(newname, this->qclass_, newtype,
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::10"));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::11"));
-    this->updater_->addRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::10");
-    this->expected_rdatas_.push_back("2001:db8::11");
-    doFindTest(this->updater_->getFinder(), newname, newtype, newtype,
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->empty_rdatas_);
+    doFindTest(updater_->getFinder(), newname, newtype, newtype, rrttl_,
+               ZoneFinder::NXDOMAIN, empty_rdatas_, empty_rdatas_);
+    rrset_.reset(new RRset(newname, qclass_, newtype, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::10"));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::11"));
+    updater_->addRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::10");
+    expected_rdatas_.push_back("2001:db8::11");
+    doFindTest(updater_->getFinder(), newname, newtype, newtype, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // delete one RR from the previous set
-    this->rrset_.reset(new RRset(newname, this->qclass_, newtype,
-                                 this->rrttl_));
-    this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
-                                              this->rrset_->getClass(),
-                                              "2001:db8::11"));
-    this->updater_->deleteRRset(*this->rrset_);
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::10");
-    doFindTest(this->updater_->getFinder(), newname, newtype, newtype,
-               this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->empty_rdatas_);
+    rrset_.reset(new RRset(newname, qclass_, newtype, rrttl_));
+    rrset_->addRdata(rdata::createRdata(rrset_->getType(), rrset_->getClass(),
+                                        "2001:db8::11"));
+    updater_->deleteRRset(*rrset_);
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::10");
+    doFindTest(updater_->getFinder(), newname, newtype, newtype, rrttl_,
+               ZoneFinder::SUCCESS, expected_rdatas_, empty_rdatas_);
 
     // Commit the changes, confirm the entire changes applied.
-    this->updater_->commit();
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("192.0.2.2");
-    this->expected_rdatas_.push_back("192.0.2.1");
-    doFindTest(*finder, this->qname_, this->qtype_, this->qtype_, this->rrttl_,
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->empty_rdatas_);
-
-    this->expected_rdatas_.clear();
-    this->expected_rdatas_.push_back("2001:db8::10");
-    doFindTest(*finder, newname, newtype, newtype, this->rrttl_,
-               ZoneFinder::SUCCESS, this->expected_rdatas_,
-               this->empty_rdatas_);
+    updater_->commit();
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("192.0.2.2");
+    expected_rdatas_.push_back("192.0.2.1");
+    doFindTest(*finder, qname_, qtype_, qtype_, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, empty_rdatas_);
+
+    expected_rdatas_.clear();
+    expected_rdatas_.push_back("2001:db8::10");
+    doFindTest(*finder, newname, newtype, newtype, rrttl_, ZoneFinder::SUCCESS,
+               expected_rdatas_, empty_rdatas_);
 }
 
-TYPED_TEST(DatabaseClientTest, invalidRdata) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+TEST_P(DatabaseClientTest, invalidRdata) {
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
-    EXPECT_THROW(finder->find(Name("invalidrdata.example.org."),
-                              RRType::A()),
+    EXPECT_THROW(finder->find(Name("invalidrdata.example.org."), RRType::A()),
                  DataSourceError);
     EXPECT_THROW(finder->find(Name("invalidrdata2.example.org."),
                               RRType::A(), ZoneFinder::FIND_DNSSEC),
@@ -3931,7 +3754,7 @@ TYPED_TEST(DatabaseClientTest, invalidRdata) {
 }
 
 TEST_F(MockDatabaseClientTest, missingNSEC) {
-    boost::shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
+    boost::shared_ptr<DatabaseClient::Finder> finder(getFinder());
 
     /*
      * FIXME: For now, we can't really distinguish this bogus input
@@ -3944,27 +3767,24 @@ TEST_F(MockDatabaseClientTest, missingNSEC) {
                  DataSourceError);
 #endif
     doFindTest(*finder, Name("badnsec2.example.org."), RRType::A(),
-               RRType::A(), this->rrttl_, ZoneFinder::NXDOMAIN,
-               this->expected_rdatas_, this->expected_sig_rdatas_);
+               RRType::A(), rrttl_, ZoneFinder::NXDOMAIN,
+               expected_rdatas_, expected_sig_rdatas_);
 }
 
 /*
  * Test correct use of the updater with a journal.
  */
-TYPED_TEST(DatabaseClientTest, journal) {
-    this->updater_ = this->client_->getUpdater(this->zname_, false, true);
-    this->updater_->deleteRRset(*this->soa_);
-    this->updater_->deleteRRset(*this->rrset_);
-    this->soa_.reset(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                               this->rrttl_));
-    this->soa_->addRdata(rdata::createRdata(this->soa_->getType(),
-                                            this->soa_->getClass(),
-                                            "ns1.example.org. "
-                                            "admin.example.org. "
-                                            "1235 3600 1800 2419200 7200"));
-    this->updater_->addRRset(*this->soa_);
-    this->updater_->addRRset(*this->rrset_);
-    ASSERT_NO_THROW(this->updater_->commit());
+TEST_P(DatabaseClientTest, journal) {
+    updater_ = client_->getUpdater(zname_, false, true);
+    updater_->deleteRRset(*soa_);
+    updater_->deleteRRset(*rrset_);
+    soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
+                                      "ns1.example.org. admin.example.org. "
+                                      "1235 3600 1800 2419200 7200"));
+    updater_->addRRset(*soa_);
+    updater_->addRRset(*rrset_);
+    ASSERT_NO_THROW(updater_->commit());
     std::vector<JournalEntry> expected;
     expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234,
                                     DatabaseAccessor::DIFF_DELETE,
@@ -3984,30 +3804,27 @@ TYPED_TEST(DatabaseClientTest, journal) {
                                     DatabaseAccessor::DIFF_ADD,
                                     "www.example.org.", "A", "3600",
                                     "192.0.2.2"));
-    this->checkJournal(expected);
+    checkJournal(expected);
 }
 
-TYPED_TEST(DatabaseClientTest, journalForNSEC3) {
+TEST_P(DatabaseClientTest, journalForNSEC3) {
     // Similar to the previous test, but adding/deleting NSEC3 RRs, just to
     // confirm that NSEC3 is not special for managing diffs.
     const ConstRRsetPtr nsec3_rrset =
         textToRRset(string(nsec3_hash) + ".example.org. 3600 IN NSEC3 " +
                     string(nsec3_rdata));
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false, true);
-    this->updater_->deleteRRset(*this->soa_);
-    this->updater_->deleteRRset(*nsec3_rrset);
-
-    this->soa_.reset(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                               this->rrttl_));
-    this->soa_->addRdata(rdata::createRdata(this->soa_->getType(),
-                                            this->soa_->getClass(),
-                                            "ns1.example.org. "
-                                            "admin.example.org. "
-                                            "1235 3600 1800 2419200 7200"));
-    this->updater_->addRRset(*this->soa_);
-    this->updater_->addRRset(*nsec3_rrset);
-    this->updater_->commit();
+    updater_ = client_->getUpdater(zname_, false, true);
+    updater_->deleteRRset(*soa_);
+    updater_->deleteRRset(*nsec3_rrset);
+
+    soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+    soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
+                                      "ns1.example.org. admin.example.org. "
+                                      "1235 3600 1800 2419200 7200"));
+    updater_->addRRset(*soa_);
+    updater_->addRRset(*nsec3_rrset);
+    updater_->commit();
     std::vector<JournalEntry> expected;
     expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234,
                                     DatabaseAccessor::DIFF_DELETE,
@@ -4027,21 +3844,21 @@ TYPED_TEST(DatabaseClientTest, journalForNSEC3) {
                                     DatabaseAccessor::DIFF_ADD,
                                     string(nsec3_hash) + ".example.org.",
                                     "NSEC3", "3600", nsec3_rdata));
-    this->checkJournal(expected);
+    checkJournal(expected);
 }
 
 /*
  * Push multiple delete-add sequences. Checks it is allowed and all is
  * saved.
  */
-TYPED_TEST(DatabaseClientTest, journalMultiple) {
+TEST_P(DatabaseClientTest, journalMultiple) {
     std::vector<JournalEntry> expected;
-    this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+    updater_ = client_->getUpdater(zname_, false, true);
     std::string soa_rdata = "ns1.example.org. admin.example.org. "
         "1234 3600 1800 2419200 7200";
     for (size_t i = 1; i < 100; ++ i) {
         // Remove the old SOA
-        this->updater_->deleteRRset(*this->soa_);
+        updater_->deleteRRset(*soa_);
         expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234 + i - 1,
                                         DatabaseAccessor::DIFF_DELETE,
                                         "example.org.", "SOA", "3600",
@@ -4049,21 +3866,19 @@ TYPED_TEST(DatabaseClientTest, journalMultiple) {
         // Create a new SOA
         soa_rdata = "ns1.example.org. admin.example.org. " +
             lexical_cast<std::string>(1234 + i) + " 3600 1800 2419200 7200";
-        this->soa_.reset(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                                   this->rrttl_));
-        this->soa_->addRdata(rdata::createRdata(this->soa_->getType(),
-                                                this->soa_->getClass(),
-                                                soa_rdata));
+        soa_.reset(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
+        soa_->addRdata(rdata::createRdata(soa_->getType(), soa_->getClass(),
+                                          soa_rdata));
         // Add the new SOA
-        this->updater_->addRRset(*this->soa_);
+        updater_->addRRset(*soa_);
         expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234 + i,
                                         DatabaseAccessor::DIFF_ADD,
                                         "example.org.", "SOA", "3600",
                                         soa_rdata));
     }
-    ASSERT_NO_THROW(this->updater_->commit());
+    ASSERT_NO_THROW(updater_->commit());
     // Check the journal contains everything.
-    this->checkJournal(expected);
+    checkJournal(expected);
 }
 
 /*
@@ -4079,72 +3894,71 @@ TEST_F(MockDatabaseClientTest, journalBadSequence) {
     std::vector<JournalEntry> expected;
     {
         SCOPED_TRACE("Delete A before SOA");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
-        EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_),
-                     isc::BadValue);
+        updater_ = client_->getUpdater(zname_, false, true);
+        EXPECT_THROW(updater_->deleteRRset(*rrset_), isc::BadValue);
         // Make sure the journal is empty now
-        this->checkJournal(expected);
+        checkJournal(expected);
     }
 
     {
         SCOPED_TRACE("Add before delete");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
-        EXPECT_THROW(this->updater_->addRRset(*this->soa_), isc::BadValue);
+        updater_ = client_->getUpdater(zname_, false, true);
+        EXPECT_THROW(updater_->addRRset(*soa_), isc::BadValue);
         // Make sure the journal is empty now
-        this->checkJournal(expected);
+        checkJournal(expected);
     }
 
     {
         SCOPED_TRACE("Add A before SOA");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+        updater_ = client_->getUpdater(zname_, false, true);
         // So far OK
-        EXPECT_NO_THROW(this->updater_->deleteRRset(*this->soa_));
+        EXPECT_NO_THROW(updater_->deleteRRset(*soa_));
         // But we miss the add SOA here
-        EXPECT_THROW(this->updater_->addRRset(*this->rrset_), isc::BadValue);
+        EXPECT_THROW(updater_->addRRset(*rrset_), isc::BadValue);
         // Make sure the journal contains only the first one
         expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234,
                                         DatabaseAccessor::DIFF_DELETE,
                                         "example.org.", "SOA", "3600",
                                         "ns1.example.org. admin.example.org. "
                                         "1234 3600 1800 2419200 7200"));
-        this->checkJournal(expected);
+        checkJournal(expected);
     }
 
     {
         SCOPED_TRACE("Commit before add");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+        updater_ = client_->getUpdater(zname_, false, true);
         // So far OK
-        EXPECT_NO_THROW(this->updater_->deleteRRset(*this->soa_));
+        EXPECT_NO_THROW(updater_->deleteRRset(*soa_));
         // Commit at the wrong time
         EXPECT_THROW(updater_->commit(), isc::BadValue);
-        current_accessor_->checkJournal(expected);
+        checkJournal(expected);
     }
 
     {
         SCOPED_TRACE("Delete two SOAs");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+        updater_ = client_->getUpdater(zname_, false, true);
         // So far OK
-        EXPECT_NO_THROW(this->updater_->deleteRRset(*this->soa_));
+        EXPECT_NO_THROW(updater_->deleteRRset(*soa_));
         // Delete the SOA again
-        EXPECT_THROW(this->updater_->deleteRRset(*this->soa_), isc::BadValue);
-        this->checkJournal(expected);
+        EXPECT_THROW(updater_->deleteRRset(*soa_), isc::BadValue);
+        checkJournal(expected);
     }
 
     {
         SCOPED_TRACE("Add two SOAs");
-        this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+        updater_ = client_->getUpdater(zname_, false, true);
         // So far OK
-        EXPECT_NO_THROW(this->updater_->deleteRRset(*this->soa_));
+        EXPECT_NO_THROW(updater_->deleteRRset(*soa_));
         // Still OK
-        EXPECT_NO_THROW(this->updater_->addRRset(*this->soa_));
+        EXPECT_NO_THROW(updater_->addRRset(*soa_));
         // But this one is added again
-        EXPECT_THROW(this->updater_->addRRset(*this->soa_), isc::BadValue);
+        EXPECT_THROW(updater_->addRRset(*soa_), isc::BadValue);
         expected.push_back(JournalEntry(WRITABLE_ZONE_ID, 1234,
                                         DatabaseAccessor::DIFF_ADD,
                                         "example.org.", "SOA", "3600",
                                         "ns1.example.org. admin.example.org. "
                                         "1234 3600 1800 2419200 7200"));
-        this->checkJournal(expected);
+        checkJournal(expected);
     }
 }
 
@@ -4152,9 +3966,8 @@ TEST_F(MockDatabaseClientTest, journalBadSequence) {
  * Test it rejects to store journals when we request it together with
  * erasing the whole zone.
  */
-TYPED_TEST(DatabaseClientTest, journalOnErase) {
-    EXPECT_THROW(this->client_->getUpdater(this->zname_, true, true),
-                 isc::BadValue);
+TEST_P(DatabaseClientTest, journalOnErase) {
+    EXPECT_THROW(client_->getUpdater(zname_, true, true), isc::BadValue);
 }
 
 /*
@@ -4200,18 +4013,17 @@ makeSimpleDiff(DataSourceClient& client, const Name& zname,
     return (soa_end);
 }
 
-TYPED_TEST(DatabaseClientTest, journalReader) {
+TEST_P(DatabaseClientTest, journalReader) {
     // Check the simple case made by makeSimpleDiff.
-    ConstRRsetPtr soa_end = makeSimpleDiff(*this->client_, this->zname_,
-                                           this->qclass_, this->soa_);
+    ConstRRsetPtr soa_end = makeSimpleDiff(*client_, zname_, qclass_, soa_);
     pair<ZoneJournalReader::Result, ZoneJournalReaderPtr> result =
-        this->client_->getJournalReader(this->zname_, 1234, 1235);
+        client_->getJournalReader(zname_, 1234, 1235);
     EXPECT_EQ(ZoneJournalReader::SUCCESS, result.first);
     ZoneJournalReaderPtr jnl_reader = result.second;
     ASSERT_TRUE(jnl_reader);
     ConstRRsetPtr rrset = jnl_reader->getNextDiff();
     ASSERT_TRUE(rrset);
-    rrsetCheck(this->soa_, rrset);
+    rrsetCheck(soa_, rrset);
     rrset = jnl_reader->getNextDiff();
     ASSERT_TRUE(rrset);
     rrsetCheck(soa_end, rrset);
@@ -4223,38 +4035,36 @@ TYPED_TEST(DatabaseClientTest, journalReader) {
     EXPECT_THROW(jnl_reader->getNextDiff(), isc::InvalidOperation);
 }
 
-TYPED_TEST(DatabaseClientTest, readLargeJournal) {
+TEST_P(DatabaseClientTest, readLargeJournal) {
     // Similar to journalMultiple, but check that at a higher level.
 
-    this->updater_ = this->client_->getUpdater(this->zname_, false, true);
+    updater_ = client_->getUpdater(zname_, false, true);
 
     vector<ConstRRsetPtr> expected;
     for (size_t i = 0; i < 100; ++i) {
         // Create the old SOA and remove it, and record it in the expected list
-        RRsetPtr rrset1(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                                  this->rrttl_));
+        RRsetPtr rrset1(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
         string soa_rdata = "ns1.example.org. admin.example.org. " +
             lexical_cast<std::string>(1234 + i) + " 3600 1800 2419200 7200";
-        rrset1->addRdata(rdata::createRdata(RRType::SOA(), this->qclass_,
+        rrset1->addRdata(rdata::createRdata(RRType::SOA(), qclass_,
                                             soa_rdata));
-        this->updater_->deleteRRset(*rrset1);
+        updater_->deleteRRset(*rrset1);
         expected.push_back(rrset1);
 
         // Create a new SOA, add it, and record it.
-        RRsetPtr rrset2(new RRset(this->zname_, this->qclass_, RRType::SOA(),
-                                  this->rrttl_));
+        RRsetPtr rrset2(new RRset(zname_, qclass_, RRType::SOA(), rrttl_));
         soa_rdata = "ns1.example.org. admin.example.org. " +
             lexical_cast<std::string>(1234 + i + 1) +
             " 3600 1800 2419200 7200";
-        rrset2->addRdata(rdata::createRdata(RRType::SOA(), this->qclass_,
+        rrset2->addRdata(rdata::createRdata(RRType::SOA(), qclass_,
                                             soa_rdata));
-        this->updater_->addRRset(*rrset2);
+        updater_->addRRset(*rrset2);
         expected.push_back(rrset2);
     }
-    this->updater_->commit();
+    updater_->commit();
 
-    ZoneJournalReaderPtr jnl_reader(this->client_->getJournalReader(
-                                        this->zname_, 1234, 1334).second);
+    ZoneJournalReaderPtr jnl_reader(client_->getJournalReader(
+                                        zname_, 1234, 1334).second);
     ConstRRsetPtr actual;
     int i = 0;
     while ((actual = jnl_reader->getNextDiff()) != NULL) {
@@ -4263,20 +4073,20 @@ TYPED_TEST(DatabaseClientTest, readLargeJournal) {
     EXPECT_EQ(expected.size(), i); // we should have eaten all expected data
 }
 
-TYPED_TEST(DatabaseClientTest, readJournalForNoRange) {
-    makeSimpleDiff(*this->client_, this->zname_, this->qclass_, this->soa_);
+TEST_P(DatabaseClientTest, readJournalForNoRange) {
+    makeSimpleDiff(*client_, zname_, qclass_, soa_);
 
     // The specified range does not exist in the diff storage.  The factory
     // method should result in NO_SUCH_VERSION
     pair<ZoneJournalReader::Result, ZoneJournalReaderPtr> result =
-        this->client_->getJournalReader(this->zname_, 1200, 1235);
+        client_->getJournalReader(zname_, 1200, 1235);
     EXPECT_EQ(ZoneJournalReader::NO_SUCH_VERSION, result.first);
     EXPECT_FALSE(result.second);
 }
 
-TYPED_TEST(DatabaseClientTest, journalReaderForNXZone) {
-    pair<ZoneJournalReader::Result, ZoneJournalReaderPtr> result =
-        this->client_->getJournalReader(Name("nosuchzone"), 0, 1);
+TEST_P(DatabaseClientTest, journalReaderForNXZone) {
+    const pair<ZoneJournalReader::Result, ZoneJournalReaderPtr> result =
+        client_->getJournalReader(Name("nosuchzone"), 0, 1);
     EXPECT_EQ(ZoneJournalReader::NO_SUCH_ZONE, result.first);
     EXPECT_FALSE(result.second);
 }
@@ -4313,23 +4123,23 @@ TEST_F(MockDatabaseClientTest, journalWithBadData) {
                    "bad-ttl");
     installBadDiff(mock_accessor, 7, DatabaseAccessor::DIFF_RDATA,
                    "bad rdata");
-    EXPECT_THROW(this->client_->getJournalReader(this->zname_, 1, 2).
+    EXPECT_THROW(client_->getJournalReader(zname_, 1, 2).
                  second->getNextDiff(), DataSourceError);
-    EXPECT_THROW(this->client_->getJournalReader(this->zname_, 3, 4).
+    EXPECT_THROW(client_->getJournalReader(zname_, 3, 4).
                  second->getNextDiff(), DataSourceError);
-    EXPECT_THROW(this->client_->getJournalReader(this->zname_, 5, 6).
+    EXPECT_THROW(client_->getJournalReader(zname_, 5, 6).
                  second->getNextDiff(), DataSourceError);
-    EXPECT_THROW(this->client_->getJournalReader(this->zname_, 7, 8).
+    EXPECT_THROW(client_->getJournalReader(zname_, 7, 8).
                  second->getNextDiff(), DataSourceError);
 }
 
 /// Let us test a little bit of NSEC3.
-TYPED_TEST(DatabaseClientTest, findNSEC3) {
+TEST_P(DatabaseClientTest, findNSEC3) {
     // Set up the faked hash calculator.
-    setNSEC3HashCreator(&this->test_nsec3_hash_creator_);
+    setNSEC3HashCreator(&test_nsec3_hash_creator_);
 
     const DataSourceClient::FindResult
-        zone(this->client_->findZone(Name("example.org")));
+        zone(client_->findZone(Name("example.org")));
     ASSERT_EQ(result::SUCCESS, zone.code);
     boost::shared_ptr<DatabaseClient::Finder> finder(
         dynamic_pointer_cast<DatabaseClient::Finder>(zone.zone_finder));
@@ -4338,122 +4148,104 @@ TYPED_TEST(DatabaseClientTest, findNSEC3) {
     EXPECT_THROW(finder->findNSEC3(Name("example.org"), false),
                  DataSourceError);
     // And enable NSEC3 in the zone.
-    this->current_accessor_->enableNSEC3();
+    (GetParam()->enable_nsec3_fn)(*current_accessor_);
 
     // The rest is in the function, it is shared with in-memory tests
     performNSEC3Test(*finder, true);
 }
 
-TYPED_TEST(DatabaseClientTest, createZone) {
+TEST_P(DatabaseClientTest, createZone) {
     const Name new_name("example.com");
-    const DataSourceClient::FindResult
-        zone(this->client_->findZone(new_name));
-    ASSERT_EQ(result::NOTFOUND, zone.code);
+    const DataSourceClient::FindResult result(client_->findZone(new_name));
+    ASSERT_EQ(result::NOTFOUND, result.code);
 
     // Adding a new zone; it should work and return true
-    ASSERT_TRUE(this->client_->createZone(new_name));
-    const DataSourceClient::FindResult
-        zone2(this->client_->findZone(new_name));
-    ASSERT_EQ(result::SUCCESS, zone2.code);
+    ASSERT_TRUE(client_->createZone(new_name));
+    const DataSourceClient::FindResult result2(client_->findZone(new_name));
+    ASSERT_EQ(result::SUCCESS, result2.code);
     // And the second call should return false since
     // it already exists
-    this->allowMoreTransaction(true);
-    ASSERT_FALSE(this->client_->createZone(new_name));
+    allowMoreTransaction(true);
+    ASSERT_FALSE(client_->createZone(new_name));
 }
 
-TYPED_TEST(DatabaseClientTest, createZoneRollbackOnLocked) {
+TEST_P(DatabaseClientTest, createZoneRollbackOnLocked) {
     const Name new_name("example.com");
-    isc::datasrc::ZoneUpdaterPtr updater =
-        this->client_->getUpdater(this->zname_, true);
-    this->allowMoreTransaction(false);
-    ASSERT_THROW(this->client_->createZone(new_name), DataSourceError);
+    isc::datasrc::ZoneUpdaterPtr updater = client_->getUpdater(zname_, true);
+    allowMoreTransaction(false);
+    ASSERT_THROW(client_->createZone(new_name), DataSourceError);
     // createZone started a transaction as well, but since it failed,
     // it should have been rolled back. Roll back the other one as
     // well, and the next attempt should succeed
     updater.reset();
-    this->allowMoreTransaction(true);
-    ASSERT_TRUE(this->client_->createZone(new_name));
+    allowMoreTransaction(true);
+    ASSERT_TRUE(client_->createZone(new_name));
 }
 
-TYPED_TEST(DatabaseClientTest, createZoneRollbackOnExists) {
+TEST_P(DatabaseClientTest, createZoneRollbackOnExists) {
     const Name new_name("example.com");
-    ASSERT_FALSE(this->client_->createZone(this->zname_));
+    ASSERT_FALSE(client_->createZone(zname_));
 
     // deleteZone started a transaction, but since the zone didn't even exist
     // the transaction was not committed but should have been rolled back.
     // The first transaction shouldn't leave any state, lock, etc, that
     // would hinder the second attempt.
-    this->allowMoreTransaction(true);
-    ASSERT_TRUE(this->client_->createZone(new_name));
+    allowMoreTransaction(true);
+    ASSERT_TRUE(client_->createZone(new_name));
 }
 
-TYPED_TEST(DatabaseClientTest, deleteZone) {
+TEST_P(DatabaseClientTest, deleteZone) {
     // Check the zone currently exists.
-    EXPECT_EQ(result::SUCCESS, this->client_->findZone(this->zname_).code);
+    EXPECT_EQ(result::SUCCESS, client_->findZone(zname_).code);
 
     // Deleting an existing zone; it should work and return true (previously
     // existed and is now deleted)
-    EXPECT_TRUE(this->client_->deleteZone(this->zname_));
+    EXPECT_TRUE(client_->deleteZone(zname_));
 
     // Now it's not found by findZone
-    EXPECT_EQ(result::NOTFOUND, this->client_->findZone(this->zname_).code);
+    EXPECT_EQ(result::NOTFOUND, client_->findZone(zname_).code);
 
     // And the second call should return false since it doesn't exist any more
-    this->allowMoreTransaction(true);
-    EXPECT_FALSE(this->client_->deleteZone(this->zname_));
+    allowMoreTransaction(true);
+    EXPECT_FALSE(client_->deleteZone(zname_));
 }
 
-TYPED_TEST(DatabaseClientTest, deleteZoneRollbackOnLocked) {
-    isc::datasrc::ZoneUpdaterPtr updater =
-        this->client_->getUpdater(this->zname_, true);
+TEST_P(DatabaseClientTest, deleteZoneRollbackOnLocked) {
+    isc::datasrc::ZoneUpdaterPtr updater = client_->getUpdater(zname_, true);
 
     // updater locks the DB so deleteZone() will fail.
-    this->allowMoreTransaction(false);
-    EXPECT_THROW(this->client_->deleteZone(this->zname_), DataSourceError);
+    allowMoreTransaction(false);
+    EXPECT_THROW(client_->deleteZone(zname_), DataSourceError);
 
     // deleteZone started a transaction as well, but since it failed,
     // it should have been rolled back. Roll back the other one as
     // well, and the next attempt should succeed
     updater.reset();
-    this->allowMoreTransaction(true);
-    EXPECT_TRUE(this->client_->deleteZone(this->zname_));
+    allowMoreTransaction(true);
+    EXPECT_TRUE(client_->deleteZone(zname_));
 }
 
-TYPED_TEST(DatabaseClientTest, deleteZoneRollbackOnNotFind) {
+TEST_P(DatabaseClientTest, deleteZoneRollbackOnNotFind) {
     // attempt of deleting non-existent zone.  result in false
     const Name new_name("example.com");
-    EXPECT_FALSE(this->client_->deleteZone(new_name));
+    EXPECT_FALSE(client_->deleteZone(new_name));
 
     // deleteZone started a transaction, but since the zone didn't even exist
     // the transaction was not committed but should have been rolled back.
     // The first transaction shouldn't leave any state, lock, etc, that
     // would hinder the second attempt.
-    this->allowMoreTransaction(true);
-    EXPECT_TRUE(this->client_->deleteZone(this->zname_));
+    allowMoreTransaction(true);
+    EXPECT_TRUE(client_->deleteZone(zname_));
 }
 
-TYPED_TEST_CASE(RRsetCollectionTest, TestAccessorTypes);
+INSTANTIATE_TEST_CASE_P(, RRsetCollectionTest, ::testing::Values(&mock_param));
 
-// This test fixture is templated so that we can share (most of) the test
-// cases with different types of data sources.  Note that in test cases
-// we need to use 'this' to refer to member variables of the test class.
-template <typename ACCESSOR_TYPE>
-class RRsetCollectionTest : public DatabaseClientTest<ACCESSOR_TYPE> {
-public:
-    RRsetCollectionTest() :
-        DatabaseClientTest<ACCESSOR_TYPE>(),
-        updater(this->client_->getUpdater(this->zname_, false)),
-        collection(updater->getRRsetCollection())
-    {}
-
-    ZoneUpdaterPtr updater;
-    isc::dns::RRsetCollectionBase& collection;
-};
+TEST_P(RRsetCollectionTest, find) {
+    isc::dns::RRsetCollectionBase& collection = updater->getRRsetCollection();
 
-TYPED_TEST(RRsetCollectionTest, find) {
     // Test the find() that returns ConstRRsetPtr
-    ConstRRsetPtr rrset = this->collection.find(Name("www.example.org."),
-                                                RRClass::IN(), RRType::A());
+    ConstRRsetPtr rrset = collection.find(Name("www.example.org."),
+                                          RRClass::IN(), RRType::A());
     ASSERT_TRUE(rrset);
     EXPECT_EQ(RRType::A(), rrset->getType());
     EXPECT_EQ(RRTTL(3600), rrset->getTTL());
@@ -4461,59 +4253,54 @@ TYPED_TEST(RRsetCollectionTest, find) {
     EXPECT_EQ(Name("www.example.org"), rrset->getName());
 
     // foo.example.org doesn't exist
-    rrset = this->collection.find(Name("foo.example.org"), this->qclass_,
-                                  RRType::A());
+    rrset = collection.find(Name("foo.example.org"), qclass_, RRType::A());
     EXPECT_FALSE(rrset);
 
     // www.example.org exists, but not with MX
-    rrset = this->collection.find(Name("www.example.org"), this->qclass_,
-                                  RRType::MX());
+    rrset = collection.find(Name("www.example.org"), qclass_, RRType::MX());
     EXPECT_FALSE(rrset);
 
     // www.example.org exists, with AAAA
-    rrset = this->collection.find(Name("www.example.org"), this->qclass_,
-                                  RRType::AAAA());
+    rrset = collection.find(Name("www.example.org"), qclass_, RRType::AAAA());
     EXPECT_TRUE(rrset);
 
     // www.example.org with AAAA does not exist in RRClass::CH()
-    rrset = this->collection.find(Name("www.example.org"), RRClass::CH(),
-                                  RRType::AAAA());
+    rrset = collection.find(Name("www.example.org"), RRClass::CH(),
+                            RRType::AAAA());
     EXPECT_FALSE(rrset);
 
     // Out-of-zone find()s must not throw.
-    rrset = this->collection.find(Name("www.example.com"), this->qclass_,
-                                  RRType::A());
+    rrset = collection.find(Name("www.example.com"), qclass_, RRType::A());
     EXPECT_FALSE(rrset);
 
     // "cname.example.org." with type CNAME should return the CNAME RRset
-    rrset = this->collection.find(Name("cname.example.org"), this->qclass_,
-                                  RRType::CNAME());
+    rrset = collection.find(Name("cname.example.org"), qclass_,
+                            RRType::CNAME());
     ASSERT_TRUE(rrset);
     EXPECT_EQ(RRType::CNAME(), rrset->getType());
     EXPECT_EQ(Name("cname.example.org"), rrset->getName());
 
     // "cname.example.org." with type A should return nothing
-    rrset = this->collection.find(Name("cname.example.org"), this->qclass_,
-                                  RRType::A());
+    rrset = collection.find(Name("cname.example.org"), qclass_, RRType::A());
     EXPECT_FALSE(rrset);
 
     // "dname.example.org." with type DNAME should return the DNAME RRset
-    rrset = this->collection.find(Name("dname.example.org"), this->qclass_,
-                                  RRType::DNAME());
+    rrset = collection.find(Name("dname.example.org"), qclass_,
+                            RRType::DNAME());
     ASSERT_TRUE(rrset);
     EXPECT_EQ(RRType::DNAME(), rrset->getType());
     EXPECT_EQ(Name("dname.example.org"), rrset->getName());
 
     // "below.dname.example.org." with type AAAA should return nothing
-    rrset = this->collection.find(Name("below.dname.example.org"),
-                                  this->qclass_, RRType::AAAA());
+    rrset = collection.find(Name("below.dname.example.org"),
+                            qclass_, RRType::AAAA());
     EXPECT_FALSE(rrset);
 
     // "below.dname.example.org." with type A does not return the record
     // (see top of file). See \c isc::datasrc::RRsetCollectionBase::find()
     // documentation for details.
-    rrset = this->collection.find(Name("below.dname.example.org"),
-                                  this->qclass_, RRType::A());
+    rrset = collection.find(Name("below.dname.example.org"), qclass_,
+                            RRType::A());
     EXPECT_FALSE(rrset);
 
     // With the FIND_GLUE_OK option passed to ZoneFinder's find(),
@@ -4521,8 +4308,8 @@ TYPED_TEST(RRsetCollectionTest, find) {
     // return the NS record. Without FIND_GLUE_OK, ZoneFinder's find()
     // would return DELEGATION and the find() below would return
     // nothing.
-    rrset = this->collection.find(Name("delegation.example.org"),
-                                  this->qclass_, RRType::NS());
+    rrset = collection.find(Name("delegation.example.org"), qclass_,
+                            RRType::NS());
     ASSERT_TRUE(rrset);
     EXPECT_EQ(RRType::NS(), rrset->getType());
     EXPECT_EQ(Name("delegation.example.org"), rrset->getName());
@@ -4531,26 +4318,37 @@ TYPED_TEST(RRsetCollectionTest, find) {
     // searching for some "foo.wildcard.example.org." would make
     // ZoneFinder's find() return NXDOMAIN, and the find() below should
     // return nothing.
-    rrset = this->collection.find(Name("foo.wild.example.org"),
-                                  this->qclass_, RRType::A());
+    rrset = collection.find(Name("foo.wild.example.org"), qclass_,
+                            RRType::A());
     EXPECT_FALSE(rrset);
 
     // Searching directly for "*.wild.example.org." should return the
     // record.
-    rrset = this->collection.find(Name("*.wild.example.org"),
-                                  this->qclass_, RRType::A());
+    rrset = collection.find(Name("*.wild.example.org"), qclass_,
+                            RRType::A());
     ASSERT_TRUE(rrset);
     EXPECT_EQ(RRType::A(), rrset->getType());
     EXPECT_EQ(Name("*.wild.example.org"), rrset->getName());
 }
 
-TYPED_TEST(RRsetCollectionTest, iteratorTest) {
+TEST_P(RRsetCollectionTest, iteratorTest) {
+    isc::dns::RRsetCollectionBase& collection = updater->getRRsetCollection();
+
     // Iterators are currently not implemented.
-    EXPECT_THROW(this->collection.begin(), isc::NotImplemented);
-    EXPECT_THROW(this->collection.end(), isc::NotImplemented);
+    EXPECT_THROW(collection.begin(), isc::NotImplemented);
+    EXPECT_THROW(collection.end(), isc::NotImplemented);
 }
 
-typedef RRsetCollectionTest<MockAccessor> MockRRsetCollectionTest;
+// This inherit the RRsetCollectionTest cases except for the parameterized
+// setup; it's intended to be used selected test cases that only work for mock
+// data sources.
+class MockRRsetCollectionTest : public RRsetCollectionTest {
+protected:
+    virtual void SetUp() {
+        createClient(&mock_param);
+        updater = client_->getUpdater(zname_, false);
+    }
+};
 
 TEST_F(MockRRsetCollectionTest, findError) {
     // A test using the MockAccessor for checking that FindError is
@@ -4560,91 +4358,71 @@ TEST_F(MockRRsetCollectionTest, findError) {
     // The "dsexception.example.org." name is rigged by the MockAccessor
     // to throw a DataSourceError.
     EXPECT_THROW({
-        this->collection.find(Name("dsexception.example.org"), this->qclass_,
-                              RRType::A());
-    }, RRsetCollectionError);
+            updater->getRRsetCollection().find(
+                Name("dsexception.example.org"), qclass_, RRType::A());
+        }, RRsetCollectionError);
 }
 
-TYPED_TEST_CASE(RRsetCollectionAndUpdaterTest, TestAccessorTypes);
-
-// This test fixture is templated so that we can share (most of) the test
-// cases with different types of data sources.  Note that in test cases
-// we need to use 'this' to refer to member variables of the test class.
-template <typename ACCESSOR_TYPE>
-class RRsetCollectionAndUpdaterTest : public DatabaseClientTest<ACCESSOR_TYPE> {
-public:
-    RRsetCollectionAndUpdaterTest() :
-        DatabaseClientTest<ACCESSOR_TYPE>(),
-        updater_(this->client_->getUpdater(this->zname_, false))
-    {}
-
-    ZoneUpdaterPtr updater_;
-};
-
 // Test that using addRRset() or deleteRRset() on the ZoneUpdater throws
 // after an RRsetCollection is created.
-TYPED_TEST(RRsetCollectionAndUpdaterTest, updateThrows) {
+TEST_P(RRsetCollectionTest, updateThrows) {
     // 1. Addition test
 
     // addRRset() must not throw.
-    this->updater_->addRRset(*this->rrset_);
+    updater->addRRset(*rrset_);
 
     // Now setup a new updater and call getRRsetCollection() on it.
-    this->updater_.reset();
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
+    updater.reset();
+    updater = client_->getUpdater(zname_, false);
 
     // Just call getRRsetCollection() here. The test using .find() is
     // unnecessary for the purpose of this test case, but we have it to
     // use the result of getRRsetCollection() and silence some compiler
     // complaining about ignoring the return value of
     // getRRsetCollection().
-    EXPECT_FALSE(this->updater_->getRRsetCollection().
+    EXPECT_FALSE(updater->getRRsetCollection().
                  find(Name("www.example.org"), RRClass::IN(), RRType::MX()));
 
     // addRRset() must throw isc::InvalidOperation here.
-    EXPECT_THROW(this->updater_->addRRset(*this->rrset_),
-                 isc::InvalidOperation);
+    EXPECT_THROW(updater->addRRset(*rrset_), isc::InvalidOperation);
 
     // 2. Deletion test
 
     // deleteRRset() must not throw.
-    this->updater_.reset();
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->addRRset(*this->rrset_);
-    this->updater_->deleteRRset(*this->rrset_);
+    updater.reset();
+    updater = client_->getUpdater(zname_, false);
+    updater->addRRset(*rrset_);
+    updater->deleteRRset(*rrset_);
 
     // Now setup a new updater and call getRRsetCollection() on it.
-    this->updater_.reset();
-    this->updater_ = this->client_->getUpdater(this->zname_, false);
-    this->updater_->addRRset(*this->rrset_);
+    updater.reset();
+    updater = client_->getUpdater(zname_, false);
+    updater->addRRset(*rrset_);
 
     // Just call getRRsetCollection() here. The .find() is unnecessary,
     // but we have it to use the result of getRRsetCollection().
-    this->updater_->getRRsetCollection().find(Name("www.example.org"),
-                                              RRClass::IN(),
-                                              RRType::MX());
+    updater->getRRsetCollection().find(Name("www.example.org"),
+                                       RRClass::IN(), RRType::MX());
 
     // deleteRRset() must throw isc::InvalidOperation here.
-    EXPECT_THROW(this->updater_->deleteRRset(*this->rrset_),
-                 isc::InvalidOperation);
+    EXPECT_THROW(updater->deleteRRset(*rrset_), isc::InvalidOperation);
 }
 
 // Test that using an RRsetCollection after calling commit() on the
 // ZoneUpdater throws, as the RRsetCollection is disabled.
-TYPED_TEST(RRsetCollectionAndUpdaterTest, useAfterCommitThrows) {
+TEST_P(RRsetCollectionTest, useAfterCommitThrows) {
      isc::dns::RRsetCollectionBase& collection =
-         this->updater_->getRRsetCollection();
+         updater->getRRsetCollection();
 
      // find() must not throw here.
-     collection.find(Name("foo.wild.example.org"), this->qclass_, RRType::A());
+     collection.find(Name("foo.wild.example.org"), qclass_, RRType::A());
 
-     this->updater_->commit();
+     updater->commit();
 
      // find() must throw RRsetCollectionError here, as the
      // RRsetCollection is disabled.
-     EXPECT_THROW(collection.find(Name("foo.wild.example.org"),
-                                  this->qclass_, RRType::A()),
-                  RRsetCollectionError);
+     EXPECT_THROW(collection.find(Name("foo.wild.example.org"), qclass_,
+                                  RRType::A()), RRsetCollectionError);
 }
 
 }
diff --git a/src/lib/datasrc/tests/database_unittest.h b/src/lib/datasrc/tests/database_unittest.h
new file mode 100644
index 0000000..f7746b0
--- /dev/null
+++ b/src/lib/datasrc/tests/database_unittest.h
@@ -0,0 +1,278 @@
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#include <datasrc/database.h>
+#include <datasrc/tests/faked_nsec3.h>
+
+#include <dns/name.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rrset.h>
+#include <dns/rrset_collection_base.h>
+#include <dns/nsec3hash.h>
+
+#include <gtest/gtest.h>
+
+#include <boost/shared_ptr.hpp>
+
+#include <string>
+#include <vector>
+
+namespace isc {
+namespace datasrc {
+namespace test {
+
+/// \brief Commonly used test data.
+///
+/// This is an array of 5 C-string tuples, each of the tuples has the
+/// following semantics.
+/// [0] textual form of fully qualified, dot-terminated domain name
+///     (NAME_COLUMN).
+/// [1] textual form of RR type, such as "AAAA" (TYPE_COLUMN)
+/// [2] textual numeric form of RR TTL (TTL_COLUMN)
+/// [3] textual form of RR type, intended to be used to represent the
+///     "covered type" of RRSIG RRs, but actually not used at the moment.
+///     (SIGTYPE_COLUMN)
+/// [4] textual form of RDATA of the type, e.g., "2001:db8::1" for AAAA
+///     (RDATA_COLUMN)
+///
+/// These correspond to the array fields returned by
+/// \c DatabaseAccessor::IteratorContext::getNext().  The upper-cased names
+/// surrounded by parentheses specify the corresponding field for the specific
+/// entry.
+///
+/// It ends with a special entry of an all-NULL tuple.
+///
+/// For testing a custom accessor, it's expected to "load" the data of these
+/// records on a call to \c accessor_creator member of
+/// \c DatabaseClientTestParam (see the structure description).  In tests,
+/// the loaded data should be able to be retrieved by subsequent
+/// \c getRecords() or \c getNSEC3Records() calls.  The specific realization
+/// of the load can be specific to the accessor implementation, but if it
+/// conforms to the API of the following methods of \c DatabaseAccessor,
+/// it can be done by calling \c loadTestDataGeneric():
+/// - startUpdateZone()
+/// - addRecordToZone()
+/// - commit()
+extern const char* const TEST_RECORDS[][5];
+
+/// \brief NSEC3PARAM at the zone origin and its RRSIG.
+///
+/// The semantics of the data is the same as that for TEST_RECORDS.
+///
+/// These will be "loaded" on a call to
+/// \c DatabaseClientTestParam::enable_nsec3_fn for some tests that tests
+/// NSEC3 related behavior.  If the tested accessor skips the support for
+/// NSEC3, this data ban be ignored.
+extern const char* TEST_NSEC3PARAM_RECORDS[][5];
+
+/// \brief NSEC3 RR data commonly used for NSEC3-related tests.
+///
+/// This is similar to TEST_RECORDS, but the first entry is base32-hex encoded
+/// hash value (which is expected to appear as the first label of NSEC3
+/// owner names), not an FQDN.
+///
+/// These will be "loaded" on a call to
+/// \c DatabaseClientTestParam::enable_nsec3_fn for some tests that tests
+/// NSEC3 related behavior.  If the tested accessor skips the support for
+/// NSEC3, this data ban be ignored.  The loaded data are expected to be
+/// retrievable by subsequent \c getNSEC3Records() calls on the tested
+/// accessor.
+///
+/// The specific realization of the load can be specific to the accessor
+/// implementation, but if it conforms to the API of the following methods
+/// of \c DatabaseAccessor, it can be done by calling \c enableNSEC3Generic():
+/// - startUpdateZone()
+/// - addRecordToZone()
+/// - addNSEC3RecordToZone()
+/// - commit()
+extern const char* TEST_NSEC3_RECORDS[][5];
+
+/// \brief Test parameter for DatabaseClientTest.
+///
+/// This is the type of the parameter for the parameterized DatabaseClientTest
+/// and its derived variants.  It consists of a set of function pointers,
+/// including the factory of tested accessor.  A specific accessor
+/// implementation is expected to specify an instance of this structure,
+/// filling the members with appropriate functions for that accessor
+/// implementation.
+///
+/// Note that this is intentionally defined to be of plain old type (a plain
+/// structure whose members are bare function pointers); otherwise it could
+/// cause initialization fiasco at the instantiation time.
+struct DatabaseClientTestParam {
+    /// \brief The factory of the tested accessor.
+    ///
+    /// DatabaseClientTest will call this as part of the initialization of
+    /// each test case.  This function is expected to "load" the data
+    /// specified in TEST_RECORDS so they can be used in the tests.
+    ///
+    /// The creation of the accessor will be inherently implementation
+    /// dependent, but for loading the data it may be sufficient to call
+    /// \c loadTestDataGeneric.  See TEST_RECORDS for the condition.
+    boost::shared_ptr<DatabaseAccessor> (*accessor_creator)();
+
+    /// \brief Make NSEC3 records for the test.
+    ///
+    /// Some test cases call this function when they need to test NSEC3-related
+    /// scenarios.  It's expected to "load" the data specified in
+    /// TEST_NSEC3PARAM_RECORDS and TEST_NSEC3_RECORDS.
+    ///
+    /// The passed accessor will be the one created by the preceding call
+    /// to \c accessor_creator.
+    ///
+    /// If the accessor implementation meets some condition, this member can
+    /// be the generic \c enableNSEC3Generic function.  See TEST_RECORDS
+    /// and TEST_NSEC3_RECORDS for the condition.
+    void (*enable_nsec3_fn)(DatabaseAccessor& accessor);
+};
+
+// forward declaration, needed in the definition of DatabaseClientTest.
+// this is private to the test implementation internal otherwise.
+struct JournalEntry;
+
+/// \brief Test fixture class for the DatabaseClient implementation.
+///
+/// The primary purpose of this fixture is to test the implementation of
+/// the DatabaseClient with an internal mock DatabaseAccessor accessor.
+/// But the test cases can also be used to check specific accessor
+/// implementations.  It will be convenient for implementors of new types of
+/// accessor.
+///
+/// This fixture is therefore parameterized so that a specific accessor
+/// implementation can customize accessor-specific data of the test
+/// (most notably the accessor itself, and also the way to make test data
+/// available through the accessor).
+///
+/// See database_sqlite3_unittest.cc for how to use this test with a specific
+/// accessor implementation.
+class DatabaseClientTest :
+        public ::testing::TestWithParam<const DatabaseClientTestParam*>
+{
+protected:
+    DatabaseClientTest();
+
+    // We create accessor and other objects that depend on it in SetUp, not
+    // in the constructor, so derived test classes can override the behavior.
+    virtual void SetUp() {
+        createClient(GetParam());
+    }
+
+    ~DatabaseClientTest() {
+        // Make sure we return the default creator no matter if we set it or
+        // not
+        dns::setNSEC3HashCreator(NULL);
+    }
+
+    // We initialize the client from a function, so we can call it multiple
+    // times per test.
+    void createClient(const DatabaseClientTestParam* test_param);
+
+    /// Check the zone finder is a valid one and references the zone ID and
+    /// database available here.
+    void checkZoneFinder(const DataSourceClient::FindResult& zone);
+
+    boost::shared_ptr<DatabaseClient::Finder> getFinder();
+
+    // Helper methods for update tests
+    bool isRollbacked(bool expected = false) const;
+
+    void checkLastAdded(const char* const expected[]) const;
+
+    void setUpdateAccessor();
+
+    void checkJournal(const std::vector<JournalEntry>& expected);
+
+    // Mock-only; control whether to allow subsequent transaction.
+    void allowMoreTransaction(bool is_allowed);
+
+    // Some tests only work for MockAccessor.  We remember whether our accessor
+    // is of that type.
+    bool is_mock_;
+
+    boost::shared_ptr<DatabaseAccessor> current_accessor_;
+    boost::shared_ptr<DatabaseClient> client_;
+    const std::string database_name_;
+
+    // The zone finder of the test zone commonly used in various tests.
+    boost::shared_ptr<DatabaseClient::Finder> finder_;
+
+    // Some shortcut variables for commonly used test parameters
+    const dns::Name zname_; // the zone name stored in the test data source
+    const dns::Name qname_; // commonly used name to be found
+    const dns::RRClass qclass_;      // commonly used RR class used with qname
+    const dns::RRType qtype_;        // commonly used RR type used with qname
+    const dns::RRTTL rrttl_;         // commonly used RR TTL
+    dns::RRsetPtr rrset_;            // for adding/deleting an RRset
+    dns::RRsetPtr rrsigset_;         // for adding/deleting an RRset
+    dns::RRsetPtr soa_;              // for adding/deleting an RRset
+
+    // update related objects to be tested
+    ZoneUpdaterPtr updater_;
+    boost::shared_ptr<const DatabaseAccessor> update_accessor_;
+
+    // placeholders
+    const std::vector<std::string> empty_rdatas_; // for NXRRSET/NXDOMAIN
+    std::vector<std::string> expected_rdatas_;
+    std::vector<std::string> expected_sig_rdatas_;
+
+    // A creator for use in several NSEC3 related tests.
+    TestNSEC3HashCreator test_nsec3_hash_creator_;
+};
+
+/// \brief Test fixture for RRsetCollectionTest with database updater.
+///
+/// Inherited from DatabaseClientTest to reuse some of the setup.
+/// This test fixture is parameterized just like DatabaseClientTest.
+class RRsetCollectionTest : public DatabaseClientTest {
+protected:
+    RRsetCollectionTest() {}
+
+    virtual void SetUp() {
+        DatabaseClientTest::SetUp();
+        updater = client_->getUpdater(zname_, false);
+    }
+
+    ZoneUpdaterPtr updater;
+};
+
+/// \brief Generic test data loader.
+///
+/// This function is intended to be used within the accessor_creator function
+/// of DatabaseClientTestParam for tested accessor that implements the
+/// following methods:
+/// - startUpdateZone()
+/// - addRecordToZone()
+/// - commit()
+void loadTestDataGeneric(DatabaseAccessor& accessor);
+
+/// \brief Generic helper to prepare NSEC3 related test data.
+///
+/// This function can be specified for the enable_nsec3_fn member
+/// of DatabaseClientTestParam if the tested accessor implements the
+/// following methods:
+/// - startUpdateZone()
+/// - addRecordToZone()
+/// - addNSEC3RecordToZone()
+/// - commit()
+void enableNSEC3Generic(DatabaseAccessor& accessor);
+
+} // namespace test
+} // namespace datasrc
+} // namespace isc
+
+// Local Variables:
+// mode: c++
+// End:



More information about the bind10-changes mailing list