diff options
author | Justin Clark-Casey (justincc) | 2011-04-18 22:35:33 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-18 22:35:33 +0100 |
commit | 6600aa2baf56e1f58e50eb5589de876e910131bb (patch) | |
tree | 09459dae35add58e7620a87b7d1e8ac5031ecac6 /OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |
parent | add test to ensure that an IAR starts with the control file (diff) | |
download | opensim-SC_OLD-6600aa2baf56e1f58e50eb5589de876e910131bb.zip opensim-SC_OLD-6600aa2baf56e1f58e50eb5589de876e910131bb.tar.gz opensim-SC_OLD-6600aa2baf56e1f58e50eb5589de876e910131bb.tar.bz2 opensim-SC_OLD-6600aa2baf56e1f58e50eb5589de876e910131bb.tar.xz |
Add regression test to check that OARs start with the control file.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index e2760a2..2307c8e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -171,7 +171,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
171 | MemoryStream archiveReadStream = new MemoryStream(archive); | 171 | MemoryStream archiveReadStream = new MemoryStream(archive); |
172 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | 172 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); |
173 | 173 | ||
174 | bool gotControlFile = false; | ||
175 | bool gotNcAssetFile = false; | 174 | bool gotNcAssetFile = false; |
176 | 175 | ||
177 | string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); | 176 | string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); |
@@ -182,15 +181,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
182 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); | 181 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); |
183 | 182 | ||
184 | string filePath; | 183 | string filePath; |
185 | TarArchiveReader.TarEntryType tarEntryType; | 184 | TarArchiveReader.TarEntryType tarEntryType; |
186 | 185 | ||
186 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); | ||
187 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); | ||
188 | |||
189 | ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty); | ||
190 | arr.LoadControlFile(filePath, data); | ||
191 | |||
192 | Assert.That(arr.ControlFileLoaded, Is.True); | ||
193 | |||
187 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 194 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
188 | { | 195 | { |
189 | if (ArchiveConstants.CONTROL_FILE_PATH == filePath) | 196 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
190 | { | ||
191 | gotControlFile = true; | ||
192 | } | ||
193 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | ||
194 | { | 197 | { |
195 | string fileName = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); | 198 | string fileName = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); |
196 | 199 | ||
@@ -203,7 +206,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
203 | } | 206 | } |
204 | } | 207 | } |
205 | 208 | ||
206 | Assert.That(gotControlFile, Is.True, "No control file in archive"); | ||
207 | Assert.That(gotNcAssetFile, Is.True, "No notecard asset file in archive"); | 209 | Assert.That(gotNcAssetFile, Is.True, "No notecard asset file in archive"); |
208 | Assert.That(foundPaths, Is.EquivalentTo(expectedPaths)); | 210 | Assert.That(foundPaths, Is.EquivalentTo(expectedPaths)); |
209 | 211 | ||