From 91ad1f4ee71dc8e945e9be7b85f7d4e0ddcf4156 Mon Sep 17 00:00:00 2001 From: AlexRa Date: Mon, 17 May 2010 12:37:49 +0300 Subject: Added generic base classes for testing database services These are some generic classes that simplify writing tests for any of the data connectors and databases. Among other things, configuring the connection strings is done once, in a separate resource file. Tests based on the new BasicDataServiceTest class require NUnit 2.5 or better. --- OpenSim/Data/Tests/Resources/TestDataConnections.ini | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 OpenSim/Data/Tests/Resources/TestDataConnections.ini (limited to 'OpenSim/Data/Tests/Resources') diff --git a/OpenSim/Data/Tests/Resources/TestDataConnections.ini b/OpenSim/Data/Tests/Resources/TestDataConnections.ini new file mode 100644 index 0000000..d149744 --- /dev/null +++ b/OpenSim/Data/Tests/Resources/TestDataConnections.ini @@ -0,0 +1,7 @@ +; The default connections to the test databases. Used by tests based on BasicDataServiceTest.cs. +; Read by code in DefaultTestConns.cs + +[TestConnections] +MySqlConnection="Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;" +;SqlConnection="..." +;SqliteConnection="..." \ No newline at end of file -- cgit v1.1 From 330ad501a5b1933ad041cd13676548701170c56d Mon Sep 17 00:00:00 2001 From: AlexRa Date: Fri, 21 May 2010 15:47:37 +0300 Subject: Added MS SQL test conn to INI - only as an example, modify before use!!! NOTE that this INI file is currently loaded as a embedded RESOURCE, which is weird and has a disadvantage of having to rebuild the Tests whenever the conn strings are changed. The only reason is that I couldn't figure out a reliable way to put this INI into the correct dir at runtime. If somebody can do it, that would be cool. --- .../Data/Tests/Resources/TestDataConnections.ini | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'OpenSim/Data/Tests/Resources') diff --git a/OpenSim/Data/Tests/Resources/TestDataConnections.ini b/OpenSim/Data/Tests/Resources/TestDataConnections.ini index d149744..5e68ab0 100644 --- a/OpenSim/Data/Tests/Resources/TestDataConnections.ini +++ b/OpenSim/Data/Tests/Resources/TestDataConnections.ini @@ -1,7 +1,24 @@ -; The default connections to the test databases. Used by tests based on BasicDataServiceTest.cs. -; Read by code in DefaultTestConns.cs +; The default connections to the test databases. Used by all data tests based on BasicDataServiceTest.cs. +; This is read by code in DefaultTestConns.cs. + +; NOTE that this INI file is currently loaded as a embedded RESOURCE, which is weird and has a +; disadvantage of having to rebuild the Tests whenever the conn strings are changed. +; The only reason is that I couldn't figure out a reliable way to put this INI into the correct +; dir at runtime. If somebody can do it, that would be cool. + +; I'm using a local MSDE server for testing. Obviously, you'll have to modify +; the conn string to whatever MS SQL server is available to you. + +; If any of the conn strings is commented out, emty or not valid on your system, +; the relevant tests will be ignored, rather than fail. + +; As to SQLite, if the conn string here is empty, it will work anyway using a temporary +; file for the DB. If you want the resulting DB to persist (e.g. for performance testing, +; when filling up the tables can take a long time), explicitly specify a conn string like this: + +; SqliteConnection="URI=file:,version=3" [TestConnections] MySqlConnection="Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;" -;SqlConnection="..." -;SqliteConnection="..." \ No newline at end of file +SqlConnection="Server=.\SQL2008;Database=opensim-nunit;Trusted_Connection=True;" +SqliteConnection="" \ No newline at end of file -- cgit v1.1