diff options
author | meta7 | 2010-08-30 11:42:17 -0700 |
---|---|---|
committer | meta7 | 2010-08-30 11:42:17 -0700 |
commit | 35d6181b78525df995cf2dc5f8bb4f102f3c0aad (patch) | |
tree | 725b6fcda44f24f578cde7851aac869c59c0af82 /OpenSim/Tests | |
parent | Kick the user from the region in the circumstance that the TP home failed - O... (diff) | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-35d6181b78525df995cf2dc5f8bb4f102f3c0aad.zip opensim-SC-35d6181b78525df995cf2dc5f8bb4f102f3c0aad.tar.gz opensim-SC-35d6181b78525df995cf2dc5f8bb4f102f3c0aad.tar.bz2 opensim-SC-35d6181b78525df995cf2dc5f8bb4f102f3c0aad.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r-- | OpenSim/Tests/Common/Mock/MockInventoryService.cs | 12 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 27 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 6 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 15 |
4 files changed, 45 insertions, 15 deletions
diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs index 1ea4bc1..4ac1078 100644 --- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs | |||
@@ -37,13 +37,9 @@ namespace OpenSim.Tests.Common.Mock | |||
37 | { | 37 | { |
38 | public class MockInventoryService : IInventoryService | 38 | public class MockInventoryService : IInventoryService |
39 | { | 39 | { |
40 | public MockInventoryService() | 40 | public MockInventoryService() {} |
41 | { | ||
42 | } | ||
43 | 41 | ||
44 | public MockInventoryService(IConfigSource config) | 42 | public MockInventoryService(IConfigSource config) {} |
45 | { | ||
46 | } | ||
47 | 43 | ||
48 | /// <summary> | 44 | /// <summary> |
49 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | 45 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> |
@@ -140,7 +136,7 @@ namespace OpenSim.Tests.Common.Mock | |||
140 | 136 | ||
141 | public bool AddItem(InventoryItemBase item) | 137 | public bool AddItem(InventoryItemBase item) |
142 | { | 138 | { |
143 | return false; | 139 | return true; |
144 | } | 140 | } |
145 | 141 | ||
146 | public bool UpdateItem(InventoryItemBase item) | 142 | public bool UpdateItem(InventoryItemBase item) |
@@ -187,4 +183,4 @@ namespace OpenSim.Tests.Common.Mock | |||
187 | return 1; | 183 | return 1; |
188 | } | 184 | } |
189 | } | 185 | } |
190 | } | 186 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 7c4f689..b70b47d 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock | |||
42 | /// </summary> | 42 | /// </summary> |
43 | public class TestInventoryDataPlugin : IInventoryDataPlugin | 43 | public class TestInventoryDataPlugin : IInventoryDataPlugin |
44 | { | 44 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <value> | 47 | /// <value> |
48 | /// Inventory folders | 48 | /// Inventory folders |
@@ -84,14 +84,19 @@ namespace OpenSim.Tests.Common.Mock | |||
84 | 84 | ||
85 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) | 85 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) |
86 | { | 86 | { |
87 | // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); | 87 | InventoryFolderBase folder = m_folders[folderID]; |
88 | |||
89 | // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); | ||
88 | 90 | ||
89 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 91 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
90 | 92 | ||
91 | foreach (InventoryItemBase item in m_items.Values) | 93 | foreach (InventoryItemBase item in m_items.Values) |
92 | { | 94 | { |
93 | if (item.Folder == folderID) | 95 | if (item.Folder == folderID) |
96 | { | ||
97 | // m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); | ||
94 | items.Add(item); | 98 | items.Add(item); |
99 | } | ||
95 | } | 100 | } |
96 | 101 | ||
97 | return items; | 102 | return items; |
@@ -111,12 +116,22 @@ namespace OpenSim.Tests.Common.Mock | |||
111 | 116 | ||
112 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) | 117 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) |
113 | { | 118 | { |
119 | InventoryFolderBase parentFolder = m_folders[parentID]; | ||
120 | |||
121 | // m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); | ||
122 | |||
114 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 123 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
115 | 124 | ||
116 | foreach (InventoryFolderBase folder in m_folders.Values) | 125 | foreach (InventoryFolderBase folder in m_folders.Values) |
117 | { | 126 | { |
118 | if (folder.ParentID == parentID) | 127 | if (folder.ParentID == parentID) |
128 | { | ||
129 | // m_log.DebugFormat( | ||
130 | // "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", | ||
131 | // folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); | ||
132 | |||
119 | folders.Add(folder); | 133 | folders.Add(folder); |
134 | } | ||
120 | } | 135 | } |
121 | 136 | ||
122 | return folders; | 137 | return folders; |
@@ -137,6 +152,10 @@ namespace OpenSim.Tests.Common.Mock | |||
137 | 152 | ||
138 | public void addInventoryFolder(InventoryFolderBase folder) | 153 | public void addInventoryFolder(InventoryFolderBase folder) |
139 | { | 154 | { |
155 | // m_log.DebugFormat( | ||
156 | // "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", | ||
157 | // folder.Name, folder.ID, (AssetType)folder.Type); | ||
158 | |||
140 | m_folders[folder.ID] = folder; | 159 | m_folders[folder.ID] = folder; |
141 | 160 | ||
142 | if (folder.ParentID == UUID.Zero) | 161 | if (folder.ParentID == UUID.Zero) |
@@ -166,8 +185,10 @@ namespace OpenSim.Tests.Common.Mock | |||
166 | 185 | ||
167 | public void addInventoryItem(InventoryItemBase item) | 186 | public void addInventoryItem(InventoryItemBase item) |
168 | { | 187 | { |
188 | InventoryFolderBase folder = m_folders[item.Folder]; | ||
189 | |||
169 | // m_log.DebugFormat( | 190 | // m_log.DebugFormat( |
170 | // "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); | 191 | // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); |
171 | 192 | ||
172 | m_items[item.ID] = item; | 193 | m_items[item.ID] = item; |
173 | } | 194 | } |
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index eaa0d33..d9ded2d 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -285,10 +285,16 @@ namespace OpenSim.Tests.Common.Setup | |||
285 | config.AddConfig("Modules"); | 285 | config.AddConfig("Modules"); |
286 | config.AddConfig("InventoryService"); | 286 | config.AddConfig("InventoryService"); |
287 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); | 287 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); |
288 | |||
288 | if (real) | 289 | if (real) |
290 | { | ||
289 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); | 291 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); |
292 | } | ||
290 | else | 293 | else |
294 | { | ||
291 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); | 295 | config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); |
296 | } | ||
297 | |||
292 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | 298 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); |
293 | inventoryService.Initialise(config); | 299 | inventoryService.Initialise(config); |
294 | inventoryService.AddRegion(testScene); | 300 | inventoryService.AddRegion(testScene); |
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index 380f258..26156f3 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | |||
@@ -127,12 +127,19 @@ namespace OpenSim.Tests.Common.Setup | |||
127 | { | 127 | { |
128 | UserAccount ua | 128 | UserAccount ua |
129 | = new UserAccount(userId) | 129 | = new UserAccount(userId) |
130 | { FirstName = firstName, LastName = lastName, ServiceURLs = new Dictionary<string, object>() }; | 130 | { FirstName = firstName, LastName = lastName }; |
131 | CreateUserWithInventory(scene, ua, pw); | ||
132 | return ua; | ||
133 | } | ||
134 | |||
135 | public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw) | ||
136 | { | ||
137 | // FIXME: This should really be set up by UserAccount itself | ||
138 | ua.ServiceURLs = new Dictionary<string, object>(); | ||
139 | |||
131 | scene.UserAccountService.StoreUserAccount(ua); | 140 | scene.UserAccountService.StoreUserAccount(ua); |
132 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); | 141 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); |
133 | scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); | 142 | scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); |
134 | 143 | } | |
135 | return ua; | ||
136 | } | ||
137 | } | 144 | } |
138 | } \ No newline at end of file | 145 | } \ No newline at end of file |