diff options
author | Justin Clark-Casey (justincc) | 2013-02-11 23:10:07 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-11 23:10:07 +0000 |
commit | 6924bd21f48a4c2540ebd8316e966367157e97c7 (patch) | |
tree | d46487564d431c3af92c6bab6f47e30950ac6a54 /OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests | |
parent | Add section to TestJsonGetValue() to test call on a sub-tree (diff) | |
download | opensim-SC-6924bd21f48a4c2540ebd8316e966367157e97c7.zip opensim-SC-6924bd21f48a4c2540ebd8316e966367157e97c7.tar.gz opensim-SC-6924bd21f48a4c2540ebd8316e966367157e97c7.tar.bz2 opensim-SC-6924bd21f48a4c2540ebd8316e966367157e97c7.tar.xz |
Add regression TestJsonTestPathJson()
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index a2d065c..de42e74 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | |||
@@ -263,6 +263,38 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests | |||
263 | } | 263 | } |
264 | 264 | ||
265 | [Test] | 265 | [Test] |
266 | public void TestJsonTestPathJson() | ||
267 | { | ||
268 | TestHelpers.InMethod(); | ||
269 | // TestHelpers.EnableLogging(); | ||
270 | |||
271 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }"); | ||
272 | |||
273 | { | ||
274 | int result = (int)InvokeOp("JsonTestPathJson", storeId, "Hello.World"); | ||
275 | Assert.That(result, Is.EqualTo(1)); | ||
276 | } | ||
277 | |||
278 | // Test for path which does not resolve to a value. | ||
279 | { | ||
280 | int result = (int)InvokeOp("JsonTestPathJson", storeId, "Hello"); | ||
281 | Assert.That(result, Is.EqualTo(1)); | ||
282 | } | ||
283 | |||
284 | { | ||
285 | int result2 = (int)InvokeOp("JsonTestPathJson", storeId, "foo"); | ||
286 | Assert.That(result2, Is.EqualTo(0)); | ||
287 | } | ||
288 | |||
289 | // Test with fake store | ||
290 | { | ||
291 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); | ||
292 | int fakeStoreValueRemove = (int)InvokeOp("JsonTestPathJson", fakeStoreId, "Hello"); | ||
293 | Assert.That(fakeStoreValueRemove, Is.EqualTo(0)); | ||
294 | } | ||
295 | } | ||
296 | |||
297 | [Test] | ||
266 | public void TestJsonSetValue() | 298 | public void TestJsonSetValue() |
267 | { | 299 | { |
268 | TestHelpers.InMethod(); | 300 | TestHelpers.InMethod(); |