diff options
Diffstat (limited to 'OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs')
-rw-r--r-- | OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs b/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs index dbb877d..b3cccfd 100644 --- a/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs +++ b/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs | |||
@@ -4,7 +4,10 @@ using System.Text; | |||
4 | using NUnit.Framework; | 4 | using NUnit.Framework; |
5 | using OpenSim.Data; | 5 | using OpenSim.Data; |
6 | using OpenSim.Framework.Servers.HttpServer; | 6 | using OpenSim.Framework.Servers.HttpServer; |
7 | using OpenSim.Services.Interfaces; | ||
7 | using OpenSim.Tests.Common; | 8 | using OpenSim.Tests.Common; |
9 | using OpenSim.Tests.Common.Mock; | ||
10 | using OpenSim.Tests.Common.Setup; | ||
8 | 11 | ||
9 | namespace OpenSim.Framework.Servers.Tests | 12 | namespace OpenSim.Framework.Servers.Tests |
10 | { | 13 | { |
@@ -59,14 +62,34 @@ namespace OpenSim.Framework.Servers.Tests | |||
59 | BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); | 62 | BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); |
60 | } | 63 | } |
61 | 64 | ||
62 | //[Test] | 65 | [Test] |
63 | //public void TestHandleFetchMissingAsset() | 66 | public void TestHandleFetchMissingAsset() |
64 | //{ | 67 | { |
68 | IAssetCache assetCache = new TestAssetCache(); | ||
69 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(assetCache); | ||
70 | |||
71 | GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler); | ||
72 | } | ||
73 | |||
74 | [Test] | ||
75 | public void TestHandleFetchExistingAssetData() | ||
76 | { | ||
77 | CachedGetAssetStreamHandler handler; | ||
78 | OSHttpResponse response; | ||
79 | AssetBase asset = CreateTestEnvironment(out handler, out response); | ||
80 | |||
81 | GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response); | ||
82 | } | ||
65 | 83 | ||
66 | // byte[] emptyResult = new byte[] { }; | 84 | private static AssetBase CreateTestEnvironment(out CachedGetAssetStreamHandler handler, out OSHttpResponse response) |
67 | // CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | 85 | { |
86 | AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response); | ||
87 | |||
88 | IAssetCache assetDataPlugin = new TestAssetCache(); | ||
89 | handler = new CachedGetAssetStreamHandler(assetDataPlugin); | ||
68 | 90 | ||
69 | // Assert.AreEqual(new string[] { }, handler.Handle("/assets/badGuid", null, null, null), "Failed on bad guid."); | 91 | assetDataPlugin.AddAsset(asset); |
70 | //} | 92 | return asset; |
93 | } | ||
71 | } | 94 | } |
72 | } | 95 | } |