aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2009-08-15 19:00:56 +0100
committerMelanie2009-08-15 19:00:56 +0100
commit973be659459c577433b831c451ff07048aa078be (patch)
tree887f0586edbb936cca2fb8381699d921a2299492 /OpenSim/Framework
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
parentChanged FromAssetID to FromItemID (diff)
downloadopensim-SC_OLD-973be659459c577433b831c451ff07048aa078be.zip
opensim-SC_OLD-973be659459c577433b831c451ff07048aa078be.tar.gz
opensim-SC_OLD-973be659459c577433b831c451ff07048aa078be.tar.bz2
opensim-SC_OLD-973be659459c577433b831c451ff07048aa078be.tar.xz
Merge branch 'master' of ../opensim-diva/ into inventory-connector
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs4
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs14
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs9
-rw-r--r--OpenSim/Framework/InventoryItemBase.cs11
4 files changed, 26 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 8ee1b1a..ca641d0 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -747,7 +747,7 @@ namespace OpenSim.Framework.Communications.Cache
747 747
748 InventoryItemBase itemInfo = null; 748 InventoryItemBase itemInfo = null;
749 749
750 itemInfo = m_InventoryService.QueryItem(item); 750 itemInfo = m_InventoryService.GetItem(item);
751 751
752 if (itemInfo != null) 752 if (itemInfo != null)
753 { 753 {
@@ -784,7 +784,7 @@ namespace OpenSim.Framework.Communications.Cache
784 784
785 InventoryFolderBase folderInfo = null; 785 InventoryFolderBase folderInfo = null;
786 786
787 folderInfo = m_InventoryService.QueryFolder(folder); 787 folderInfo = m_InventoryService.GetFolder(folder);
788 788
789 if (folderInfo != null) 789 if (folderInfo != null)
790 { 790 {
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index fe88cf5..670c9ff 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -186,14 +186,14 @@ namespace OpenSim.Framework.Communications.Tests
186 186
187 Assert.That( 187 Assert.That(
188 userInfo.CreateFolder("testFolder1", folderId, (ushort)AssetType.Animation, missingFolderId), Is.False); 188 userInfo.CreateFolder("testFolder1", folderId, (ushort)AssetType.Animation, missingFolderId), Is.False);
189 Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null); 189 Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null);
190 Assert.That(userInfo.RootFolder.ContainsChildFolder(missingFolderId), Is.False); 190 Assert.That(userInfo.RootFolder.ContainsChildFolder(missingFolderId), Is.False);
191 Assert.That(userInfo.RootFolder.FindFolder(folderId), Is.Null); 191 Assert.That(userInfo.RootFolder.FindFolder(folderId), Is.Null);
192 192
193 // 2: Try a folder create that should work 193 // 2: Try a folder create that should work
194 Assert.That( 194 Assert.That(
195 userInfo.CreateFolder("testFolder2", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID), Is.True); 195 userInfo.CreateFolder("testFolder2", folderId, (ushort)AssetType.Animation, userInfo.RootFolder.ID), Is.True);
196 Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null); 196 Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null);
197 Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True); 197 Assert.That(userInfo.RootFolder.ContainsChildFolder(folderId), Is.True);
198 } 198 }
199 199
@@ -228,7 +228,7 @@ namespace OpenSim.Framework.Communications.Tests
228 Assert.That(newFolderName1, Is.EqualTo(folder1.Name)); 228 Assert.That(newFolderName1, Is.EqualTo(folder1.Name));
229 Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type)); 229 Assert.That(folderType1, Is.EqualTo((ushort)folder1.Type));
230 230
231 InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder); 231 InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder);
232 Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name)); 232 Assert.That(newFolderName1, Is.EqualTo(dataFolder1.Name));
233 Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type)); 233 Assert.That(folderType1, Is.EqualTo((ushort)dataFolder1.Type));
234 } 234 }
@@ -254,7 +254,7 @@ namespace OpenSim.Framework.Communications.Tests
254 Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True); 254 Assert.That(folder2.ContainsChildFolder(folder1Id), Is.True);
255 Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False); 255 Assert.That(rootFolder.ContainsChildFolder(folder1Id), Is.False);
256 256
257 InventoryFolderBase dataFolder1 = myScene.InventoryService.QueryFolder(myFolder2); 257 InventoryFolderBase dataFolder1 = myScene.InventoryService.GetFolder(myFolder2);
258 Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name)); 258 Assert.That(newFolderName2, Is.EqualTo(dataFolder1.Name));
259 Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type)); 259 Assert.That(folderType2, Is.EqualTo((ushort)dataFolder1.Type));
260 Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID)); 260 Assert.That(folder2Id, Is.EqualTo(dataFolder1.ParentID));
@@ -296,7 +296,7 @@ namespace OpenSim.Framework.Communications.Tests
296 InventoryFolderBase myFolder = new InventoryFolderBase(); 296 InventoryFolderBase myFolder = new InventoryFolderBase();
297 myFolder.ID = folderToMoveId; 297 myFolder.ID = folderToMoveId;
298 Assert.That(folder2.ContainsChildFolder(folderToMoveId), Is.True); 298 Assert.That(folder2.ContainsChildFolder(folderToMoveId), Is.True);
299 Assert.That(myScene.InventoryService.QueryFolder(myFolder).ParentID, Is.EqualTo(folder2Id)); 299 Assert.That(myScene.InventoryService.GetFolder(myFolder).ParentID, Is.EqualTo(folder2Id));
300 300
301 Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False); 301 Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False);
302 } 302 }
@@ -322,13 +322,13 @@ namespace OpenSim.Framework.Communications.Tests
322 myFolder.ID = folder1Id; 322 myFolder.ID = folder1Id;
323 323
324 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); 324 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
325 Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Not.Null); 325 Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Not.Null);
326 326
327 // Test purge 327 // Test purge
328 userInfo.PurgeFolder(rootFolder.ID); 328 userInfo.PurgeFolder(rootFolder.ID);
329 329
330 Assert.That(rootFolder.RequestListOfFolders(), Is.Empty); 330 Assert.That(rootFolder.RequestListOfFolders(), Is.Empty);
331 Assert.That(myScene.InventoryService.QueryFolder(myFolder), Is.Null); 331 Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null);
332 } 332 }
333 } 333 }
334} \ No newline at end of file 334} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index b1b7809..22dcef9 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -552,12 +552,12 @@ namespace OpenSim.Framework.Communications.Tests
552 return false; 552 return false;
553 } 553 }
554 554
555 public InventoryItemBase QueryItem(InventoryItemBase item) 555 public InventoryItemBase GetItem(InventoryItemBase item)
556 { 556 {
557 return null; 557 return null;
558 } 558 }
559 559
560 public InventoryFolderBase QueryFolder(InventoryFolderBase folder) 560 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
561 { 561 {
562 return null; 562 return null;
563 } 563 }
@@ -575,5 +575,10 @@ namespace OpenSim.Framework.Communications.Tests
575 root.ParentID = UUID.Zero; 575 root.ParentID = UUID.Zero;
576 return root; 576 return root;
577 } 577 }
578
579 public int GetAssetPermissions(UUID userID, UUID assetID)
580 {
581 return 1;
582 }
578 } 583 }
579} 584}
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index 4307fe2..b5bf92f 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -354,7 +354,16 @@ namespace OpenSim.Framework
354 } 354 }
355 } 355 }
356 protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 356 protected int m_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
357 357
358 public InventoryItemBase()
359 {
360 }
361
362 public InventoryItemBase(UUID id)
363 {
364 ID = id;
365 }
366
358 public object Clone() 367 public object Clone()
359 { 368 {
360 return MemberwiseClone(); 369 return MemberwiseClone();