diff options
Diffstat (limited to 'indra/test')
| -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"); +	}  } | 
