1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using System;
- using NUnit.Framework;
- using OpenSim.Data.Tests;
- using log4net;
- using System.Reflection;
- using OpenSim.Tests.Common;
- namespace OpenSim.Data.MySQL.Tests
- {
- [TestFixture, DatabaseTest]
- public class MySQLGridTest : BasicGridTest
- {
- 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]
- public void Init()
- {
- SuperInit();
-
-
-
-
- try
- {
- database = new MySQLManager(connect);
- db = new MySQLGridData();
- db.Initialise(connect);
- }
- catch (Exception e)
- {
- m_log.Error("Exception {0}", e);
- Assert.Ignore();
- }
-
- Assembly assem = GetType().Assembly;
- Migration m = new Migration(database.Connection, assem, "GridStore");
- m.Update();
- }
- [TestFixtureTearDown]
- public void Cleanup()
- {
- m_log.Warn("Cleaning up.");
- if (db != null)
- {
- db.Dispose();
- }
-
- if (database != null)
- {
- database.ExecuteSql("drop table migrations");
- database.ExecuteSql("drop table regions");
- }
- }
- }
- }
|