Skip to content

Commit

Permalink
- a few new tests for examples section of the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rlgomes committed Feb 3, 2011
1 parent bb297bf commit baf65e4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/examples/yahoo/yql/input/yql.properties
@@ -0,0 +1,9 @@

yql.url.v1=http://query.yahooapis.com/v1/public/yql
yql.url=${yql.url.v1}

yql.perf.iterations=100
yql.perf.threads=1
yql.perf.agent=1
yql.queries=SELECT * FROM search.web WHERE query='pizza',\
SELECT * FROM flickr.photos.search WHERE text='Cat'
40 changes: 40 additions & 0 deletions tests/examples/yahoo/yql/simple_query.xml
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<script xmlns="http://dtf.org/v1" name="simple_query">
<info>
<author>
<name>Rodney Gomes</name>
<email></email>
</author>
<description>
This test will simple query the various queries that are stored in the
${yql.queries} property and make sure that YQL is capable of responding
with some data. This does not of course validate the data or do any
additional work and is simply part of a wiki example of how to use DTF
for testing a service like YQL.
</description>
</info>

<local>
<createstorage id="INPUT" path="${dtf.xml.path}/input"/>
<createstorage id="OUTPUT" path="${dtf.xml.path}/output"/>

<loadproperties uri="storage://INPUT/yql.properties"/>
</local>

<function name="yql">
<param name="q" type="required"/>

<urlencode result="q" source="${q}"/>
<http_get uri="${yql.url}?q=${q}"/>
<return>${http.get.body}</return>
</function>

<for property="query" range="${yql.queries}">
<log>querying [${query}]</log>
<call function="yql" result="result">
<property name="q" value="${query}"/>
</call>
</for>

</script>

0 comments on commit baf65e4

Please sign in to comment.