diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Data | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAssetData.cs | 40 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 34 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateAssetData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 46 | ||||
-rw-r--r-- | OpenSim/Data/Tests/BasicAssetTest.cs | 20 |
5 files changed, 73 insertions, 73 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 3eaae12..425e233 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -132,12 +132,12 @@ namespace OpenSim.Data.MSSQL | |||
132 | { | 132 | { |
133 | AssetBase asset = new AssetBase(); | 133 | AssetBase asset = new AssetBase(); |
134 | // Region Main | 134 | // Region Main |
135 | asset.FullID = new UUID((string)reader["id"]); | 135 | asset.Metadata.FullID = new UUID((string)reader["id"]); |
136 | asset.Name = (string)reader["name"]; | 136 | asset.Metadata.Name = (string)reader["name"]; |
137 | asset.Description = (string)reader["description"]; | 137 | asset.Metadata.Description = (string)reader["description"]; |
138 | asset.Type = Convert.ToSByte(reader["assetType"]); | 138 | asset.Metadata.Type = Convert.ToSByte(reader["assetType"]); |
139 | asset.Local = Convert.ToBoolean(reader["local"]); | 139 | asset.Metadata.Local = Convert.ToBoolean(reader["local"]); |
140 | asset.Temporary = Convert.ToBoolean(reader["temporary"]); | 140 | asset.Metadata.Temporary = Convert.ToBoolean(reader["temporary"]); |
141 | asset.Data = (byte[])reader["data"]; | 141 | asset.Data = (byte[])reader["data"]; |
142 | return asset; | 142 | return asset; |
143 | } | 143 | } |
@@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL | |||
152 | /// <param name="asset">the asset</param> | 152 | /// <param name="asset">the asset</param> |
153 | override public void CreateAsset(AssetBase asset) | 153 | override public void CreateAsset(AssetBase asset) |
154 | { | 154 | { |
155 | if (ExistsAsset(asset.FullID)) | 155 | if (ExistsAsset(asset.Metadata.FullID)) |
156 | { | 156 | { |
157 | return; | 157 | return; |
158 | } | 158 | } |
@@ -163,12 +163,12 @@ namespace OpenSim.Data.MSSQL | |||
163 | "(@id, @name, @description, @assetType, @local, @temporary, @create_time, @access_time, @data)")) | 163 | "(@id, @name, @description, @assetType, @local, @temporary, @create_time, @access_time, @data)")) |
164 | { | 164 | { |
165 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 165 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
166 | command.Parameters.Add(database.CreateParameter("id", asset.FullID)); | 166 | command.Parameters.Add(database.CreateParameter("id", asset.Metadata.FullID)); |
167 | command.Parameters.Add(database.CreateParameter("name", asset.Name)); | 167 | command.Parameters.Add(database.CreateParameter("name", asset.Metadata.Name)); |
168 | command.Parameters.Add(database.CreateParameter("description", asset.Description)); | 168 | command.Parameters.Add(database.CreateParameter("description", asset.Metadata.Description)); |
169 | command.Parameters.Add(database.CreateParameter("assetType", asset.Type)); | 169 | command.Parameters.Add(database.CreateParameter("assetType", asset.Metadata.Type)); |
170 | command.Parameters.Add(database.CreateParameter("local", asset.Local)); | 170 | command.Parameters.Add(database.CreateParameter("local", asset.Metadata.Local)); |
171 | command.Parameters.Add(database.CreateParameter("temporary", asset.Temporary)); | 171 | command.Parameters.Add(database.CreateParameter("temporary", asset.Metadata.Temporary)); |
172 | command.Parameters.Add(database.CreateParameter("access_time", now)); | 172 | command.Parameters.Add(database.CreateParameter("access_time", now)); |
173 | command.Parameters.Add(database.CreateParameter("create_time", now)); | 173 | command.Parameters.Add(database.CreateParameter("create_time", now)); |
174 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); | 174 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); |
@@ -192,14 +192,14 @@ namespace OpenSim.Data.MSSQL | |||
192 | "data = @data where " + | 192 | "data = @data where " + |
193 | "id = @keyId;")) | 193 | "id = @keyId;")) |
194 | { | 194 | { |
195 | command.Parameters.Add(database.CreateParameter("id", asset.FullID)); | 195 | command.Parameters.Add(database.CreateParameter("id", asset.Metadata.FullID)); |
196 | command.Parameters.Add(database.CreateParameter("name", asset.Name)); | 196 | command.Parameters.Add(database.CreateParameter("name", asset.Metadata.Name)); |
197 | command.Parameters.Add(database.CreateParameter("description", asset.Description)); | 197 | command.Parameters.Add(database.CreateParameter("description", asset.Metadata.Description)); |
198 | command.Parameters.Add(database.CreateParameter("assetType", asset.Type)); | 198 | command.Parameters.Add(database.CreateParameter("assetType", asset.Metadata.Type)); |
199 | command.Parameters.Add(database.CreateParameter("local", asset.Local)); | 199 | command.Parameters.Add(database.CreateParameter("local", asset.Metadata.Local)); |
200 | command.Parameters.Add(database.CreateParameter("temporary", asset.Temporary)); | 200 | command.Parameters.Add(database.CreateParameter("temporary", asset.Metadata.Temporary)); |
201 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); | 201 | command.Parameters.Add(database.CreateParameter("data", asset.Data)); |
202 | command.Parameters.Add(database.CreateParameter("@keyId", asset.FullID)); | 202 | command.Parameters.Add(database.CreateParameter("@keyId", asset.Metadata.FullID)); |
203 | 203 | ||
204 | try | 204 | try |
205 | { | 205 | { |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 3ff2a1a..823fa78 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -139,18 +139,18 @@ namespace OpenSim.Data.MySQL | |||
139 | { | 139 | { |
140 | asset = new AssetBase(); | 140 | asset = new AssetBase(); |
141 | asset.Data = (byte[]) dbReader["data"]; | 141 | asset.Data = (byte[]) dbReader["data"]; |
142 | asset.Description = (string) dbReader["description"]; | 142 | asset.Metadata.Description = (string) dbReader["description"]; |
143 | asset.FullID = assetID; | 143 | asset.Metadata.FullID = assetID; |
144 | try | 144 | try |
145 | { | 145 | { |
146 | asset.Local = (bool)dbReader["local"]; | 146 | asset.Metadata.Local = (bool)dbReader["local"]; |
147 | } | 147 | } |
148 | catch (System.InvalidCastException) | 148 | catch (System.InvalidCastException) |
149 | { | 149 | { |
150 | asset.Local = false; | 150 | asset.Metadata.Local = false; |
151 | } | 151 | } |
152 | asset.Name = (string) dbReader["name"]; | 152 | asset.Metadata.Name = (string) dbReader["name"]; |
153 | asset.Type = (sbyte) dbReader["assetType"]; | 153 | asset.Metadata.Type = (sbyte) dbReader["assetType"]; |
154 | } | 154 | } |
155 | dbReader.Close(); | 155 | dbReader.Close(); |
156 | cmd.Dispose(); | 156 | cmd.Dispose(); |
@@ -178,8 +178,8 @@ namespace OpenSim.Data.MySQL | |||
178 | { | 178 | { |
179 | lock (_dbConnection) | 179 | lock (_dbConnection) |
180 | { | 180 | { |
181 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); | 181 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.Metadata.FullID)); |
182 | if (ExistsAsset(asset.FullID)) | 182 | if (ExistsAsset(asset.Metadata.FullID)) |
183 | { | 183 | { |
184 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); | 184 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); |
185 | return; | 185 | return; |
@@ -200,12 +200,12 @@ namespace OpenSim.Data.MySQL | |||
200 | { | 200 | { |
201 | // create unix epoch time | 201 | // create unix epoch time |
202 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 202 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
203 | cmd.Parameters.AddWithValue("?id", asset.FullID.ToString()); | 203 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); |
204 | cmd.Parameters.AddWithValue("?name", asset.Name); | 204 | cmd.Parameters.AddWithValue("?name", asset.Metadata.Name); |
205 | cmd.Parameters.AddWithValue("?description", asset.Description); | 205 | cmd.Parameters.AddWithValue("?description", asset.Metadata.Description); |
206 | cmd.Parameters.AddWithValue("?assetType", asset.Type); | 206 | cmd.Parameters.AddWithValue("?assetType", asset.Metadata.Type); |
207 | cmd.Parameters.AddWithValue("?local", asset.Local); | 207 | cmd.Parameters.AddWithValue("?local", asset.Metadata.Local); |
208 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 208 | cmd.Parameters.AddWithValue("?temporary", asset.Metadata.Temporary); |
209 | cmd.Parameters.AddWithValue("?create_time", now); | 209 | cmd.Parameters.AddWithValue("?create_time", now); |
210 | cmd.Parameters.AddWithValue("?access_time", now); | 210 | cmd.Parameters.AddWithValue("?access_time", now); |
211 | cmd.Parameters.AddWithValue("?data", asset.Data); | 211 | cmd.Parameters.AddWithValue("?data", asset.Data); |
@@ -218,7 +218,7 @@ namespace OpenSim.Data.MySQL | |||
218 | m_log.ErrorFormat( | 218 | m_log.ErrorFormat( |
219 | "[ASSETS DB]: " + | 219 | "[ASSETS DB]: " + |
220 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() | 220 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() |
221 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); | 221 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); |
222 | _dbConnection.Reconnect(); | 222 | _dbConnection.Reconnect(); |
223 | } | 223 | } |
224 | } | 224 | } |
@@ -241,7 +241,7 @@ namespace OpenSim.Data.MySQL | |||
241 | { | 241 | { |
242 | // create unix epoch time | 242 | // create unix epoch time |
243 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); | 243 | int now = (int)((System.DateTime.Now.Ticks - TicksToEpoch) / 10000000); |
244 | cmd.Parameters.AddWithValue("?id", asset.FullID.ToString()); | 244 | cmd.Parameters.AddWithValue("?id", asset.Metadata.ID); |
245 | cmd.Parameters.AddWithValue("?access_time", now); | 245 | cmd.Parameters.AddWithValue("?access_time", now); |
246 | cmd.ExecuteNonQuery(); | 246 | cmd.ExecuteNonQuery(); |
247 | cmd.Dispose(); | 247 | cmd.Dispose(); |
@@ -252,7 +252,7 @@ namespace OpenSim.Data.MySQL | |||
252 | m_log.ErrorFormat( | 252 | m_log.ErrorFormat( |
253 | "[ASSETS DB]: " + | 253 | "[ASSETS DB]: " + |
254 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() | 254 | "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() |
255 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); | 255 | + Environment.NewLine + "Attempting reconnection", asset.Metadata.FullID, asset.Metadata.Name); |
256 | _dbConnection.Reconnect(); | 256 | _dbConnection.Reconnect(); |
257 | } | 257 | } |
258 | } | 258 | } |
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index fab39b1..d0046c6 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Data.NHibernate | |||
69 | 69 | ||
70 | private void Save(AssetBase asset) | 70 | private void Save(AssetBase asset) |
71 | { | 71 | { |
72 | AssetBase temp = (AssetBase)manager.Load(typeof(AssetBase), asset.FullID); | 72 | AssetBase temp = (AssetBase)manager.Load(typeof(AssetBase), asset.Metadata.FullID); |
73 | if (temp == null) | 73 | if (temp == null) |
74 | { | 74 | { |
75 | manager.Save(asset); | 75 | manager.Save(asset); |
@@ -78,13 +78,13 @@ namespace OpenSim.Data.NHibernate | |||
78 | 78 | ||
79 | override public void CreateAsset(AssetBase asset) | 79 | override public void CreateAsset(AssetBase asset) |
80 | { | 80 | { |
81 | m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID); | 81 | m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.Metadata.FullID); |
82 | Save(asset); | 82 | Save(asset); |
83 | } | 83 | } |
84 | 84 | ||
85 | override public void UpdateAsset(AssetBase asset) | 85 | override public void UpdateAsset(AssetBase asset) |
86 | { | 86 | { |
87 | m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID); | 87 | m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.Metadata.FullID); |
88 | manager.Update(asset); | 88 | manager.Update(asset); |
89 | } | 89 | } |
90 | 90 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 30ba642..d28956f 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -125,8 +125,8 @@ namespace OpenSim.Data.SQLite | |||
125 | /// <param name="asset">Asset Base</param> | 125 | /// <param name="asset">Asset Base</param> |
126 | override public void CreateAsset(AssetBase asset) | 126 | override public void CreateAsset(AssetBase asset) |
127 | { | 127 | { |
128 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); | 128 | //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.Metadata.FullID)); |
129 | if (ExistsAsset(asset.FullID)) | 129 | if (ExistsAsset(asset.Metadata.FullID)) |
130 | { | 130 | { |
131 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); | 131 | //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); |
132 | } | 132 | } |
@@ -136,12 +136,12 @@ namespace OpenSim.Data.SQLite | |||
136 | { | 136 | { |
137 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) | 137 | using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) |
138 | { | 138 | { |
139 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); | 139 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.Metadata.FullID))); |
140 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); | 140 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Metadata.Name)); |
141 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); | 141 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Metadata.Description)); |
142 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 142 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Metadata.Type)); |
143 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 143 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Metadata.Local)); |
144 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 144 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Metadata.Temporary)); |
145 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 145 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
146 | 146 | ||
147 | cmd.ExecuteNonQuery(); | 147 | cmd.ExecuteNonQuery(); |
@@ -162,12 +162,12 @@ namespace OpenSim.Data.SQLite | |||
162 | { | 162 | { |
163 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) | 163 | using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) |
164 | { | 164 | { |
165 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); | 165 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.Metadata.FullID))); |
166 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); | 166 | cmd.Parameters.Add(new SqliteParameter(":Name", asset.Metadata.Name)); |
167 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); | 167 | cmd.Parameters.Add(new SqliteParameter(":Description", asset.Metadata.Description)); |
168 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 168 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Metadata.Type)); |
169 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 169 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Metadata.Local)); |
170 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 170 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Metadata.Temporary)); |
171 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 171 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
172 | 172 | ||
173 | cmd.ExecuteNonQuery(); | 173 | cmd.ExecuteNonQuery(); |
@@ -181,14 +181,14 @@ namespace OpenSim.Data.SQLite | |||
181 | /// <param name="asset"></param> | 181 | /// <param name="asset"></param> |
182 | private static void LogAssetLoad(AssetBase asset) | 182 | private static void LogAssetLoad(AssetBase asset) |
183 | { | 183 | { |
184 | string temporary = asset.Temporary ? "Temporary" : "Stored"; | 184 | string temporary = asset.Metadata.Temporary ? "Temporary" : "Stored"; |
185 | string local = asset.Local ? "Local" : "Remote"; | 185 | string local = asset.Metadata.Local ? "Local" : "Remote"; |
186 | 186 | ||
187 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; | 187 | int assetLength = (asset.Data != null) ? asset.Data.Length : 0; |
188 | 188 | ||
189 | m_log.Info("[ASSET DB]: " + | 189 | m_log.Info("[ASSET DB]: " + |
190 | string.Format("Loaded {6} {5} Asset: [{0}][{3}] \"{1}\":{2} ({7} bytes)", | 190 | string.Format("Loaded {6} {5} Asset: [{0}][{3}] \"{1}\":{2} ({7} bytes)", |
191 | asset.FullID, asset.Name, asset.Description, asset.Type, | 191 | asset.Metadata.FullID, asset.Metadata.Name, asset.Metadata.Description, asset.Metadata.Type, |
192 | temporary, local, assetLength)); | 192 | temporary, local, assetLength)); |
193 | } | 193 | } |
194 | 194 | ||
@@ -246,12 +246,12 @@ namespace OpenSim.Data.SQLite | |||
246 | // back out. Not enough time to figure it out yet. | 246 | // back out. Not enough time to figure it out yet. |
247 | AssetBase asset = new AssetBase(); | 247 | AssetBase asset = new AssetBase(); |
248 | 248 | ||
249 | asset.FullID = new UUID((String) row["UUID"]); | 249 | asset.Metadata.FullID = new UUID((String) row["UUID"]); |
250 | asset.Name = (String) row["Name"]; | 250 | asset.Metadata.Name = (String) row["Name"]; |
251 | asset.Description = (String) row["Description"]; | 251 | asset.Metadata.Description = (String) row["Description"]; |
252 | asset.Type = Convert.ToSByte(row["Type"]); | 252 | asset.Metadata.Type = Convert.ToSByte(row["Type"]); |
253 | asset.Local = Convert.ToBoolean(row["Local"]); | 253 | asset.Metadata.Local = Convert.ToBoolean(row["Local"]); |
254 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); | 254 | asset.Metadata.Temporary = Convert.ToBoolean(row["Temporary"]); |
255 | asset.Data = (byte[]) row["Data"]; | 255 | asset.Data = (byte[]) row["Data"]; |
256 | return asset; | 256 | return asset; |
257 | } | 257 | } |
diff --git a/OpenSim/Data/Tests/BasicAssetTest.cs b/OpenSim/Data/Tests/BasicAssetTest.cs index 6546472..5993f96 100644 --- a/OpenSim/Data/Tests/BasicAssetTest.cs +++ b/OpenSim/Data/Tests/BasicAssetTest.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Data.Tests | |||
61 | asset1 = new byte[100]; | 61 | asset1 = new byte[100]; |
62 | asset1.Initialize(); | 62 | asset1.Initialize(); |
63 | } | 63 | } |
64 | 64 | ||
65 | [Test] | 65 | [Test] |
66 | public void T001_LoadEmpty() | 66 | public void T001_LoadEmpty() |
67 | { | 67 | { |
@@ -69,7 +69,7 @@ namespace OpenSim.Data.Tests | |||
69 | Assert.That(db.ExistsAsset(uuid2), Is.False); | 69 | Assert.That(db.ExistsAsset(uuid2), Is.False); |
70 | Assert.That(db.ExistsAsset(uuid3), Is.False); | 70 | Assert.That(db.ExistsAsset(uuid3), Is.False); |
71 | } | 71 | } |
72 | 72 | ||
73 | [Test] | 73 | [Test] |
74 | public void T010_StoreSimpleAsset() | 74 | public void T010_StoreSimpleAsset() |
75 | { | 75 | { |
@@ -79,22 +79,22 @@ namespace OpenSim.Data.Tests | |||
79 | a1.Data = asset1; | 79 | a1.Data = asset1; |
80 | a2.Data = asset1; | 80 | a2.Data = asset1; |
81 | a3.Data = asset1; | 81 | a3.Data = asset1; |
82 | 82 | ||
83 | db.CreateAsset(a1); | 83 | db.CreateAsset(a1); |
84 | db.CreateAsset(a2); | 84 | db.CreateAsset(a2); |
85 | db.CreateAsset(a3); | 85 | db.CreateAsset(a3); |
86 | 86 | ||
87 | AssetBase a1a = db.FetchAsset(uuid1); | 87 | AssetBase a1a = db.FetchAsset(uuid1); |
88 | Assert.That(a1.ID, Is.EqualTo(a1a.ID)); | 88 | Assert.That(a1.Metadata.ID, Is.EqualTo(a1a.Metadata.ID)); |
89 | Assert.That(a1.Name, Is.EqualTo(a1a.Name)); | 89 | Assert.That(a1.Metadata.Name, Is.EqualTo(a1a.Metadata.Name)); |
90 | 90 | ||
91 | AssetBase a2a = db.FetchAsset(uuid2); | 91 | AssetBase a2a = db.FetchAsset(uuid2); |
92 | Assert.That(a2.ID, Is.EqualTo(a2a.ID)); | 92 | Assert.That(a2.Metadata.ID, Is.EqualTo(a2a.Metadata.ID)); |
93 | Assert.That(a2.Name, Is.EqualTo(a2a.Name)); | 93 | Assert.That(a2.Metadata.Name, Is.EqualTo(a2a.Metadata.Name)); |
94 | 94 | ||
95 | AssetBase a3a = db.FetchAsset(uuid3); | 95 | AssetBase a3a = db.FetchAsset(uuid3); |
96 | Assert.That(a3.ID, Is.EqualTo(a3a.ID)); | 96 | Assert.That(a3.Metadata.ID, Is.EqualTo(a3a.Metadata.ID)); |
97 | Assert.That(a3.Name, Is.EqualTo(a3a.Name)); | 97 | Assert.That(a3.Metadata.Name, Is.EqualTo(a3a.Metadata.Name)); |
98 | } | 98 | } |
99 | 99 | ||
100 | [Test] | 100 | [Test] |
@@ -117,4 +117,4 @@ namespace OpenSim.Data.Tests | |||
117 | // Assert.That(db.ExistsAsset(uuid3), Is.False); | 117 | // Assert.That(db.ExistsAsset(uuid3), Is.False); |
118 | // } | 118 | // } |
119 | } | 119 | } |
120 | } \ No newline at end of file | 120 | } |