aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-12 19:37:51 +0000
committerJustin Clarke Casey2008-12-12 19:37:51 +0000
commit9f6e567cb13a123ddaac4cc738594dd70c089c74 (patch)
tree4c2326a9bff10551735697359f9c235d21ff38d0 /OpenSim
parent* Add user info move inventory folder test (diff)
downloadopensim-SC_OLD-9f6e567cb13a123ddaac4cc738594dd70c089c74.zip
opensim-SC_OLD-9f6e567cb13a123ddaac4cc738594dd70c089c74.tar.gz
opensim-SC_OLD-9f6e567cb13a123ddaac4cc738594dd70c089c74.tar.bz2
opensim-SC_OLD-9f6e567cb13a123ddaac4cc738594dd70c089c74.tar.xz
* add purge folder test
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
index 215fa81..2196d25 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs
@@ -137,8 +137,7 @@ namespace OpenSim.Framework.Communications.Tests
137 137
138 UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000020"); 138 UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000020");
139 UUID folder2Id = UUID.Parse("00000000-0000-0000-0000-000000000021"); 139 UUID folder2Id = UUID.Parse("00000000-0000-0000-0000-000000000021");
140 UUID folderToMoveId = UUID.Parse("00000000-0000-0000-0000-000000000030"); 140 UUID folderToMoveId = UUID.Parse("00000000-0000-0000-0000-000000000030");
141
142 InventoryFolderImpl rootFolder = userInfo.RootFolder; 141 InventoryFolderImpl rootFolder = userInfo.RootFolder;
143 142
144 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID); 143 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
@@ -158,5 +157,29 @@ namespace OpenSim.Framework.Communications.Tests
158 157
159 Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False); 158 Assert.That(folder1.ContainsChildFolder(folderToMoveId), Is.False);
160 } 159 }
160
161 /// <summary>
162 /// Test purging an inventory folder
163 /// </summary>
164 public void TestPurgeFolder()
165 {
166 IUserDataPlugin userDataPlugin = new TestUserDataPlugin();
167 IInventoryDataPlugin inventoryDataPlugin = new TestInventoryDataPlugin();
168
169 CommunicationsManager commsManager
170 = UserProfileTestUtils.SetupServices(userDataPlugin, inventoryDataPlugin);
171 CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager);
172
173 UUID folder1Id = UUID.Parse("00000000-0000-0000-0000-000000000070");
174 InventoryFolderImpl rootFolder = userInfo.RootFolder;
175
176 userInfo.CreateFolder("folder1", folder1Id, (ushort)AssetType.Animation, rootFolder.ID);
177
178 // Test purge
179 userInfo.PurgeFolder(rootFolder.ID);
180
181 Assert.That(rootFolder.RequestListOfFolders(), Is.Empty);
182 Assert.That(inventoryDataPlugin.getInventoryFolder(folder1Id), Is.Null);
183 }
161 } 184 }
162} 185}