public void TestTextureNotFound() { TestHelpers.InMethod(); // Overkill - we only really need the asset service, not a whole scene. Scene scene = new SceneHelpers().SetupScene(); GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null); TestOSHttpRequest req = new TestOSHttpRequest(); TestOSHttpResponse resp = new TestOSHttpResponse(); req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012"); handler.Handle(null, null, req, resp); Assert.That(resp.StatusCode, Is.EqualTo((int)System.Net.HttpStatusCode.NotFound)); }
public void RegionLoaded(Scene s) { // We'll reuse the same handler for all requests. m_getTextureHandler = new GetTextureHandler(m_assetService); m_scene.EventManager.OnRegisterCaps += RegisterCaps; m_scene.EventManager.OnDeregisterCaps += DeregisterCaps; m_scene.EventManager.OnThrottleUpdate += ThrottleUpdate; m_NumberScenes++; if (m_workerThreads == null) { m_workerThreads = new Thread[2]; for (uint i = 0; i < 2; i++) { m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests, String.Format("GetTextureWorker{0}", i), ThreadPriority.Normal, false, false, null, int.MaxValue); } } }