|
@@ -28,7 +28,6 @@
|
|
#include <datasrc/data_source.h>
|
|
#include <datasrc/data_source.h>
|
|
#include <datasrc/iterator.h>
|
|
#include <datasrc/iterator.h>
|
|
#include <datasrc/sqlite3_accessor.h>
|
|
#include <datasrc/sqlite3_accessor.h>
|
|
-#include <datasrc/rrset_collection.h>
|
|
|
|
|
|
|
|
#include <testutils/dnsmessage_test.h>
|
|
#include <testutils/dnsmessage_test.h>
|
|
|
|
|
|
@@ -4173,22 +4172,13 @@ public:
|
|
{}
|
|
{}
|
|
|
|
|
|
ZoneUpdaterPtr updater;
|
|
ZoneUpdaterPtr updater;
|
|
-<<<<<<< HEAD
|
|
|
|
isc::datasrc::RRsetCollectionBase& collection;
|
|
isc::datasrc::RRsetCollectionBase& collection;
|
|
-=======
|
|
|
|
- RRsetCollectionPtr collection;
|
|
|
|
->>>>>>> trac2438-0
|
|
|
|
};
|
|
};
|
|
|
|
|
|
TYPED_TEST(RRsetCollectionTest, find) {
|
|
TYPED_TEST(RRsetCollectionTest, find) {
|
|
// Test the find() that returns ConstRRsetPtr
|
|
// Test the find() that returns ConstRRsetPtr
|
|
-<<<<<<< HEAD
|
|
|
|
ConstRRsetPtr rrset = this->collection.find(Name("www.example.org."),
|
|
ConstRRsetPtr rrset = this->collection.find(Name("www.example.org."),
|
|
RRClass::IN(), RRType::A());
|
|
RRClass::IN(), RRType::A());
|
|
-=======
|
|
|
|
- ConstRRsetPtr rrset = this->collection->find(Name("www.example.org."),
|
|
|
|
- RRClass::IN(), RRType::A());
|
|
|
|
->>>>>>> trac2438-0
|
|
|
|
ASSERT_TRUE(rrset);
|
|
ASSERT_TRUE(rrset);
|
|
EXPECT_EQ(RRType::A(), rrset->getType());
|
|
EXPECT_EQ(RRType::A(), rrset->getType());
|
|
EXPECT_EQ(RRTTL(3600), rrset->getTTL());
|
|
EXPECT_EQ(RRTTL(3600), rrset->getTTL());
|
|
@@ -4196,7 +4186,6 @@ TYPED_TEST(RRsetCollectionTest, find) {
|
|
EXPECT_EQ(Name("www.example.org"), rrset->getName());
|
|
EXPECT_EQ(Name("www.example.org"), rrset->getName());
|
|
|
|
|
|
// foo.example.org doesn't exist
|
|
// foo.example.org doesn't exist
|
|
-<<<<<<< HEAD
|
|
|
|
rrset = this->collection.find(Name("foo.example.org"), this->qclass_,
|
|
rrset = this->collection.find(Name("foo.example.org"), this->qclass_,
|
|
RRType::A());
|
|
RRType::A());
|
|
EXPECT_FALSE(rrset);
|
|
EXPECT_FALSE(rrset);
|
|
@@ -4278,58 +4267,15 @@ TYPED_TEST(RRsetCollectionTest, find) {
|
|
ASSERT_TRUE(rrset);
|
|
ASSERT_TRUE(rrset);
|
|
EXPECT_EQ(RRType::A(), rrset->getType());
|
|
EXPECT_EQ(RRType::A(), rrset->getType());
|
|
EXPECT_EQ(Name("*.wild.example.org"), rrset->getName());
|
|
EXPECT_EQ(Name("*.wild.example.org"), rrset->getName());
|
|
-=======
|
|
|
|
- rrset = this->collection->find(Name("foo.example.org"), this->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());
|
|
|
|
- EXPECT_FALSE(rrset);
|
|
|
|
-
|
|
|
|
- // www.example.org exists, with AAAA
|
|
|
|
- rrset = this->collection->find(Name("www.example.org"), this->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());
|
|
|
|
- EXPECT_FALSE(rrset);
|
|
|
|
-
|
|
|
|
- // Out of zone find()s must not throw.
|
|
|
|
- rrset = this->collection->find(Name("www.example.com"), this->qclass_,
|
|
|
|
- RRType::A());
|
|
|
|
- EXPECT_FALSE(rrset);
|
|
|
|
->>>>>>> trac2438-0
|
|
|
|
}
|
|
}
|
|
|
|
|
|
TYPED_TEST(RRsetCollectionTest, iteratorTest) {
|
|
TYPED_TEST(RRsetCollectionTest, iteratorTest) {
|
|
// Iterators are currently not implemented.
|
|
// Iterators are currently not implemented.
|
|
-<<<<<<< HEAD
|
|
|
|
EXPECT_THROW(this->collection.begin(), isc::NotImplemented);
|
|
EXPECT_THROW(this->collection.begin(), isc::NotImplemented);
|
|
EXPECT_THROW(this->collection.end(), isc::NotImplemented);
|
|
EXPECT_THROW(this->collection.end(), isc::NotImplemented);
|
|
}
|
|
}
|
|
|
|
|
|
typedef RRsetCollectionTest<MockAccessor> MockRRsetCollectionTest;
|
|
typedef RRsetCollectionTest<MockAccessor> MockRRsetCollectionTest;
|
|
-=======
|
|
|
|
- EXPECT_THROW(this->collection->begin(), isc::NotImplemented);
|
|
|
|
- EXPECT_THROW(this->collection->end(), isc::NotImplemented);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-class MockRRsetCollectionTest : public DatabaseClientTest<MockAccessor> {
|
|
|
|
-public:
|
|
|
|
- MockRRsetCollectionTest() :
|
|
|
|
- DatabaseClientTest<MockAccessor>(),
|
|
|
|
- updater(this->client_->getUpdater(this->zname_, false)),
|
|
|
|
- collection(updater->getRRsetCollection())
|
|
|
|
- {}
|
|
|
|
-
|
|
|
|
- ZoneUpdaterPtr updater;
|
|
|
|
- RRsetCollectionPtr collection;
|
|
|
|
-};
|
|
|
|
->>>>>>> trac2438-0
|
|
|
|
|
|
|
|
TEST_F(MockRRsetCollectionTest, findError) {
|
|
TEST_F(MockRRsetCollectionTest, findError) {
|
|
// A test using the MockAccessor for checking that FindError is
|
|
// A test using the MockAccessor for checking that FindError is
|
|
@@ -4339,7 +4285,6 @@ TEST_F(MockRRsetCollectionTest, findError) {
|
|
// The "dsexception.example.org." name is rigged by the MockAccessor
|
|
// The "dsexception.example.org." name is rigged by the MockAccessor
|
|
// to throw a DataSourceError.
|
|
// to throw a DataSourceError.
|
|
EXPECT_THROW({
|
|
EXPECT_THROW({
|
|
-<<<<<<< HEAD
|
|
|
|
this->collection.find(Name("dsexception.example.org"), this->qclass_,
|
|
this->collection.find(Name("dsexception.example.org"), this->qclass_,
|
|
RRType::A());
|
|
RRType::A());
|
|
}, RRsetCollectionError);
|
|
}, RRsetCollectionError);
|
|
@@ -4413,11 +4358,6 @@ TYPED_TEST(RRsetCollectionAndUpdaterTest, useAfterCommitThrows) {
|
|
EXPECT_THROW(collection.find(Name("foo.wild.example.org"),
|
|
EXPECT_THROW(collection.find(Name("foo.wild.example.org"),
|
|
this->qclass_, RRType::A()),
|
|
this->qclass_, RRType::A()),
|
|
RRsetCollectionError);
|
|
RRsetCollectionError);
|
|
-=======
|
|
|
|
- this->collection->find(Name("dsexception.example.org"), this->qclass_,
|
|
|
|
- RRType::A());
|
|
|
|
- }, RRsetCollectionBase::FindError);
|
|
|
|
->>>>>>> trac2438-0
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|