diff options
author | UbitUmarov | 2018-10-07 01:36:47 +0100 |
---|---|---|
committer | UbitUmarov | 2018-10-07 01:36:47 +0100 |
commit | 87e97543d6f5876afbebe6eadc2cb63e75374c67 (patch) | |
tree | 7566ceb4b8b02cc013182d66b191005eea0b23ff /OpenSim/Capabilities/Handlers/FetchInventory | |
parent | more use of simpler xml encoder on inventory fetch, plus other cosmetics (diff) | |
download | opensim-SC-87e97543d6f5876afbebe6eadc2cb63e75374c67.zip opensim-SC-87e97543d6f5876afbebe6eadc2cb63e75374c67.tar.gz opensim-SC-87e97543d6f5876afbebe6eadc2cb63e75374c67.tar.bz2 opensim-SC-87e97543d6f5876afbebe6eadc2cb63e75374c67.tar.xz |
try to make inventory fetch tests happy
Diffstat (limited to 'OpenSim/Capabilities/Handlers/FetchInventory')
-rw-r--r-- | OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 1e9a993..e950d2a 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
46 | [TestFixture] | 46 | [TestFixture] |
47 | public class FetchInventoryDescendents2HandlerTests : OpenSimTestCase | 47 | public class FetchInventoryDescendents2HandlerTests : OpenSimTestCase |
48 | { | 48 | { |
49 | private UUID m_userID = UUID.Zero; | 49 | private UUID m_userID = new UUID("00000000-0000-0000-0000-000000000001"); |
50 | private Scene m_scene; | 50 | private Scene m_scene; |
51 | private UUID m_rootFolderID; | 51 | private UUID m_rootFolderID; |
52 | private int m_rootDescendents; | 52 | private int m_rootDescendents; |
@@ -103,6 +103,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
103 | 103 | ||
104 | // Add a folder | 104 | // Add a folder |
105 | InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); | 105 | InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); |
106 | folder.Type = (short)FolderType.None; | ||
106 | m_scene.InventoryService.AddFolder(folder); | 107 | m_scene.InventoryService.AddFolder(folder); |
107 | 108 | ||
108 | // Add a link to notecard 2 in Test Folder | 109 | // Add a link to notecard 2 in Test Folder |
@@ -139,13 +140,15 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
139 | 140 | ||
140 | string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; | 141 | string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; |
141 | request += m_rootFolderID; | 142 | request += m_rootFolderID; |
142 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>"; | 143 | request += "</uuid><key>owner_id</key><uuid>"; |
144 | request += m_userID.ToString(); | ||
145 | request += "</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>"; | ||
143 | 146 | ||
144 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); | 147 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); |
145 | 148 | ||
146 | Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); | 149 | Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); |
147 | Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); | 150 | Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); |
148 | Assert.That(llsdresponse.Contains("00000000-0000-0000-0000-000000000000"), Is.True, "Response should contain userID"); | 151 | Assert.That(llsdresponse.Contains(m_userID.ToString()), Is.True, "Response should contain userID"); |
149 | 152 | ||
150 | string descendents = "descendents</key><integer>" + m_rootDescendents + "</integer>"; | 153 | string descendents = "descendents</key><integer>" + m_rootDescendents + "</integer>"; |
151 | Assert.That(llsdresponse.Contains(descendents), Is.True, "Incorrect number of descendents"); | 154 | Assert.That(llsdresponse.Contains(descendents), Is.True, "Incorrect number of descendents"); |
@@ -164,10 +167,10 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
164 | string request = "<llsd><map><key>folders</key><array>"; | 167 | string request = "<llsd><map><key>folders</key><array>"; |
165 | request += "<map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; | 168 | request += "<map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; |
166 | request += m_rootFolderID; | 169 | request += m_rootFolderID; |
167 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map>"; | 170 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000001</uuid><key>sort_order</key><integer>1</integer></map>"; |
168 | request += "<map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; | 171 | request += "<map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; |
169 | request += m_notecardsFolder; | 172 | request += m_notecardsFolder; |
170 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map>"; | 173 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000001</uuid><key>sort_order</key><integer>1</integer></map>"; |
171 | request += "</array></map></llsd>"; | 174 | request += "</array></map></llsd>"; |
172 | 175 | ||
173 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); | 176 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); |
@@ -193,7 +196,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests | |||
193 | 196 | ||
194 | string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; | 197 | string request = "<llsd><map><key>folders</key><array><map><key>fetch_folders</key><integer>1</integer><key>fetch_items</key><boolean>1</boolean><key>folder_id</key><uuid>"; |
195 | request += "f0000000-0000-0000-0000-00000000000f"; | 198 | request += "f0000000-0000-0000-0000-00000000000f"; |
196 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000000</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>"; | 199 | request += "</uuid><key>owner_id</key><uuid>00000000-0000-0000-0000-000000000001</uuid><key>sort_order</key><integer>1</integer></map></array></map></llsd>"; |
197 | 200 | ||
198 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); | 201 | string llsdresponse = handler.FetchInventoryDescendentsRequest(request, "/FETCH", string.Empty, req, resp); |
199 | Console.WriteLine(llsdresponse); | 202 | Console.WriteLine(llsdresponse); |