SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Unit Testing - Shared connection

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Unit Testing - Shared connection
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1683

Post Unit Testing - Shared connection Reply with quote
How does connection sharing works in Unit Testing? I had some presumptions but none of them seem to be entirely correct.

I believed it would share the connection with the Tab that was active when the Unit Testing was invoked/started. But it seems they only share the connection settings, not the actual connection.
The Tab I invoked UT from used connection1, which by default connects to database1 but was now connected to database2. The UT window does not show the connection status, so I thought it would also connect to database2 but it did not, it connected to the default database1.

Also, it does not display the used connection and the current connection status anywhere in the UT window, therefore I can only guess (or use something equivalent to SELECT DB() if it exists) which database/schema is it connected to currently. This connection sharing is a bit confusing. Could the Unit Testing window get its own connection (or at least an indicator for which connection is being used and what database it is connected to)?
Thu May 21, 2020 4:11 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7066

Post Reply with quote
The Unit Test project doesn't save connection settings in the project file. In interactive move the project is run using saved settings of the current connection. If you run it from the command line, then you need to specific the connection details explicitly.

Does this help?
Thu May 21, 2020 2:53 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1683

Post Reply with quote
That works splendidly when the tests are deployed for automated use. But while developing the tests it would be nice to have greater control over that. It's inconvenient to change the database and impossible to change the server. I have to close the Unit Testing window, open a Tab in SE that uses the correct connection, restart Unit Testing, and only then can I reopen the Unit Testing project. It's rather difficult compared to the Connection dialog of SE and even that one in SE could be optimized further. The Connection dialog is absolutely necessary when adding new connections or modifying existing ones. For the quite common task of switching between existing connections, a simple dropdown in front of the one for choosing the current database would suffice. It would be much faster too.

I can also understand if you don't want to touch that. These nuances only come out after intensive use so most users probably don't even notice.
Thu May 21, 2020 5:58 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.