aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/Tests
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-19 21:57:12 +0000
committerJustin Clark-Casey (justincc)2012-01-19 21:57:12 +0000
commitd38e2c0c91b684d54974865d3ac2fb88c3354c21 (patch)
tree43a517d5df2b8b6d9444446c9d23ad7b394a883d /OpenSim/Region/ClientStack/Linden/UDP/Tests
parentrefactor: separate out common parts of LLImageManagerTests (diff)
downloadopensim-SC_OLD-d38e2c0c91b684d54974865d3ac2fb88c3354c21.zip
opensim-SC_OLD-d38e2c0c91b684d54974865d3ac2fb88c3354c21.tar.gz
opensim-SC_OLD-d38e2c0c91b684d54974865d3ac2fb88c3354c21.tar.bz2
opensim-SC_OLD-d38e2c0c91b684d54974865d3ac2fb88c3354c21.tar.xz
Add image not in database test for LLImageManager
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs33
1 files changed, 28 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index f176964..1b68d68 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -46,6 +46,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
46 public class LLImageManagerTests 46 public class LLImageManagerTests
47 { 47 {
48 private AssetBase m_testImageAsset; 48 private AssetBase m_testImageAsset;
49 private Scene scene;
49 private LLImageManager llim; 50 private LLImageManager llim;
50 private TestClient tc; 51 private TestClient tc;
51 52
@@ -78,21 +79,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
78 79
79 J2KDecoderModule j2kdm = new J2KDecoderModule(); 80 J2KDecoderModule j2kdm = new J2KDecoderModule();
80 81
81 Scene scene = SceneHelpers.SetupScene(); 82 scene = SceneHelpers.SetupScene();
82 SceneHelpers.SetupSceneModules(scene, j2kdm); 83 SceneHelpers.SetupSceneModules(scene, j2kdm);
83 84
84 scene.AssetService.Store(m_testImageAsset);
85
86 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene); 85 tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
87 llim = new LLImageManager(tc, scene.AssetService, j2kdm); 86 llim = new LLImageManager(tc, scene.AssetService, j2kdm);
88 } 87 }
89 88
90 [Test] 89 [Test]
91 public void TestRequestAndSendImage() 90 public void TestSendImage()
92 { 91 {
93 TestHelpers.InMethod(); 92 TestHelpers.InMethod();
94// XmlConfigurator.Configure(); 93// XmlConfigurator.Configure();
95 94
95 scene.AssetService.Store(m_testImageAsset);
96
96 TextureRequestArgs args = new TextureRequestArgs(); 97 TextureRequestArgs args = new TextureRequestArgs();
97 args.RequestedAssetID = m_testImageAsset.FullID; 98 args.RequestedAssetID = m_testImageAsset.FullID;
98 args.DiscardLevel = 0; 99 args.DiscardLevel = 0;
@@ -107,11 +108,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
107 } 108 }
108 109
109 [Test] 110 [Test]
110 public void TestRequestAndDiscardImage() 111 public void TestDiscardImage()
111 { 112 {
112 TestHelpers.InMethod(); 113 TestHelpers.InMethod();
113// XmlConfigurator.Configure(); 114// XmlConfigurator.Configure();
114 115
116 scene.AssetService.Store(m_testImageAsset);
117
115 TextureRequestArgs args = new TextureRequestArgs(); 118 TextureRequestArgs args = new TextureRequestArgs();
116 args.RequestedAssetID = m_testImageAsset.FullID; 119 args.RequestedAssetID = m_testImageAsset.FullID;
117 args.DiscardLevel = 0; 120 args.DiscardLevel = 0;
@@ -133,5 +136,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
133 136
134 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0)); 137 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
135 } 138 }
139
140 [Test]
141 public void TestMissingImage()
142 {
143 TestHelpers.InMethod();
144// XmlConfigurator.Configure();
145
146 TextureRequestArgs args = new TextureRequestArgs();
147 args.RequestedAssetID = m_testImageAsset.FullID;
148 args.DiscardLevel = 0;
149 args.PacketNumber = 1;
150 args.Priority = 5;
151 args.requestSequence = 1;
152
153 llim.EnqueueReq(args);
154 llim.ProcessImageQueue(20);
155
156 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
157 Assert.That(tc.SentImageNotInDatabasePackets.Count, Is.EqualTo(1));
158 }
136 } 159 }
137} \ No newline at end of file 160} \ No newline at end of file