diff options
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs b/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs deleted file mode 100644 index be3f518..0000000 --- a/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using System.Text; | ||
32 | using HttpServer; | ||
33 | using NUnit.Framework; | ||
34 | using OpenSim.Data; | ||
35 | using OpenSim.Framework.Servers.HttpServer; | ||
36 | using OpenSim.Tests.Common; | ||
37 | using OpenSim.Tests.Common.Mock; | ||
38 | using OpenSim.Tests.Common.Setup; | ||
39 | |||
40 | namespace OpenSim.Framework.Servers.Tests | ||
41 | { | ||
42 | [TestFixture] | ||
43 | public class GetAssetStreamHandlerTests | ||
44 | { | ||
45 | private const string ASSETS_PATH = "/assets"; | ||
46 | |||
47 | [Test] | ||
48 | public void TestConstructor() | ||
49 | { | ||
50 | TestHelper.InMethod(); | ||
51 | |||
52 | // GetAssetStreamHandler handler = | ||
53 | new GetAssetStreamHandler(null); | ||
54 | } | ||
55 | |||
56 | [Test] | ||
57 | public void TestGetParams() | ||
58 | { | ||
59 | TestHelper.InMethod(); | ||
60 | |||
61 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
62 | BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH); | ||
63 | } | ||
64 | |||
65 | [Test] | ||
66 | public void TestSplitParams() | ||
67 | { | ||
68 | TestHelper.InMethod(); | ||
69 | |||
70 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
71 | BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH); | ||
72 | } | ||
73 | |||
74 | [Test] | ||
75 | public void TestHandleNoParams() | ||
76 | { | ||
77 | TestHelper.InMethod(); | ||
78 | |||
79 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
80 | |||
81 | BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH); | ||
82 | } | ||
83 | |||
84 | [Test] | ||
85 | public void TestHandleMalformedGuid() | ||
86 | { | ||
87 | TestHelper.InMethod(); | ||
88 | |||
89 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
90 | |||
91 | BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); | ||
92 | } | ||
93 | |||
94 | [Test] | ||
95 | public void TestHandleFetchMissingAsset() | ||
96 | { | ||
97 | GetAssetStreamHandler handler; | ||
98 | OSHttpResponse response; | ||
99 | CreateTestEnvironment(out handler, out response); | ||
100 | |||
101 | GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler, response); | ||
102 | } | ||
103 | |||
104 | [Test] | ||
105 | public void TestHandleFetchExistingAssetData() | ||
106 | { | ||
107 | GetAssetStreamHandler handler; | ||
108 | OSHttpResponse response; | ||
109 | AssetBase asset = CreateTestEnvironment(out handler, out response); | ||
110 | |||
111 | GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response); | ||
112 | } | ||
113 | |||
114 | [Test] | ||
115 | public void TestHandleFetchExistingAssetXml() | ||
116 | { | ||
117 | GetAssetStreamHandler handler; | ||
118 | OSHttpResponse response; | ||
119 | AssetBase asset = CreateTestEnvironment(out handler, out response); | ||
120 | |||
121 | GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response); | ||
122 | } | ||
123 | |||
124 | private static AssetBase CreateTestEnvironment(out GetAssetStreamHandler handler, out OSHttpResponse response) | ||
125 | { | ||
126 | AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response); | ||
127 | |||
128 | IAssetDataPlugin assetDataPlugin = new TestAssetDataPlugin(); | ||
129 | handler = new GetAssetStreamHandler(assetDataPlugin); | ||
130 | |||
131 | assetDataPlugin.StoreAsset(asset); | ||
132 | return asset; | ||
133 | } | ||
134 | } | ||
135 | } | ||