aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs b/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
index 9e82576..427fa16 100644
--- a/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
+++ b/OpenSim/Server/Handlers/Asset/Tests/AssetServerPostHandlerTests.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Net;
30using System.Text; 31using System.Text;
31using System.Xml; 32using System.Xml;
32using System.Xml.Serialization; 33using System.Xml.Serialization;
@@ -38,6 +39,7 @@ using OpenSim.Server.Handlers.Asset;
38using OpenSim.Services.AssetService; 39using OpenSim.Services.AssetService;
39using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
40using OpenSim.Tests.Common; 41using OpenSim.Tests.Common;
42using OpenSim.Tests.Common.Mock;
41 43
42namespace OpenSim.Server.Handlers.Asset.Test 44namespace OpenSim.Server.Handlers.Asset.Test
43{ 45{
@@ -80,5 +82,29 @@ namespace OpenSim.Server.Handlers.Asset.Test
80 82
81 Assert.That(retrievedAsset, Is.Not.Null); 83 Assert.That(retrievedAsset, Is.Not.Null);
82 } 84 }
85
86 [Test]
87 public void TestBadXmlAssetStoreRequest()
88 {
89 TestHelpers.InMethod();
90
91 IConfigSource config = new IniConfigSource();
92 config.AddConfig("AssetService");
93 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
94
95 AssetService assetService = new AssetService(config);
96
97 AssetServerPostHandler asph = new AssetServerPostHandler(assetService);
98
99 MemoryStream buffer = new MemoryStream();
100 byte[] badData = new byte[] { 0x48, 0x65, 0x6c, 0x6c, 0x6f };
101 buffer.Write(badData, 0, badData.Length);
102 buffer.Position = 0;
103
104 TestOSHttpResponse response = new TestOSHttpResponse();
105 asph.Handle(null, buffer, null, response);
106
107 Assert.That(response.StatusCode, Is.EqualTo((int)HttpStatusCode.BadRequest));
108 }
83 } 109 }
84} \ No newline at end of file 110} \ No newline at end of file