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/MySQLAssetTest.cs | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs')
diff --git a/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs b/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs
index e1d3f81..a46fdf8 100644
--- a/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs
+++ b/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs
@@ -31,6 +31,7 @@ using OpenSim.Data.Tests;
using log4net;
using System.Reflection;
using OpenSim.Tests.Common;
+using MySql.Data.MySqlClient;
namespace OpenSim.Data.MySQL.Tests
{
@@ -39,7 +40,7 @@ namespace OpenSim.Data.MySQL.Tests
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public string file;
- public MySQLManager database;
+ private string m_connectionString;
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);
db = new MySQLAssetData();
db.Initialise(connect);
}
@@ -70,10 +70,22 @@ namespace OpenSim.Data.MySQL.Tests
{
db.Dispose();
}
- if (database != null)
+ ExecuteSql("drop table migrations");
+ ExecuteSql("drop table assets");
+ }
+
+ ///
+ /// Execute a MySqlCommand
+ ///
+ /// sql string to execute
+ private void ExecuteSql(string sql)
+ {
+ using (MySqlConnection dbcon = new MySqlConnection(connect))
{
- database.ExecuteSql("drop table migrations");
- database.ExecuteSql("drop table assets");
+ dbcon.Open();
+
+ MySqlCommand cmd = new MySqlCommand(sql, dbcon);
+ cmd.ExecuteNonQuery();
}
}
}
--
cgit v1.1