aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-02-11 23:47:49 +0000
committerJustin Clark-Casey (justincc)2013-02-11 23:47:49 +0000
commitd55974bcb7e0dc2931c9ca18e4bbe85fb0ef5440 (patch)
tree2647b7b59fecf78975c0962dad4bdcf06f7d338b /OpenSim
parentAdd regression TestJsonTestPathJson() (diff)
downloadopensim-SC_OLD-d55974bcb7e0dc2931c9ca18e4bbe85fb0ef5440.zip
opensim-SC_OLD-d55974bcb7e0dc2931c9ca18e4bbe85fb0ef5440.tar.gz
opensim-SC_OLD-d55974bcb7e0dc2931c9ca18e4bbe85fb0ef5440.tar.bz2
opensim-SC_OLD-d55974bcb7e0dc2931c9ca18e4bbe85fb0ef5440.tar.xz
Add regression TestJsonGetValueJson()
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index de42e74..ddbfa45 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -180,6 +180,39 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
180 } 180 }
181 } 181 }
182 182
183 [Test]
184 public void TestJsonGetValueJson()
185 {
186 TestHelpers.InMethod();
187// TestHelpers.EnableLogging();
188
189 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }");
190
191 {
192 string value = (string)InvokeOp("JsonGetValueJson", storeId, "Hello.World");
193 Assert.That(value, Is.EqualTo("'Two'"));
194 }
195
196 // Test get of path section instead of leaf
197 {
198 string value = (string)InvokeOp("JsonGetValueJson", storeId, "Hello");
199 Assert.That(value, Is.EqualTo("{\"World\":\"Two\"}"));
200 }
201
202 // Test get of non-existing value
203 {
204 string fakeValueGet = (string)InvokeOp("JsonGetValueJson", storeId, "foo");
205 Assert.That(fakeValueGet, Is.EqualTo(""));
206 }
207
208 // Test get from non-existing store
209 {
210 UUID fakeStoreId = TestHelpers.ParseTail(0x500);
211 string fakeStoreValueGet = (string)InvokeOp("JsonGetValueJson", fakeStoreId, "Hello");
212 Assert.That(fakeStoreValueGet, Is.EqualTo(""));
213 }
214 }
215
183// [Test] 216// [Test]
184// public void TestJsonTakeValue() 217// public void TestJsonTakeValue()
185// { 218// {