1818
1919#include " auth.hpp"
2020#include " connector.hpp"
21- #include " delayed_connector.hpp"
2221#include " constants.hpp"
22+ #include " delayed_connector.hpp"
2323#include " request_callback.hpp"
2424#include " ssl.hpp"
2525
@@ -120,7 +120,7 @@ TEST_F(ConnectionUnitTest, Simple) {
120120 ASSERT_EQ (cluster.start_all (), 0 );
121121
122122 State state;
123- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
123+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
124124 PROTOCOL_VERSION,
125125 bind_callback (on_connection_connected, &state)));
126126
@@ -141,7 +141,7 @@ TEST_F(ConnectionUnitTest, Keyspace) {
141141 ASSERT_EQ (cluster.start_all (), 0 );
142142
143143 State state;
144- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
144+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
145145 PROTOCOL_VERSION,
146146 bind_callback (on_connection_connected, &state)));
147147
@@ -161,7 +161,7 @@ TEST_F(ConnectionUnitTest, Auth) {
161161 ASSERT_EQ (cluster.start_all (), 0 );
162162
163163 State state;
164- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
164+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
165165 PROTOCOL_VERSION,
166166 bind_callback (on_connection_connected, &state)));
167167
@@ -183,7 +183,7 @@ TEST_F(ConnectionUnitTest, Ssl) {
183183 ASSERT_EQ (cluster.start_all (), 0 );
184184
185185 State state;
186- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
186+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
187187 PROTOCOL_VERSION,
188188 bind_callback (on_connection_connected, &state)));
189189 connector
@@ -199,7 +199,7 @@ TEST_F(ConnectionUnitTest, Refused) {
199199 // Don't start cluster
200200
201201 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
202- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
202+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
203203 PROTOCOL_VERSION,
204204 bind_callback (on_connection_error_code, &error_code)));
205205 connector->connect (loop ());
@@ -218,7 +218,7 @@ TEST_F(ConnectionUnitTest, Close) {
218218
219219 bool is_closed (false );
220220 for (size_t i = 0 ; i < 10 ; ++i) {
221- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
221+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
222222 PROTOCOL_VERSION,
223223 bind_callback (on_connection_close, &is_closed)));
224224 connector->connect (loop ());
@@ -240,7 +240,7 @@ TEST_F(ConnectionUnitTest, SslClose) {
240240
241241 bool is_closed (false );
242242 for (size_t i = 0 ; i < 10 ; ++i) {
243- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
243+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
244244 PROTOCOL_VERSION,
245245 bind_callback (on_connection_close, &is_closed)));
246246 connector
@@ -262,7 +262,7 @@ TEST_F(ConnectionUnitTest, Cancel) {
262262
263263 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
264264 for (size_t i = 0 ; i < 10 ; ++i) {
265- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
265+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
266266 PROTOCOL_VERSION,
267267 bind_callback (on_connection_error_code, &error_code)));
268268 connector->connect (loop ());
@@ -290,7 +290,7 @@ TEST_F(ConnectionUnitTest, SslCancel) {
290290
291291 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
292292 for (size_t i = 0 ; i < 10 ; ++i) {
293- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
293+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
294294 PROTOCOL_VERSION,
295295 bind_callback (on_connection_error_code, &error_code)));
296296 connector
@@ -318,7 +318,7 @@ TEST_F(ConnectionUnitTest, Timeout) {
318318 ASSERT_EQ (cluster.start_all (), 0 );
319319
320320 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
321- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
321+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
322322 PROTOCOL_VERSION,
323323 bind_callback (on_connection_error_code, &error_code)));
324324
@@ -344,7 +344,7 @@ TEST_F(ConnectionUnitTest, InvalidKeyspace) {
344344 ASSERT_EQ (cluster.start_all (), 0 );
345345
346346 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
347- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
347+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
348348 PROTOCOL_VERSION,
349349 bind_callback (on_connection_error_code, &error_code)));
350350 connector
@@ -361,7 +361,7 @@ TEST_F(ConnectionUnitTest, InvalidProtocol) {
361361 ASSERT_EQ (cluster.start_all (), 0 );
362362
363363 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
364- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
364+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
365365 0x7F , // Invalid protocol version
366366 bind_callback (on_connection_error_code, &error_code)));
367367 connector
@@ -379,7 +379,7 @@ TEST_F(ConnectionUnitTest, DeprecatedProtocol) {
379379 cluster.start_all ();
380380
381381 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
382- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
382+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
383383 PROTOCOL_VERSION,
384384 bind_callback (on_connection_error_code, &error_code)));
385385 connector
@@ -395,7 +395,7 @@ TEST_F(ConnectionUnitTest, InvalidAuth) {
395395 ASSERT_EQ (cluster.start_all (), 0 );
396396
397397 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
398- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
398+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
399399 PROTOCOL_VERSION,
400400 bind_callback (on_connection_error_code, &error_code)));
401401
@@ -416,7 +416,7 @@ TEST_F(ConnectionUnitTest, InvalidNoSsl) {
416416 ASSERT_EQ (cluster.start_all (), 0 ); // Start without ssl
417417
418418 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
419- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
419+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
420420 PROTOCOL_VERSION,
421421 bind_callback (on_connection_error_code, &error_code)));
422422
@@ -441,7 +441,7 @@ TEST_F(ConnectionUnitTest, InvalidSsl) {
441441 ASSERT_EQ (cluster.start_all (), 0 );
442442
443443 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
444- Connector::Ptr connector (new Connector (Address (" 127.0.0.1" , PORT),
444+ Connector::Ptr connector (new Connector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
445445 PROTOCOL_VERSION,
446446 bind_callback (on_connection_error_code, &error_code)));
447447
@@ -465,7 +465,7 @@ TEST_F(ConnectionUnitTest, Delayed) {
465465 ASSERT_EQ (cluster.start_all (), 0 );
466466
467467 State state;
468- DelayedConnector::Ptr connector (new DelayedConnector (Address (" 127.0.0.1" , PORT),
468+ DelayedConnector::Ptr connector (new DelayedConnector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
469469 PROTOCOL_VERSION,
470470 bind_callback (on_delayed_connected, &state)));
471471
@@ -481,7 +481,7 @@ TEST_F(ConnectionUnitTest, DelayedCancel) {
481481 ASSERT_EQ (cluster.start_all (), 0 );
482482
483483 State state;
484- DelayedConnector::Ptr connector (new DelayedConnector (Address (" 127.0.0.1" , PORT),
484+ DelayedConnector::Ptr connector (new DelayedConnector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
485485 PROTOCOL_VERSION,
486486 bind_callback (on_delayed_connected, &state)));
487487
@@ -497,7 +497,7 @@ TEST_F(ConnectionUnitTest, DelayedCancel) {
497497
498498 Connector::ConnectionError error_code (Connector::CONNECTION_OK);
499499 for (size_t i = 0 ; i < 10 ; ++i) {
500- DelayedConnector::Ptr connector (new DelayedConnector (Address (" 127.0.0.1" , PORT),
500+ DelayedConnector::Ptr connector (new DelayedConnector (Host::Ptr ( new Host ( Address (" 127.0.0.1" , PORT)) ),
501501 PROTOCOL_VERSION,
502502 bind_callback (on_delayed_error_code, &error_code)));
503503 connector->delayed_connect (loop (), 500 );
0 commit comments