aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorlbsa712009-05-27 11:54:17 +0000
committerlbsa712009-05-27 11:54:17 +0000
commit892406248ab6452871fa8ac74c8c8b856feee070 (patch)
tree9a7345d58d1027e9194fede31bb50ad91a0cd655
parentCatching weirdnesses on resolving External EndPoint in agent transfers. Will ... (diff)
downloadopensim-SC_OLD-892406248ab6452871fa8ac74c8c8b856feee070.zip
opensim-SC_OLD-892406248ab6452871fa8ac74c8c8b856feee070.tar.gz
opensim-SC_OLD-892406248ab6452871fa8ac74c8c8b856feee070.tar.bz2
opensim-SC_OLD-892406248ab6452871fa8ac74c8c8b856feee070.tar.xz
* Added OpenSim.Server.Handlers.Tests project
* Added AssetServerGetHandlerTests - not really wired up yet; more to come. * Ignored some gens
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs8
-rw-r--r--OpenSim/Server/Handlers/Tests/Asset/AssetServerGetHandlerTests.cs103
-rw-r--r--prebuild.xml38
3 files changed, 144 insertions, 5 deletions
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index d827b86..c0749e3 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -32,6 +32,7 @@ using System.Xml;
32using System.Xml.Serialization; 32using System.Xml.Serialization;
33using System.Text; 33using System.Text;
34using log4net; 34using log4net;
35using OpenSim.Framework;
35 36
36namespace OpenSim.Server.Base 37namespace OpenSim.Server.Base
37{ 38{
@@ -92,7 +93,7 @@ namespace OpenSim.Server.Base
92 93
93 ms.Seek(0, SeekOrigin.Begin); 94 ms.Seek(0, SeekOrigin.Begin);
94 byte[] ret = ms.GetBuffer(); 95 byte[] ret = ms.GetBuffer();
95 Array.Resize<byte>(ref ret, (int)ms.Length); 96 Array.Resize(ref ret, (int)ms.Length);
96 97
97 return ret; 98 return ret;
98 } 99 }
@@ -117,9 +118,6 @@ namespace OpenSim.Server.Base
117 118
118 try 119 try
119 { 120 {
120 //m_log.DebugFormat("[PLUGINS]: Loading plugins from {0}", System.IO.Directory.GetCurrentDirectory());
121 //m_log.DebugFormat("[PLUGINS]: Trying to load {0}", dllName);
122
123 Assembly pluginAssembly = Assembly.LoadFrom(dllName); 121 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
124 122
125 foreach (Type pluginType in pluginAssembly.GetTypes()) 123 foreach (Type pluginType in pluginAssembly.GetTypes())
@@ -152,4 +150,4 @@ namespace OpenSim.Server.Base
152 } 150 }
153 } 151 }
154 } 152 }
155} 153} \ No newline at end of file
diff --git a/OpenSim/Server/Handlers/Tests/Asset/AssetServerGetHandlerTests.cs b/OpenSim/Server/Handlers/Tests/Asset/AssetServerGetHandlerTests.cs
new file mode 100644
index 0000000..3636972
--- /dev/null
+++ b/OpenSim/Server/Handlers/Tests/Asset/AssetServerGetHandlerTests.cs
@@ -0,0 +1,103 @@
1using NUnit.Framework;
2using OpenSim.Framework;
3using OpenSim.Framework.Servers.HttpServer;
4using OpenSim.Server.Handlers.Asset;
5using OpenSim.Services.Interfaces;
6using OpenSim.Tests.Common;
7using OpenSim.Tests.Common.Mock;
8using OpenSim.Tests.Common.Setup;
9
10namespace OpenSim.Server.Handlers.Tests.Asset
11{
12 [TestFixture]
13 public class AssetServerGetHandlerTests
14 {
15 private const string ASSETS_PATH = "/assets";
16
17 [Test]
18 public void TestConstructor()
19 {
20 TestHelper.InMethod();
21
22 AssetServerGetHandler handler = new AssetServerGetHandler( null );
23 }
24
25 [Test]
26 public void TestGetParams()
27 {
28 TestHelper.InMethod();
29
30 AssetServerGetHandler handler = new AssetServerGetHandler(null);
31 BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH);
32 }
33
34 [Test]
35 public void TestSplitParams()
36 {
37 TestHelper.InMethod();
38
39 AssetServerGetHandler handler = new AssetServerGetHandler(null);
40 BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH);
41 }
42
43 //[Test]
44 //public void TestHandleNoParams()
45 //{
46 // TestHelper.InMethod();
47
48 // AssetServerGetHandler handler = new AssetServerGetHandler(null);
49
50 // BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH);
51 //}
52
53 //[Test]
54 //public void TestHandleMalformedGuid()
55 //{
56 // TestHelper.InMethod();
57
58 // AssetServerGetHandler handler = new AssetServerGetHandler(null);
59
60 // BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH);
61 //}
62
63 //[Test]
64 //public void TestHandleFetchMissingAsset()
65 //{
66 // IAssetService assetDataPlugin = new TestAssetDataPlugin();
67 // AssetServerGetHandler handler = new AssetServerGetHandler(assetDataPlugin);
68
69 // GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler);
70 //}
71
72 //[Test]
73 //public void TestHandleFetchExistingAssetData()
74 //{
75 // AssetServerGetHandler handler;
76 // OSHttpResponse response;
77 // AssetBase asset = CreateTestEnvironment(out handler, out response);
78
79 // GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response);
80 //}
81
82 //[Test]
83 //public void TestHandleFetchExistingAssetXml()
84 //{
85 // AssetServerGetHandler handler;
86 // OSHttpResponse response;
87 // AssetBase asset = CreateTestEnvironment(out handler, out response);
88
89 // GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response);
90 //}
91
92 private static AssetBase CreateTestEnvironment(out AssetServerGetHandler handler, out OSHttpResponse response)
93 {
94 AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response);
95
96 IAssetService assetDataPlugin = new TestAssetService();
97 handler = new AssetServerGetHandler(assetDataPlugin);
98
99 assetDataPlugin.Store(asset);
100 return asset;
101 }
102 }
103} \ No newline at end of file
diff --git a/prebuild.xml b/prebuild.xml
index 39b139a..5272a89 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -365,6 +365,7 @@
365 <Reference name="System"/> 365 <Reference name="System"/>
366 <Reference name="System.Xml"/> 366 <Reference name="System.Xml"/>
367 <Reference name="OpenSim.Data"/> 367 <Reference name="OpenSim.Data"/>
368 <Reference name="OpenSim.Servers.Base"/>
368 <Reference name="OpenSim.Framework"/> 369 <Reference name="OpenSim.Framework"/>
369 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 370 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
370 <Reference name="OpenSim.Framework.Console"/> 371 <Reference name="OpenSim.Framework.Console"/>
@@ -1414,6 +1415,42 @@
1414 <Reference name="log4net.dll"/> 1415 <Reference name="log4net.dll"/>
1415 1416
1416 <Files> 1417 <Files>
1418 <Match pattern="*.cs" recurse="true">
1419 <Exclude pattern="Tests" />
1420 </Match>
1421 </Files>
1422 </Project>
1423
1424 <Project name="OpenSim.Server.Handlers.Tests" path="OpenSim/Server/Handlers/Tests" type="Library">
1425 <Configuration name="Debug">
1426 <Options>
1427 <OutputPath>../../../../bin/</OutputPath>
1428 </Options>
1429 </Configuration>
1430 <Configuration name="Release">
1431 <Options>
1432 <OutputPath>../../../../bin/</OutputPath>
1433 </Options>
1434 </Configuration>
1435
1436 <ReferencePath>../../../../bin/</ReferencePath>
1437 <Reference name="System"/>
1438 <Reference name="System.Xml"/>
1439 <Reference name="OpenMetaverseTypes.dll"/>
1440 <Reference name="OpenMetaverse.dll"/>
1441 <Reference name="nunit.framework.dll" />
1442 <Reference name="OpenSim.Framework"/>
1443 <Reference name="OpenSim.Framework.Console"/>
1444 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
1445 <Reference name="OpenSim.Server.Handlers"/>
1446 <Reference name="OpenSim.Server.Base"/>
1447 <Reference name="OpenSim.Services.Base" />
1448 <Reference name="OpenSim.Services.Interfaces"/>
1449 <Reference name="OpenSim.Tests.Common"/>
1450 <Reference name="Nini.dll" />
1451 <Reference name="log4net.dll"/>
1452
1453 <Files>
1417 <Match pattern="*.cs" recurse="true"/> 1454 <Match pattern="*.cs" recurse="true"/>
1418 </Files> 1455 </Files>
1419 </Project> 1456 </Project>
@@ -3220,6 +3257,7 @@
3220 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 3257 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
3221 <Reference name="OpenSim.Data"/> 3258 <Reference name="OpenSim.Data"/>
3222 <Reference name="OpenSim.Services.Interfaces"/> 3259 <Reference name="OpenSim.Services.Interfaces"/>
3260 <Reference name="OpenSim.Servers.Base"/>
3223 <Reference name="OpenSim.Region.Communications.Local"/> 3261 <Reference name="OpenSim.Region.Communications.Local"/>
3224 <Reference name="OpenSim.Region.Framework"/> 3262 <Reference name="OpenSim.Region.Framework"/>
3225 <Reference name="OpenSim.Region.CoreModules"/> 3263 <Reference name="OpenSim.Region.CoreModules"/>