diff options
author | lbsa71 | 2009-05-08 06:11:44 +0000 |
---|---|---|
committer | lbsa71 | 2009-05-08 06:11:44 +0000 |
commit | 8ac73be9178ac9b7445534522f5b574df29fa560 (patch) | |
tree | 04307ff1fa089c38e50d684aa996e1fd2b449e1c /OpenSim/Framework/Servers/HttpServer | |
parent | Thanks lulurun for a patch which addresses Mantis #3599: Exceptions when Asse... (diff) | |
download | opensim-SC_OLD-8ac73be9178ac9b7445534522f5b574df29fa560.zip opensim-SC_OLD-8ac73be9178ac9b7445534522f5b574df29fa560.tar.gz opensim-SC_OLD-8ac73be9178ac9b7445534522f5b574df29fa560.tar.bz2 opensim-SC_OLD-8ac73be9178ac9b7445534522f5b574df29fa560.tar.xz |
* Introduced new HttpServer.Tests project
* Split the GetAssetStreamHandler testing into separate tests for BaseRequestHandler
* Ignored some gens
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs | 7 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/Tests/BaseRequestHandlerTests.cs | 43 |
2 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs index da4f9a8..c47a44a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs | |||
@@ -75,5 +75,12 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
75 | 75 | ||
76 | return path.StartsWith(Path); | 76 | return path.StartsWith(Path); |
77 | } | 77 | } |
78 | |||
79 | public string[] SplitParams(string path) | ||
80 | { | ||
81 | string param = GetParam(path); | ||
82 | |||
83 | return param.Split(new char[] { '/', '?', '&' }, StringSplitOptions.RemoveEmptyEntries); | ||
84 | } | ||
78 | } | 85 | } |
79 | } | 86 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/Tests/BaseRequestHandlerTests.cs b/OpenSim/Framework/Servers/HttpServer/Tests/BaseRequestHandlerTests.cs new file mode 100644 index 0000000..14998c5 --- /dev/null +++ b/OpenSim/Framework/Servers/HttpServer/Tests/BaseRequestHandlerTests.cs | |||
@@ -0,0 +1,43 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using NUnit.Framework; | ||
5 | using OpenSim.Tests.Common; | ||
6 | |||
7 | namespace OpenSim.Framework.Servers.HttpServer.Tests | ||
8 | { | ||
9 | [TestFixture] | ||
10 | public class BaseRequestHandlerTests | ||
11 | { | ||
12 | private const string BASE_PATH = "/testpath"; | ||
13 | |||
14 | private class BaseRequestHandlerImpl : BaseRequestHandler | ||
15 | { | ||
16 | public BaseRequestHandlerImpl(string httpMethod, string path) : base(httpMethod, path) | ||
17 | { | ||
18 | } | ||
19 | } | ||
20 | |||
21 | [Test] | ||
22 | public void TestConstructor() | ||
23 | { | ||
24 | BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl( null, null ); | ||
25 | } | ||
26 | |||
27 | [Test] | ||
28 | public void TestGetParams() | ||
29 | { | ||
30 | BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl(null, BASE_PATH); | ||
31 | |||
32 | BaseRequestHandlerTestHelper.BaseTestGetParams(handler, BASE_PATH); | ||
33 | } | ||
34 | |||
35 | [Test] | ||
36 | public void TestSplitParams() | ||
37 | { | ||
38 | BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl(null, BASE_PATH); | ||
39 | |||
40 | BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, BASE_PATH); | ||
41 | } | ||
42 | } | ||
43 | } | ||