From a70efd1fdf6a8de57e8129a27fbc8ba94535b2ab Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 23 Sep 2008 21:03:03 +0000 Subject: [PATCH] create the first attempted mysql test. This only runs locally if you have a database configured as opensim-nunit with user opensim-nunit / password opensim-nunit that has full perms on the database. --- .../Data/MySQL/Tests/MySQLInventoryTest.cs | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs index c856b9ab08..c299452c10 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs @@ -43,24 +43,35 @@ namespace OpenSim.Data.MySQL.Tests public class MySQLInventoryTest : BasicInventoryTest { public string file; - public string connect; + public MySQLManager database; + public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; [TestFixtureSetUp] public void Init() { SuperInit(); - - Assert.Ignore(); - - file = Path.GetTempFileName() + ".db"; - connect = "URI=file:" + file + ",version=3"; - + try + { + database = new MySQLManager(connect); + db = new MySQLInventoryData(); + db.Initialise(connect); + } + catch (Exception e) + { + System.Console.WriteLine("Exception {0}", e); + Assert.Ignore(); + } } [TestFixtureTearDown] public void Cleanup() { - + if (database != null) + { + database.ExecuteSql("drop table migrations"); + database.ExecuteSql("drop table inventoryitems"); + database.ExecuteSql("drop table inventoryfolders"); + } } } }