face: Adding new 'createFace' method in all Factories
This method accepts parsed URI object and attempts to create Face on the
right channel (e.g., if hostname in URI resolved to IPv6, IPv6 TCP channel
will be used).
Factories that do not support 'createFace' operation will throw an exception.
As of this commit, *Factory::create methods are renamed to more explicit
*Factory::createChannel, and *Factory::connect to *Factory::createFace.
All other Factory-specific methods should denote what exactly is
created: channel, face, or multicast face.
Change-Id: I6396dc84c4cd8bbcdde9f55cfac90635d99e93e9
Refs: #1195
diff --git a/tests/face/ethernet.cpp b/tests/face/ethernet.cpp
index f2e7134..9322d4c 100644
--- a/tests/face/ethernet.cpp
+++ b/tests/face/ethernet.cpp
@@ -22,18 +22,21 @@
if (interfaces.size() > 0)
{
shared_ptr<EthernetFace> face1;
- BOOST_REQUIRE_NO_THROW(face1 = factory.createMulticast(interfaces[0],
- ethernet::getBroadcastAddress()));
+ BOOST_REQUIRE_NO_THROW(face1 =
+ factory.createMulticastFace(interfaces[0],
+ ethernet::getBroadcastAddress()));
shared_ptr<EthernetFace> face1bis;
- BOOST_REQUIRE_NO_THROW(face1bis = factory.createMulticast(interfaces[0],
- ethernet::getBroadcastAddress()));
+ BOOST_REQUIRE_NO_THROW(face1bis =
+ factory.createMulticastFace(interfaces[0],
+ ethernet::getBroadcastAddress()));
BOOST_CHECK_EQUAL(face1, face1bis);
if (interfaces.size() > 1)
{
shared_ptr<EthernetFace> face2;
- BOOST_REQUIRE_NO_THROW(face2 = factory.createMulticast(interfaces[1],
- ethernet::getBroadcastAddress()));
+ BOOST_REQUIRE_NO_THROW(face2 =
+ factory.createMulticastFace(interfaces[1],
+ ethernet::getBroadcastAddress()));
BOOST_CHECK_NE(face1, face2);
}
else
@@ -43,8 +46,9 @@
}
shared_ptr<EthernetFace> face3;
- BOOST_REQUIRE_NO_THROW(face3 = factory.createMulticast(interfaces[0],
- ethernet::getDefaultMulticastAddress()));
+ BOOST_REQUIRE_NO_THROW(face3 =
+ factory.createMulticastFace(interfaces[0],
+ ethernet::getDefaultMulticastAddress()));
BOOST_CHECK_NE(face1, face3);
}
else
@@ -67,7 +71,7 @@
}
shared_ptr<EthernetFace> face =
- factory.createMulticast(interfaces[0], ethernet::getDefaultMulticastAddress());
+ factory.createMulticastFace(interfaces[0], ethernet::getDefaultMulticastAddress());
BOOST_REQUIRE(static_cast<bool>(face));
BOOST_CHECK_EQUAL(face->isLocal(), false);