diff options
author | Diva Canto | 2010-02-21 15:38:52 -0800 |
---|---|---|
committer | Diva Canto | 2010-02-21 15:38:52 -0800 |
commit | bb171717ceaef37b022a135209c2e0bf031d21f9 (patch) | |
tree | 2239ad031280027839b22c4f3c9df1a598a63228 /OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs | |
parent | Bug fixes on field names in order to make data import work from old users tab... (diff) | |
download | opensim-SC_OLD-bb171717ceaef37b022a135209c2e0bf031d21f9.zip opensim-SC_OLD-bb171717ceaef37b022a135209c2e0bf031d21f9.tar.gz opensim-SC_OLD-bb171717ceaef37b022a135209c2e0bf031d21f9.tar.bz2 opensim-SC_OLD-bb171717ceaef37b022a135209c2e0bf031d21f9.tar.xz |
Deleted obsolete files in the Data layer. Compiles.
Diffstat (limited to 'OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs')
-rw-r--r-- | OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs index 0dc8b7d..e7e57e4 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs | |||
@@ -31,6 +31,7 @@ using OpenSim.Data.Tests; | |||
31 | using log4net; | 31 | using log4net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using OpenSim.Tests.Common; | 33 | using OpenSim.Tests.Common; |
34 | using MySql.Data.MySqlClient; | ||
34 | 35 | ||
35 | namespace OpenSim.Data.MySQL.Tests | 36 | namespace OpenSim.Data.MySQL.Tests |
36 | { | 37 | { |
@@ -39,7 +40,6 @@ namespace OpenSim.Data.MySQL.Tests | |||
39 | { | 40 | { |
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | public string file; | 42 | public string file; |
42 | public MySQLManager database; | ||
43 | public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; | 43 | public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; |
44 | 44 | ||
45 | [TestFixtureSetUp] | 45 | [TestFixtureSetUp] |
@@ -52,9 +52,8 @@ namespace OpenSim.Data.MySQL.Tests | |||
52 | // tests. | 52 | // tests. |
53 | try | 53 | try |
54 | { | 54 | { |
55 | database = new MySQLManager(connect); | ||
56 | // this is important in case a previous run ended badly | 55 | // this is important in case a previous run ended badly |
57 | ClearDB(database); | 56 | ClearDB(); |
58 | 57 | ||
59 | db = new MySQLDataStore(); | 58 | db = new MySQLDataStore(); |
60 | db.Initialise(connect); | 59 | db.Initialise(connect); |
@@ -73,28 +72,40 @@ namespace OpenSim.Data.MySQL.Tests | |||
73 | { | 72 | { |
74 | db.Dispose(); | 73 | db.Dispose(); |
75 | } | 74 | } |
76 | ClearDB(database); | 75 | ClearDB(); |
77 | } | 76 | } |
78 | 77 | ||
79 | private void ClearDB(MySQLManager manager) | 78 | private void ClearDB() |
80 | { | 79 | { |
81 | if (manager != null) | 80 | ExecuteSql("drop table if exists migrations"); |
81 | ExecuteSql("drop table if exists prims"); | ||
82 | ExecuteSql("drop table if exists primshapes"); | ||
83 | ExecuteSql("drop table if exists primitems"); | ||
84 | ExecuteSql("drop table if exists terrain"); | ||
85 | ExecuteSql("drop table if exists land"); | ||
86 | ExecuteSql("drop table if exists landaccesslist"); | ||
87 | ExecuteSql("drop table if exists regionban"); | ||
88 | ExecuteSql("drop table if exists regionsettings"); | ||
89 | ExecuteSql("drop table if exists estate_managers"); | ||
90 | ExecuteSql("drop table if exists estate_groups"); | ||
91 | ExecuteSql("drop table if exists estate_users"); | ||
92 | ExecuteSql("drop table if exists estateban"); | ||
93 | ExecuteSql("drop table if exists estate_settings"); | ||
94 | ExecuteSql("drop table if exists estate_map"); | ||
95 | } | ||
96 | |||
97 | /// <summary> | ||
98 | /// Execute a MySqlCommand | ||
99 | /// </summary> | ||
100 | /// <param name="sql">sql string to execute</param> | ||
101 | private void ExecuteSql(string sql) | ||
102 | { | ||
103 | using (MySqlConnection dbcon = new MySqlConnection(connect)) | ||
82 | { | 104 | { |
83 | manager.ExecuteSql("drop table if exists migrations"); | 105 | dbcon.Open(); |
84 | manager.ExecuteSql("drop table if exists prims"); | 106 | |
85 | manager.ExecuteSql("drop table if exists primshapes"); | 107 | MySqlCommand cmd = new MySqlCommand(sql, dbcon); |
86 | manager.ExecuteSql("drop table if exists primitems"); | 108 | cmd.ExecuteNonQuery(); |
87 | manager.ExecuteSql("drop table if exists terrain"); | ||
88 | manager.ExecuteSql("drop table if exists land"); | ||
89 | manager.ExecuteSql("drop table if exists landaccesslist"); | ||
90 | manager.ExecuteSql("drop table if exists regionban"); | ||
91 | manager.ExecuteSql("drop table if exists regionsettings"); | ||
92 | manager.ExecuteSql("drop table if exists estate_managers"); | ||
93 | manager.ExecuteSql("drop table if exists estate_groups"); | ||
94 | manager.ExecuteSql("drop table if exists estate_users"); | ||
95 | manager.ExecuteSql("drop table if exists estateban"); | ||
96 | manager.ExecuteSql("drop table if exists estate_settings"); | ||
97 | manager.ExecuteSql("drop table if exists estate_map"); | ||
98 | } | 109 | } |
99 | } | 110 | } |
100 | } | 111 | } |