Closed HenryOlson closed 10 years ago
you could invoke sqlline from within a junit test and catch and compare its stdout. (sqlline supports redirection of stdout, I think.)
or, better, create a jdbc connection, run a statement via jdbc, compare the results. CsvTest.checkSql does this. Feel free to copy.
By the way, you may see flakiness due to wikipedia being unavailable. (E.g. if you run the test while on a plane.) The most robust approach would be tests that you can run while offline. Use file: protocol or maybe a mock HTTP server.
Working on that now.
On Mar 1, 2014, at 11:11 AM, Julian Hyde notifications@github.com wrote:
By the way, you may see flakiness due to wikipedia being unavailable. (E.g. if you run the test while on a plane.) The most robust approach would be tests that you can run while offline. Use file: protocol or maybe a mock HTTP server.
— Reply to this email directly or view it on GitHub.
Good idea. I'll take a look at CsvTest.checkSQL.
On Mar 1, 2014, at 11:10 AM, Julian Hyde notifications@github.com wrote:
you could invoke sqlline from within a junit test and catch and compare its stdout. (sqlline supports redirection of stdout, I think.)
or, better, create a jdbc connection, run a statement via jdbc, compare the results. CsvTest.checkSql does this. Feel free to copy.
— Reply to this email directly or view it on GitHub.
I'm in the habit of running ./sqlline -f target/test-classes/webjoin.sql as an end-to-end test. Is there a good way to add this or something better to the Junit tests or as a separate mvn target?