core: use markers in StatusDataset and NotificationStream

This commit also refactors FaceMonitor as generic NotificationSubscriber,
and refactors AutoregServer to use FaceMonitor.

refs #1837 #1838

Change-Id: I8b40dfae118853d1224c8290cf92e7cc0daa116f
diff --git a/tests/core/notification-stream.cpp b/tests/core/notification-stream.cpp
new file mode 100644
index 0000000..df3fc5b
--- /dev/null
+++ b/tests/core/notification-stream.cpp
@@ -0,0 +1,69 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "core/notification-stream.hpp"
+#include "simple-notification.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/dummy-client-face.hpp"
+
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreNotificationStream, BaseFixture)
+
+BOOST_AUTO_TEST_CASE(Post)
+{
+  shared_ptr<DummyClientFace> face = makeDummyClientFace();
+  ndn::KeyChain keyChain;
+  NotificationStream<DummyClientFace> notificationStream(*face,
+    "/localhost/nfd/NotificationStreamTest", keyChain);
+
+  SimpleNotification event1("msg1");
+  notificationStream.postNotification(event1);
+  face->processEvents();
+  BOOST_REQUIRE_EQUAL(face->m_sentDatas.size(), 1);
+  BOOST_CHECK_EQUAL(face->m_sentDatas[0].getName(),
+                    "/localhost/nfd/NotificationStreamTest/%FE%00");
+  SimpleNotification decoded1;
+  BOOST_CHECK_NO_THROW(decoded1.wireDecode(face->m_sentDatas[0].getContent().blockFromValue()));
+  BOOST_CHECK_EQUAL(decoded1.getMessage(), "msg1");
+
+  SimpleNotification event2("msg2");
+  notificationStream.postNotification(event2);
+  face->processEvents();
+  BOOST_REQUIRE_EQUAL(face->m_sentDatas.size(), 2);
+  BOOST_CHECK_EQUAL(face->m_sentDatas[1].getName(),
+                    "/localhost/nfd/NotificationStreamTest/%FE%01");
+  SimpleNotification decoded2;
+  BOOST_CHECK_NO_THROW(decoded2.wireDecode(face->m_sentDatas[1].getContent().blockFromValue()));
+  BOOST_CHECK_EQUAL(decoded2.getMessage(), "msg2");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/notification-subscriber.cpp b/tests/core/notification-subscriber.cpp
new file mode 100644
index 0000000..12834f6
--- /dev/null
+++ b/tests/core/notification-subscriber.cpp
@@ -0,0 +1,223 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "core/notification-subscriber.hpp"
+#include "core/notification-stream.hpp"
+#include "simple-notification.hpp"
+
+#include "tests/test-common.hpp"
+#include "tests/dummy-client-face.hpp"
+
+
+namespace nfd {
+namespace tests {
+
+BOOST_FIXTURE_TEST_SUITE(CoreNotificationSubscriber, BaseFixture)
+
+class EndToEndFixture : public BaseFixture
+{
+public:
+  EndToEndFixture()
+    : streamPrefix("ndn:/NotificationSubscriberTest")
+    , publisherFace(makeDummyClientFace())
+    , notificationStream(*publisherFace, streamPrefix, publisherKeyChain)
+    , subscriberFace(makeDummyClientFace())
+    , subscriber(*subscriberFace, streamPrefix)
+  {
+  }
+
+  /** \brief post one notification and deliver to subscriber
+   */
+  void
+  deliverNotification(const std::string& msg)
+  {
+    publisherFace->m_sentDatas.clear();
+    SimpleNotification notification(msg);
+    notificationStream.postNotification(notification);
+    publisherFace->processEvents();
+    BOOST_REQUIRE_EQUAL(publisherFace->m_sentDatas.size(), 1);
+
+    lastDeliveredSeqNo = publisherFace->m_sentDatas[0].getName().at(-1).toSequenceNumber();
+
+    lastNotification.setMessage("");
+    subscriberFace->receive(publisherFace->m_sentDatas[0]);
+  }
+
+  void
+  afterNotification(const SimpleNotification& notification)
+  {
+    lastNotification = notification;
+  }
+
+  void
+  clearNotificationHandlers()
+  {
+    subscriber.onNotification.clear();
+  }
+
+  void
+  afterTimeout()
+  {
+    hasTimeout = true;
+  }
+
+  void
+  afterDecodeError(const Data& data)
+  {
+    lastDecodeErrorData = data;
+  }
+
+  /** \return true if subscriberFace has an initial request as sole sent Interest
+   */
+  bool
+  hasInitialRequest() const
+  {
+    if (subscriberFace->m_sentInterests.size() != 1)
+      return 0;
+
+    const Interest& interest = subscriberFace->m_sentInterests[0];
+    return interest.getName() == streamPrefix &&
+           interest.getChildSelector() == 1 &&
+           interest.getMustBeFresh() &&
+           interest.getInterestLifetime() ==
+             NotificationSubscriber<SimpleNotification>::getInterestLifetime();
+  }
+
+  /** \return sequence number of the continuation request sent from subscriberFace
+   *          or 0 if there's no such request as sole sent Interest
+   */
+  uint64_t
+  getRequestSeqNo() const
+  {
+    if (subscriberFace->m_sentInterests.size() != 1)
+      return 0;
+
+    const Interest& interest = subscriberFace->m_sentInterests[0];
+    const Name& name = interest.getName();
+    if (streamPrefix.isPrefixOf(name) &&
+        name.size() == streamPrefix.size() + 1 &&
+        interest.getInterestLifetime() ==
+          NotificationSubscriber<SimpleNotification>::getInterestLifetime())
+      return name[-1].toSequenceNumber();
+    else
+      return 0;
+  }
+
+protected:
+  Name streamPrefix;
+  shared_ptr<DummyClientFace> publisherFace;
+  ndn::KeyChain publisherKeyChain;
+  NotificationStream<DummyClientFace> notificationStream;
+  shared_ptr<DummyClientFace> subscriberFace;
+  NotificationSubscriber<SimpleNotification> subscriber;
+
+  uint64_t lastDeliveredSeqNo;
+
+  SimpleNotification lastNotification;
+  bool hasTimeout;
+  Data lastDecodeErrorData;
+};
+
+BOOST_FIXTURE_TEST_CASE(EndToEnd, EndToEndFixture)
+{
+  BOOST_REQUIRE_EQUAL(subscriber.isRunning(), false);
+
+  // has no effect because onNotification has no handler
+  subscriber.start();
+  BOOST_REQUIRE_EQUAL(subscriber.isRunning(), false);
+
+  subscriber.onNotification += bind(&EndToEndFixture::afterNotification, this, _1);
+  subscriber.onTimeout += bind(&EndToEndFixture::afterTimeout, this);
+  subscriber.onDecodeError += bind(&EndToEndFixture::afterDecodeError, this, _1);
+
+  // not received when subscriber is not running
+  this->deliverNotification("n1");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK(lastNotification.getMessage().empty());
+  BOOST_CHECK_EQUAL(subscriberFace->m_sentInterests.size(), 0);
+
+  subscriberFace->m_sentInterests.clear();
+  subscriber.start();
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_REQUIRE_EQUAL(subscriber.isRunning(), true);
+  BOOST_CHECK(this->hasInitialRequest());
+
+  // respond to initial request
+  subscriberFace->m_sentInterests.clear();
+  this->deliverNotification("n2");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n2");
+  BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
+
+  // respond to continuation request
+  subscriberFace->m_sentInterests.clear();
+  this->deliverNotification("n3");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n3");
+  BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
+
+  // timeout
+  subscriberFace->m_sentInterests.clear();
+  lastNotification.setMessage("");
+  subscriberFace->processEvents(
+    NotificationSubscriber<SimpleNotification>::getInterestLifetime() +
+    time::milliseconds(1000));
+  BOOST_CHECK(lastNotification.getMessage().empty());
+  BOOST_CHECK_EQUAL(hasTimeout, true);
+  BOOST_CHECK(this->hasInitialRequest());
+
+  // decode error on sequence number
+  Name wrongName = streamPrefix;
+  wrongName.append("%07%07");
+  Data wrongData(wrongName);
+  publisherKeyChain.sign(wrongData);
+  subscriberFace->receive(wrongData);
+  subscriberFace->m_sentInterests.clear();
+  lastNotification.setMessage("");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK(lastNotification.getMessage().empty());
+  BOOST_CHECK_EQUAL(lastDecodeErrorData.getName(), wrongName);
+  BOOST_CHECK(this->hasInitialRequest());
+
+  // decode error in payload
+  subscriberFace->m_sentInterests.clear();
+  lastNotification.setMessage("");
+  this->deliverNotification("\x07n4");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK(lastNotification.getMessage().empty());
+  BOOST_CHECK(this->hasInitialRequest());
+
+  // stop if handlers are cleared
+  subscriber.onNotification += bind(&EndToEndFixture::clearNotificationHandlers, this);
+  subscriberFace->m_sentInterests.clear();
+  this->deliverNotification("n5");
+  subscriberFace->processEvents(time::milliseconds(10));
+  BOOST_CHECK_EQUAL(subscriberFace->m_sentInterests.size(), 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/core/segment-publisher.cpp b/tests/core/segment-publisher.cpp
index f859408..8817669 100644
--- a/tests/core/segment-publisher.cpp
+++ b/tests/core/segment-publisher.cpp
@@ -26,7 +26,7 @@
 #include "core/segment-publisher.hpp"
 
 #include "tests/test-common.hpp"
-#include "tests/dummy-face.hpp"
+#include "tests/dummy-client-face.hpp"
 
 #include <ndn-cxx/encoding/tlv.hpp>
 
@@ -38,10 +38,10 @@
 NFD_LOG_INIT("SegmentPublisherTest");
 
 template<int64_t N=10000>
-class TestSegmentPublisher : public SegmentPublisher<DummyFace>
+class TestSegmentPublisher : public SegmentPublisher<DummyClientFace>
 {
 public:
-  TestSegmentPublisher(DummyFace& face,
+  TestSegmentPublisher(DummyClientFace& face,
                        const Name& prefix,
                        ndn::KeyChain& keyChain)
     : SegmentPublisher(face, prefix, keyChain)
@@ -90,7 +90,7 @@
 {
 public:
   SegmentPublisherFixture()
-    : m_face(makeDummyFace())
+    : m_face(makeDummyClientFace())
     , m_publisher(*m_face, "/localhost/nfd/SegmentPublisherFixture", m_keyChain)
   {
   }
@@ -134,7 +134,7 @@
   }
 
 protected:
-  shared_ptr<DummyFace> m_face;
+  shared_ptr<DummyClientFace> m_face;
   TestSegmentPublisher<N> m_publisher;
   ndn::EncodingBuffer m_buffer;
   ndn::KeyChain m_keyChain;
diff --git a/tests/core/simple-notification.hpp b/tests/core/simple-notification.hpp
new file mode 100644
index 0000000..3c8fdef
--- /dev/null
+++ b/tests/core/simple-notification.hpp
@@ -0,0 +1,94 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
+#define NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
+
+#include "common.hpp"
+
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+class SimpleNotification
+{
+public:
+  SimpleNotification()
+  {
+  }
+
+  SimpleNotification(const std::string& message)
+    : m_message(message)
+  {
+  }
+
+  ~SimpleNotification()
+  {
+  }
+
+  Block
+  wireEncode() const
+  {
+    ndn::EncodingBuffer buffer;
+    prependByteArrayBlock(buffer,
+                          0x8888,
+                          reinterpret_cast<const uint8_t*>(m_message.c_str()),
+                          m_message.size());
+    return buffer.block();
+  }
+
+  void
+  wireDecode(const Block& block)
+  {
+    m_message.assign(reinterpret_cast<const char*>(block.value()),
+                     block.value_size());
+
+    // error for testing
+    if (!m_message.empty() && m_message[0] == '\x07')
+      throw tlv::Error("0x07 error");
+  }
+
+public:
+  const std::string&
+  getMessage() const
+  {
+    return m_message;
+  }
+
+  void
+  setMessage(const std::string& message)
+  {
+    m_message = message;
+  }
+
+private:
+  std::string m_message;
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_CORE_SIMPLE_NOTIFICATION_HPP
diff --git a/tests/daemon/mgmt/notification-stream.cpp b/tests/daemon/mgmt/notification-stream.cpp
deleted file mode 100644
index f64e50b..0000000
--- a/tests/daemon/mgmt/notification-stream.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014,  Regents of the University of California,
- *                      Arizona Board of Regents,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University,
- *                      Washington University in St. Louis,
- *                      Beijing Institute of Technology,
- *                      The University of Memphis
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/notification-stream.hpp"
-#include "mgmt/internal-face.hpp"
-
-#include "tests/test-common.hpp"
-
-
-namespace nfd {
-namespace tests {
-
-NFD_LOG_INIT("NotificationStreamTest");
-
-
-
-class NotificationStreamFixture : public BaseFixture
-{
-public:
-  NotificationStreamFixture()
-    : m_callbackFired(false)
-    , m_prefix("/localhost/nfd/NotificationStreamTest")
-    , m_message("TestNotificationMessage")
-    , m_sequenceNo(0)
-  {
-  }
-
-  virtual
-  ~NotificationStreamFixture()
-  {
-  }
-
-  void
-  validateCallback(const Data& data)
-  {
-    Name expectedName(m_prefix);
-    expectedName.appendSegment(m_sequenceNo);
-    BOOST_REQUIRE_EQUAL(data.getName(), expectedName);
-
-    ndn::Block payload = data.getContent();
-    std::string message;
-
-    message.append(reinterpret_cast<const char*>(payload.value()), payload.value_size());
-
-    BOOST_REQUIRE_EQUAL(message, m_message);
-
-    m_callbackFired = true;
-    ++m_sequenceNo;
-  }
-
-  void
-  resetCallbackFired()
-  {
-    m_callbackFired = false;
-  }
-
-protected:
-  bool m_callbackFired;
-  const std::string m_prefix;
-  const std::string m_message;
-  uint64_t m_sequenceNo;
-  ndn::KeyChain m_keyChain;
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtNotificationStream, NotificationStreamFixture)
-
-class TestNotification
-{
-public:
-  TestNotification(const std::string& message)
-    : m_message(message)
-  {
-  }
-
-  ~TestNotification()
-  {
-  }
-
-  Block
-  wireEncode() const
-  {
-    ndn::EncodingBuffer buffer;
-
-    prependByteArrayBlock(buffer,
-                          ndn::Tlv::Content,
-                          reinterpret_cast<const uint8_t*>(m_message.c_str()),
-                          m_message.size());
-    return buffer.block();
-  }
-
-private:
-  const std::string m_message;
-};
-
-BOOST_AUTO_TEST_CASE(TestPostEvent)
-{
-  shared_ptr<InternalFace> face(make_shared<InternalFace>());
-  NotificationStream notificationStream(face, "/localhost/nfd/NotificationStreamTest", m_keyChain);
-
-  face->onReceiveData += bind(&NotificationStreamFixture::validateCallback, this, _1);
-
-  TestNotification event1(m_message);
-  notificationStream.postNotification(event1);
-
-  BOOST_REQUIRE(m_callbackFired);
-
-  resetCallbackFired();
-
-  TestNotification event2(m_message);
-  notificationStream.postNotification(event2);
-
-  BOOST_REQUIRE(m_callbackFired);
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-
-} // namespace tests
-} // namespace nfd
diff --git a/tests/dummy-face.hpp b/tests/dummy-client-face.hpp
similarity index 73%
rename from tests/dummy-face.hpp
rename to tests/dummy-client-face.hpp
index 84da29f..2e8781d 100644
--- a/tests/dummy-face.hpp
+++ b/tests/dummy-client-face.hpp
@@ -23,8 +23,8 @@
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef NFD_TESTS_DUMMY_FACE_HPP
-#define NFD_TESTS_DUMMY_FACE_HPP
+#ifndef NFD_TESTS_DUMMY_CLIENT_FACE_HPP
+#define NFD_TESTS_DUMMY_CLIENT_FACE_HPP
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/transport/transport.hpp>
@@ -32,13 +32,14 @@
 namespace nfd {
 namespace tests {
 
-class DummyTransport : public ndn::Transport
+class DummyClientTransport : public ndn::Transport
 {
 public:
   void
   receive(const Block& block)
   {
-    m_receiveCallback(block);
+    if (static_cast<bool>(m_receiveCallback))
+      m_receiveCallback(block);
   }
 
   virtual void
@@ -79,13 +80,13 @@
 };
 
 
-/** \brief a Face for unit testing
+/** \brief a client-side face for unit testing
  */
-class DummyFace : public ndn::Face
+class DummyClientFace : public ndn::Face
 {
 public:
   explicit
-  DummyFace(shared_ptr<DummyTransport> transport)
+  DummyClientFace(shared_ptr<DummyClientTransport> transport)
     : Face(transport)
     , m_transport(transport)
   {
@@ -103,20 +104,28 @@
   }
 
 public:
+  /** \brief sent Interests
+   *  \note After .expressInterest, .processEvents must be called before
+   *        the Interest would show up here.
+   */
   std::vector<Interest> m_sentInterests;
+  /** \brief sent Datas
+   *  \note After .put, .processEvents must be called before
+   *        the Interest would show up here.
+   */
   std::vector<Data>     m_sentDatas;
 
 private:
-  shared_ptr<DummyTransport> m_transport;
+  shared_ptr<DummyClientTransport> m_transport;
 };
 
-inline shared_ptr<DummyFace>
-makeDummyFace()
+inline shared_ptr<DummyClientFace>
+makeDummyClientFace()
 {
-  return make_shared<DummyFace>(make_shared<DummyTransport>());
+  return make_shared<DummyClientFace>(make_shared<DummyClientTransport>());
 }
 
 } // namespace tests
 } // namespace nfd
 
-#endif // NFD_TESTS_DUMMY_FACE_HPP
+#endif // NFD_TESTS_DUMMY_CLIENT_FACE_HPP
diff --git a/tests/rib/rib-manager.cpp b/tests/rib/rib-manager.cpp
index 8a30684..593517f 100644
--- a/tests/rib/rib-manager.cpp
+++ b/tests/rib/rib-manager.cpp
@@ -26,7 +26,7 @@
 #include "rib/rib-manager.hpp"
 
 #include "tests/test-common.hpp"
-#include "tests/dummy-face.hpp"
+#include "tests/dummy-client-face.hpp"
 #include "rib/rib-status-publisher-common.hpp"
 
 namespace nfd {
@@ -41,7 +41,7 @@
     , ADD_NEXTHOP_VERB("add-nexthop")
     , REMOVE_NEXTHOP_VERB("remove-nexthop")
   {
-    face = nfd::tests::makeDummyFace();
+    face = nfd::tests::makeDummyClientFace();
 
     manager = make_shared<RibManager>(ndn::ref(*face));
     manager->registerWithNfd();
@@ -81,7 +81,7 @@
 
 public:
   shared_ptr<RibManager> manager;
-  shared_ptr<nfd::tests::DummyFace> face;
+  shared_ptr<nfd::tests::DummyClientFace> face;
 
   const Name COMMAND_PREFIX;
   const Name::Component ADD_NEXTHOP_VERB;
diff --git a/tests/rib/rib-status-publisher.cpp b/tests/rib/rib-status-publisher.cpp
index ac68c63..5253bba 100644
--- a/tests/rib/rib-status-publisher.cpp
+++ b/tests/rib/rib-status-publisher.cpp
@@ -26,7 +26,7 @@
 #include "rib/rib-status-publisher.hpp"
 
 #include "rib-status-publisher-common.hpp"
-#include "tests/dummy-face.hpp"
+#include "tests/dummy-client-face.hpp"
 
 namespace nfd {
 namespace rib {
@@ -47,7 +47,7 @@
   rib.insert(name, entry);
 
   ndn::KeyChain keyChain;
-  shared_ptr<nfd::tests::DummyFace> face = nfd::tests::makeDummyFace();
+  shared_ptr<nfd::tests::DummyClientFace> face = nfd::tests::makeDummyClientFace();
   RibStatusPublisher publisher(rib, *face, "/localhost/nfd/rib/list", keyChain);
 
   publisher.publish();