diff options
author | Christian Goetze <cg@lindenlab.com> | 2007-12-01 01:29:28 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2007-12-01 01:29:28 +0000 |
commit | 7b7dd4e6f61aa731ef7f9f255014f5b76d5b9fec (patch) | |
tree | 08bf4cb9354f975940b83cd695a2aa8bb8d74870 /indra/test/llservicebuilder_tut.cpp | |
parent | 5c53c187fff573ef73a643949b3bded1084b0983 (diff) |
svn merge -r74808:74832 svn+ssh://svn/svn/linden/branches/qa-dpo-9a
Diffstat (limited to 'indra/test/llservicebuilder_tut.cpp')
-rw-r--r-- | indra/test/llservicebuilder_tut.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/indra/test/llservicebuilder_tut.cpp b/indra/test/llservicebuilder_tut.cpp index 127a2a1220..14f3774f7c 100644 --- a/indra/test/llservicebuilder_tut.cpp +++ b/indra/test/llservicebuilder_tut.cpp @@ -113,5 +113,66 @@ namespace tut test_url , "/proc/do/something/useful?estate_id=1&query=public"); } + + template<> template<> + void ServiceBuilderTestObject::test<6>() + { + LLSD test_block; + test_block["service-builder"] = "Which way to the {${$baz}}?"; + mServiceBuilder.createServiceDefinition( + "ServiceBuilderTest", + test_block["service-builder"]); + + LLSD data_map; + data_map["foo"] = "bar"; + data_map["baz"] = "foo"; + std::string test_url = mServiceBuilder.buildServiceURI( + "ServiceBuilderTest", + data_map); + ensure_equals( + "recursive url creation", + test_url , + "Which way to the bar?"); + } + + template<> template<> + void ServiceBuilderTestObject::test<7>() + { + LLSD test_block; + test_block["service-builder"] = "Which way to the {$foo}?"; + mServiceBuilder.createServiceDefinition( + "ServiceBuilderTest", + test_block["service-builder"]); + + LLSD data_map; + data_map["baz"] = "foo"; + std::string test_url = mServiceBuilder.buildServiceURI( + "ServiceBuilderTest", + data_map); + ensure_equals( + "fails to do replacement", + test_url , + "Which way to the {$foo}?"); + } + + template<> template<> + void ServiceBuilderTestObject::test<8>() + { + LLSD test_block; + test_block["service-builder"] = "/proc/{$proc}{%params}"; + mServiceBuilder.createServiceDefinition( + "ServiceBuilderTest", + test_block["service-builder"]); + LLSD data_map; + data_map["proc"] = "do/something/useful"; + data_map["params"] = LLSD(); + std::string test_url = mServiceBuilder.buildServiceURI( + "ServiceBuilderTest", + data_map); + ensure_equals( + "strip params", + test_url , + "/proc/do/something/useful"); + } } |