aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-11 22:44:25 +0000
committerJustin Clark-Casey (justincc)2013-02-11 22:44:25 +0000
commit8fcfd8224165908284b729935a5bf61d07545958 (patch)
tree58e424924fbc945676c19daba6ffe4bd324112bc /OpenSim/Region/OptionalModules/Scripting
parentAdd section to TestJsonSetValue() to test attempted set of value where the pe... (diff)
downloadopensim-SC_OLD-8fcfd8224165908284b729935a5bf61d07545958.zip
opensim-SC_OLD-8fcfd8224165908284b729935a5bf61d07545958.tar.gz
opensim-SC_OLD-8fcfd8224165908284b729935a5bf61d07545958.tar.bz2
opensim-SC_OLD-8fcfd8224165908284b729935a5bf61d07545958.tar.xz
Extend TestJsonTestPath() for non-terminating section of path (i.e. one that does not point to a value/leaf)
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index 2af3afc..98d8ff6 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -224,18 +224,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
224 TestHelpers.InMethod(); 224 TestHelpers.InMethod();
225// TestHelpers.EnableLogging(); 225// TestHelpers.EnableLogging();
226 226
227 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }"); 227 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
228 228
229 int result = (int)InvokeOp("JsonTestPath", storeId, "Hello"); 229 {
230 Assert.That(result, Is.EqualTo(1)); 230 int result = (int)InvokeOp("JsonTestPath", storeId, "Hello.World");
231 Assert.That(result, Is.EqualTo(1));
232 }
233
234 // Test for path which does not resolve to a value.
235 {
236 int result = (int)InvokeOp("JsonTestPath", storeId, "Hello");
237 Assert.That(result, Is.EqualTo(0));
238 }
231 239
232 int result2 = (int)InvokeOp("JsonTestPath", storeId, "foo"); 240 {
233 Assert.That(result2, Is.EqualTo(0)); 241 int result2 = (int)InvokeOp("JsonTestPath", storeId, "foo");
242 Assert.That(result2, Is.EqualTo(0));
243 }
234 244
235 // Test with fake store 245 // Test with fake store
236 UUID fakeStoreId = TestHelpers.ParseTail(0x500); 246 {
237 int fakeStoreValueRemove = (int)InvokeOp("JsonTestPath", fakeStoreId, "Hello"); 247 UUID fakeStoreId = TestHelpers.ParseTail(0x500);
238 Assert.That(fakeStoreValueRemove, Is.EqualTo(0)); 248 int fakeStoreValueRemove = (int)InvokeOp("JsonTestPath", fakeStoreId, "Hello");
249 Assert.That(fakeStoreValueRemove, Is.EqualTo(0));
250 }
239 } 251 }
240 252
241 [Test] 253 [Test]