From d1c3f8eef58b29eb8760eeb1ac03852a2387f927 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 31 Mar 2014 11:53:12 +0300 Subject: 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. --- OpenSim/Data/Tests/AssetTests.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Data/Tests') 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 public void T001_LoadEmpty() { TestHelpers.InMethod(); - - Assert.That(m_db.ExistsAsset(uuid1), Is.False); - Assert.That(m_db.ExistsAsset(uuid2), Is.False); - Assert.That(m_db.ExistsAsset(uuid3), Is.False); + + bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 }); + Assert.IsFalse(exist[0]); + Assert.IsFalse(exist[1]); + Assert.IsFalse(exist[2]); } [Test] @@ -159,9 +160,10 @@ namespace OpenSim.Data.Tests AssetBase a3b = m_db.GetAsset(uuid3); Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a)); - Assert.That(m_db.ExistsAsset(uuid1), Is.True); - Assert.That(m_db.ExistsAsset(uuid2), Is.True); - Assert.That(m_db.ExistsAsset(uuid3), Is.True); + bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 }); + Assert.IsTrue(exist[0]); + Assert.IsTrue(exist[1]); + Assert.IsTrue(exist[2]); List metadatas = m_db.FetchAssetMetadataSet(0, 1000); -- cgit v1.1