"class @org.thingpedia.builtin.test\n#_[thingpedia_name=\"Test Device\"]\n#_[thingpedia_description=\"Test Genie in various ways\"]\n#_[name=\"Test Device\"]\n#_[description=\"Test Genie in various ways\"]\n#[system=true]\n#[repository=\"https://github.com/stanford-oval/genie-toolkit\"]\n#[subcategory=\"service\"]\n#[license=\"Apache-2.0\"]\n#[license_gplcompatible=true]\n{\n  import loader from @org.thingpedia.builtin();\n  import config from @org.thingpedia.config.builtin();\n\n  monitorable list query get_data(in req size: Measure(byte) #_[prompt=\"How much fake data do you want?\"],\n                                  in opt count: Number,\n                                  out data: String)\n  #_[result={\n    top=[\"the answer is ${data}\"],\n    list_concat=[\"${__index:ordinal: =1{first answer for ${count} items of size ${size} is ${data}.} one{${__index}st answer is ${data}.} two{${__index}nd answer is ${data}.} few{${__index}rd answer is ${data}.} other{${__index}rd answer is ${data}.}}\"],\n  }]\n  #_[canonical=\"get data on test\"]\n  #[poll_interval=0ms]\n  #[doc=\"generate `size` amount of fake data\"]\n  #[confirm=false];\n\n  list query get_data2(in req size: Measure(byte) #_[prompt=\"How much fake data do you want?\"],\n                       in opt count: Number,\n                       out data: String)\n  #_[result={\n    top=[\"the answer is ${data}\"],\n    list=[\"the answers for ${count} items of size ${size} are ${data}\"],\n  }]\n  #_[canonical=\"second test data\"]\n  #[doc=\"generate `size` amount of fake data\"]\n  #[confirm=false];\n\n  query next_sequence(out number: Number)\n  #_[result=\"the answer is ${number}\"]\n  #_[canonical=\"get sequence number on test\"]\n  #_[confirmation=\"return the next test number\"]\n  #_[formatted=[{type=\"text\",text=\"${number}\"}]]\n  #[doc=\"return the next number in a global sequence; used to test that the queries are invoked the correct number of times; this query is an abuse (it has side effects!), don't copy it in your own devices\"]\n  #[confirm=false];\n\n  query dup_data(in req data_in: String #_[prompt=\"What data do you want to duplicate?\"],\n                 out data_out: String)\n  #_[result=\"the answer is ${data_out}\"]\n  #_[canonical=\"duplicate data on test\"]\n  #_[confirmation=\"duplicate ${data_in} data\"]\n  #_[formatted=[{type=\"text\",text=\"${data_out}\"}]]\n  #[doc=\"duplicate the data (concatenate two copies); this is a simple deterministic get that depends on the input and is used to test param passing into a get\"]\n  #[confirm=false];\n\n  action eat_data(in req data: String #_[prompt=\"What do you want me to consume?\"])\n  #_[canonical=\"eat data on test\"]\n  #_[confirmation=\"consume $data\"]\n  #[doc=\"consume some data, do nothing\"]\n  #[confirm=true];\n}\n"
