aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests/AssetTests.cs
diff options
context:
space:
mode:
authorOren Hurvitz2014-03-31 11:53:12 +0300
committerOren Hurvitz2014-04-02 06:30:57 +0100
commitd1c3f8eef58b29eb8760eeb1ac03852a2387f927 (patch)
treeb8686f4ea01b6dac3740b9685734686e2178dd2d /OpenSim/Data/Tests/AssetTests.cs
parentfix orphaned code in sun module per mantis 7068 (diff)
downloadopensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.zip
opensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.gz
opensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.bz2
opensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.xz
Added assets service method AssetsExist(), which returns whether the given list of assets exist.
This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory.
Diffstat (limited to 'OpenSim/Data/Tests/AssetTests.cs')
-rw-r--r--OpenSim/Data/Tests/AssetTests.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs
index 8cb2ee0..d778d1c 100644
--- a/OpenSim/Data/Tests/AssetTests.cs
+++ b/OpenSim/Data/Tests/AssetTests.cs
@@ -107,10 +107,11 @@ namespace OpenSim.Data.Tests
107 public void T001_LoadEmpty() 107 public void T001_LoadEmpty()
108 { 108 {
109 TestHelpers.InMethod(); 109 TestHelpers.InMethod();
110 110
111 Assert.That(m_db.ExistsAsset(uuid1), Is.False); 111 bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 });
112 Assert.That(m_db.ExistsAsset(uuid2), Is.False); 112 Assert.IsFalse(exist[0]);
113 Assert.That(m_db.ExistsAsset(uuid3), Is.False); 113 Assert.IsFalse(exist[1]);
114 Assert.IsFalse(exist[2]);
114 } 115 }
115 116
116 [Test] 117 [Test]
@@ -159,9 +160,10 @@ namespace OpenSim.Data.Tests
159 AssetBase a3b = m_db.GetAsset(uuid3); 160 AssetBase a3b = m_db.GetAsset(uuid3);
160 Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a)); 161 Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a));
161 162
162 Assert.That(m_db.ExistsAsset(uuid1), Is.True); 163 bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 });
163 Assert.That(m_db.ExistsAsset(uuid2), Is.True); 164 Assert.IsTrue(exist[0]);
164 Assert.That(m_db.ExistsAsset(uuid3), Is.True); 165 Assert.IsTrue(exist[1]);
166 Assert.IsTrue(exist[2]);
165 167
166 List<AssetMetadata> metadatas = m_db.FetchAssetMetadataSet(0, 1000); 168 List<AssetMetadata> metadatas = m_db.FetchAssetMetadataSet(0, 1000);
167 169