diff options
author | Diva Canto | 2015-06-04 08:52:57 -0700 |
---|---|---|
committer | Diva Canto | 2015-06-04 08:52:57 -0700 |
commit | 6f469ec0a5de7633e9380eb1b370590c288cff26 (patch) | |
tree | 53a57212c771e6b909d19a211129e2d921aa01b3 /OpenSim | |
parent | Making the inventory cache static, so that there's less timers. (diff) | |
download | opensim-SC-6f469ec0a5de7633e9380eb1b370590c288cff26.zip opensim-SC-6f469ec0a5de7633e9380eb1b370590c288cff26.tar.gz opensim-SC-6f469ec0a5de7633e9380eb1b370590c288cff26.tar.bz2 opensim-SC-6f469ec0a5de7633e9380eb1b370590c288cff26.tar.xz |
Added tests that verify the absence of the bug fixed in the previous commits (cache issues).
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 9d3f400..1dcda0b 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | |||
@@ -37,6 +37,8 @@ using OpenSim.Framework; | |||
37 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Services.Connectors; | 38 | using OpenSim.Services.Connectors; |
39 | 39 | ||
40 | using OpenSim.Tests.Common; | ||
41 | |||
40 | namespace Robust.Tests | 42 | namespace Robust.Tests |
41 | { | 43 | { |
42 | [TestFixture] | 44 | [TestFixture] |
@@ -54,6 +56,7 @@ namespace Robust.Tests | |||
54 | [Test] | 56 | [Test] |
55 | public void Inventory_001_CreateInventory() | 57 | public void Inventory_001_CreateInventory() |
56 | { | 58 | { |
59 | TestHelpers.InMethod(); | ||
57 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); | 60 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); |
58 | 61 | ||
59 | // Create an inventory that looks like this: | 62 | // Create an inventory that looks like this: |
@@ -69,7 +72,6 @@ namespace Robust.Tests | |||
69 | // Link to notecard -> /Notecards/Notecard 2 | 72 | // Link to notecard -> /Notecards/Notecard 2 |
70 | // Link to Objects folder -> /Objects | 73 | // Link to Objects folder -> /Objects |
71 | 74 | ||
72 | Console.WriteLine("Starting inventory test"); | ||
73 | bool success = m_Connector.CreateUserInventory(m_userID); | 75 | bool success = m_Connector.CreateUserInventory(m_userID); |
74 | Assert.IsTrue(success, "Failed to create user inventory"); | 76 | Assert.IsTrue(success, "Failed to create user inventory"); |
75 | 77 | ||
@@ -149,5 +151,31 @@ namespace Robust.Tests | |||
149 | Assert.AreEqual(coll.Items.Count + coll.Folders.Count, 2, "Test Folder is expected to have exactly 2 things inside"); | 151 | Assert.AreEqual(coll.Items.Count + coll.Folders.Count, 2, "Test Folder is expected to have exactly 2 things inside"); |
150 | 152 | ||
151 | } | 153 | } |
154 | |||
155 | [Test] | ||
156 | public void Inventory_002_DoubleItemsRequest() | ||
157 | { | ||
158 | TestHelpers.InMethod(); | ||
159 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); | ||
160 | |||
161 | // Prefetch Notecard 1, will be cached from here on | ||
162 | InventoryItemBase item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); | ||
163 | item = m_Connector.GetItem(item); | ||
164 | Assert.NotNull(item, "Failed to get Notecard 1"); | ||
165 | Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); | ||
166 | |||
167 | UUID[] uuids = new UUID[2]; | ||
168 | uuids[0] = item.ID; | ||
169 | uuids[1] = new UUID("20000000-0000-0000-0000-000000000002"); | ||
170 | |||
171 | InventoryItemBase[] items = m_Connector.GetMultipleItems(m_userID, uuids); | ||
172 | Assert.NotNull(items, "Failed to get multiple items"); | ||
173 | Assert.IsTrue(items.Length == 2, "Requested 2 items, but didn't receive 2 items"); | ||
174 | |||
175 | // Now they should both be cached | ||
176 | items = m_Connector.GetMultipleItems(m_userID, uuids); | ||
177 | Assert.NotNull(items, "(Repeat) Failed to get multiple items"); | ||
178 | Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); | ||
179 | } | ||
152 | } | 180 | } |
153 | } | 181 | } |