seznam / SuperiorMySqlpp

SuperiorMySQL++
GNU Lesser General Public License v3.0
31 stars 20 forks source link

Added ConnectionConfig including tests #22

Closed jirislav closed 6 years ago

jirislav commented 8 years ago

ConnectionConfig is a class which should solve the problem with ambiguity while calling Connection c'tor with only host / socket defined (compiler error)

Here is the default value for c'tor with socket unset for socket so that there is no more ambiguity and is added a ConnectionConfig class instead. It provides two static factory methods for both TCP Connection & Socketed Connection with as much default values as possible.

Tests were working in a way that the host (machine the tests are ran from) is connected to Dockerized MySQL server via TCP using Docker IP by default.

So - in order to create tests for socketed connection I've come up with a socket -> socket tunnel via TCP. It works in a way that host creates socket, where the tests try to connect. This socket is only a traffic forwarder to 3307 port of the Docker instance of tested MySQL server. The docker instance has listener on port 3307 forwarding all traffic to mysqld socket. So there actually is a socketed connection - but relies on TCP. (Any ideas how to do socketed connection tests better while is the testing environment still being in Docker?)

The work was initiated by Issue #4

smradCZ commented 6 years ago

README.md is updated, please check it.