Runs a query. @param query query string @return result @throws QueryException query exception @throws IOException I/O exception
(final String query)
| 249 | * @throws IOException I/O exception |
| 250 | */ |
| 251 | protected static String eval(final String query) throws QueryException, IOException { |
| 252 | final ArrayOutput ao = new ArrayOutput(); |
| 253 | try(QueryProcessor qp = new QueryProcessor(query, BASEURI, context, null)) { |
| 254 | qp.compile(); |
| 255 | qp.register(context); |
| 256 | try(Serializer ser = qp.serializer(ao)) { |
| 257 | qp.value().serialize(ser); |
| 258 | } finally { |
| 259 | qp.close(); |
| 260 | qp.unregister(context); |
| 261 | } |
| 262 | } |
| 263 | return ao.toString(); |
| 264 | } |
| 265 | |
| 266 | /** |
| 267 | * Checks the query plan and the result. |
no test coverage detected