diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/test/llservicebuilder_tut.cpp | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/linden/indra/test/llservicebuilder_tut.cpp b/linden/indra/test/llservicebuilder_tut.cpp index 2afe8e1..6e8e299 100644 --- a/linden/indra/test/llservicebuilder_tut.cpp +++ b/linden/indra/test/llservicebuilder_tut.cpp | |||
@@ -13,12 +13,12 @@ | |||
13 | * ("GPL"), unless you have obtained a separate licensing agreement | 13 | * ("GPL"), unless you have obtained a separate licensing agreement |
14 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 14 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
16 | * online at http://secondlife.com/developers/opensource/gplv2 | 16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
17 | * | 17 | * |
18 | * There are special exceptions to the terms and conditions of the GPL as | 18 | * There are special exceptions to the terms and conditions of the GPL as |
19 | * it is applied to this Source Code. View the full text of the exception | 19 | * it is applied to this Source Code. View the full text of the exception |
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 20 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
21 | * online at http://secondlife.com/developers/opensource/flossexception | 21 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
22 | * | 22 | * |
23 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
24 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -113,5 +113,66 @@ namespace tut | |||
113 | test_url , | 113 | test_url , |
114 | "/proc/do/something/useful?estate_id=1&query=public"); | 114 | "/proc/do/something/useful?estate_id=1&query=public"); |
115 | } | 115 | } |
116 | |||
117 | template<> template<> | ||
118 | void ServiceBuilderTestObject::test<6>() | ||
119 | { | ||
120 | LLSD test_block; | ||
121 | test_block["service-builder"] = "Which way to the {${$baz}}?"; | ||
122 | mServiceBuilder.createServiceDefinition( | ||
123 | "ServiceBuilderTest", | ||
124 | test_block["service-builder"]); | ||
125 | |||
126 | LLSD data_map; | ||
127 | data_map["foo"] = "bar"; | ||
128 | data_map["baz"] = "foo"; | ||
129 | std::string test_url = mServiceBuilder.buildServiceURI( | ||
130 | "ServiceBuilderTest", | ||
131 | data_map); | ||
132 | ensure_equals( | ||
133 | "recursive url creation", | ||
134 | test_url , | ||
135 | "Which way to the bar?"); | ||
136 | } | ||
137 | |||
138 | template<> template<> | ||
139 | void ServiceBuilderTestObject::test<7>() | ||
140 | { | ||
141 | LLSD test_block; | ||
142 | test_block["service-builder"] = "Which way to the {$foo}?"; | ||
143 | mServiceBuilder.createServiceDefinition( | ||
144 | "ServiceBuilderTest", | ||
145 | test_block["service-builder"]); | ||
146 | |||
147 | LLSD data_map; | ||
148 | data_map["baz"] = "foo"; | ||
149 | std::string test_url = mServiceBuilder.buildServiceURI( | ||
150 | "ServiceBuilderTest", | ||
151 | data_map); | ||
152 | ensure_equals( | ||
153 | "fails to do replacement", | ||
154 | test_url , | ||
155 | "Which way to the {$foo}?"); | ||
156 | } | ||
157 | |||
158 | template<> template<> | ||
159 | void ServiceBuilderTestObject::test<8>() | ||
160 | { | ||
161 | LLSD test_block; | ||
162 | test_block["service-builder"] = "/proc/{$proc}{%params}"; | ||
163 | mServiceBuilder.createServiceDefinition( | ||
164 | "ServiceBuilderTest", | ||
165 | test_block["service-builder"]); | ||
166 | LLSD data_map; | ||
167 | data_map["proc"] = "do/something/useful"; | ||
168 | data_map["params"] = LLSD(); | ||
169 | std::string test_url = mServiceBuilder.buildServiceURI( | ||
170 | "ServiceBuilderTest", | ||
171 | data_map); | ||
172 | ensure_equals( | ||
173 | "strip params", | ||
174 | test_url , | ||
175 | "/proc/do/something/useful"); | ||
176 | } | ||
116 | } | 177 | } |
117 | 178 | ||