From bb171717ceaef37b022a135209c2e0bf031d21f9 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 21 Feb 2010 15:38:52 -0800
Subject: Deleted obsolete files in the Data layer. Compiles.
---
OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs | 30 ++++++++++++++++++--------
1 file changed, 21 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs')
diff --git a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs
index a3a32dc..4575493 100644
--- a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs
+++ b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs
@@ -31,6 +31,8 @@ using OpenSim.Data.Tests;
using log4net;
using System.Reflection;
using OpenSim.Tests.Common;
+using MySql.Data.MySqlClient;
+
namespace OpenSim.Data.MySQL.Tests
{
@@ -39,7 +41,6 @@ namespace OpenSim.Data.MySQL.Tests
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public string file;
- public MySQLManager database;
public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;";
[TestFixtureSetUp]
@@ -52,7 +53,6 @@ namespace OpenSim.Data.MySQL.Tests
// tests.
try
{
- database = new MySQLManager(connect);
DropTables();
db = new MySQLInventoryData();
db.Initialise(connect);
@@ -71,17 +71,29 @@ namespace OpenSim.Data.MySQL.Tests
{
db.Dispose();
}
- if (database != null)
- {
- DropTables();
- }
+ DropTables();
}
private void DropTables()
{
- database.ExecuteSql("drop table IF EXISTS inventoryitems");
- database.ExecuteSql("drop table IF EXISTS inventoryfolders");
- database.ExecuteSql("drop table IF EXISTS migrations");
+ ExecuteSql("drop table IF EXISTS inventoryitems");
+ ExecuteSql("drop table IF EXISTS inventoryfolders");
+ ExecuteSql("drop table IF EXISTS migrations");
+ }
+
+ ///
+ /// Execute a MySqlCommand
+ ///
+ /// sql string to execute
+ private void ExecuteSql(string sql)
+ {
+ using (MySqlConnection dbcon = new MySqlConnection(connect))
+ {
+ dbcon.Open();
+
+ MySqlCommand cmd = new MySqlCommand(sql, dbcon);
+ cmd.ExecuteNonQuery();
+ }
}
}
}
--
cgit v1.1