aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-11 22:56:43 +0000
committerJustin Clark-Casey (justincc)2013-02-11 22:56:43 +0000
commit9d001e40e79b17a8b5eb4316f1f3525afd1b6b96 (patch)
tree567d6bff74dc2168411d28c1b6bb4ced77346a5f /OpenSim/Region
parentExtend TestJsonTestPath() for non-terminating section of path (i.e. one that ... (diff)
downloadopensim-SC_OLD-9d001e40e79b17a8b5eb4316f1f3525afd1b6b96.zip
opensim-SC_OLD-9d001e40e79b17a8b5eb4316f1f3525afd1b6b96.tar.gz
opensim-SC_OLD-9d001e40e79b17a8b5eb4316f1f3525afd1b6b96.tar.bz2
opensim-SC_OLD-9d001e40e79b17a8b5eb4316f1f3525afd1b6b96.tar.xz
Add section to TestJsonGetValue() to test call on a sub-tree
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs30
1 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index 98d8ff6..a2d065c 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -153,19 +153,31 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
153 TestHelpers.InMethod(); 153 TestHelpers.InMethod();
154// TestHelpers.EnableLogging(); 154// TestHelpers.EnableLogging();
155 155
156 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }"); 156 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
157
158 {
159 string value = (string)InvokeOp("JsonGetValue", storeId, "Hello.World");
160 Assert.That(value, Is.EqualTo("Two"));
161 }
157 162
158 string value = (string)InvokeOp("JsonGetValue", storeId, "Hello"); 163 // Test get of path section instead of leaf
159 Assert.That(value, Is.EqualTo("World")); 164 {
165 string value = (string)InvokeOp("JsonGetValue", storeId, "Hello");
166 Assert.That(value, Is.EqualTo(""));
167 }
160 168
161 // Test get of non-existing value 169 // Test get of non-existing value
162 string fakeValueGet = (string)InvokeOp("JsonGetValue", storeId, "foo"); 170 {
163 Assert.That(fakeValueGet, Is.EqualTo("")); 171 string fakeValueGet = (string)InvokeOp("JsonGetValue", storeId, "foo");
172 Assert.That(fakeValueGet, Is.EqualTo(""));
173 }
164 174
165 // Test get from non-existing store 175 // Test get from non-existing store
166 UUID fakeStoreId = TestHelpers.ParseTail(0x500); 176 {
167 string fakeStoreValueGet = (string)InvokeOp("JsonGetValue", fakeStoreId, "Hello"); 177 UUID fakeStoreId = TestHelpers.ParseTail(0x500);
168 Assert.That(fakeStoreValueGet, Is.EqualTo("")); 178 string fakeStoreValueGet = (string)InvokeOp("JsonGetValue", fakeStoreId, "Hello");
179 Assert.That(fakeStoreValueGet, Is.EqualTo(""));
180 }
169 } 181 }
170 182
171// [Test] 183// [Test]
@@ -432,7 +444,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
432 // Try read notecard to fake store. 444 // Try read notecard to fake store.
433 UUID fakeStoreId = TestHelpers.ParseTail(0x500); 445 UUID fakeStoreId = TestHelpers.ParseTail(0x500);
434 UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, fakeStoreId, "", notecardName); 446 UUID readNotecardRequestId = (UUID)InvokeOpOnHost("JsonReadNotecard", so.UUID, fakeStoreId, "", notecardName);
435 Assert.That(fakeStoreId, Is.Not.EqualTo(UUID.Zero)); 447 Assert.That(readNotecardRequestId, Is.Not.EqualTo(UUID.Zero));
436 448
437 string value = (string)InvokeOp("JsonGetValue", fakeStoreId, "Hello"); 449 string value = (string)InvokeOp("JsonGetValue", fakeStoreId, "Hello");
438 Assert.That(value, Is.EqualTo("")); 450 Assert.That(value, Is.EqualTo(""));