Situation is we are generating a sqlite database as an output.
I want to see if said database equals an expected database file.
So far I have been using sqlite3 to generate dumps and then comparing the files, as suggested in this question: How to compare two sqlite databases on linux.
This works well for our purposes, however I've noticed that I'm using a sqlite3 executable for linux. I am using the following code to create dumps:
// call sqlite3 .dump
Process p = Runtime.getRuntime().exec(executeCommand);
This causes the tests to fail in a Windows environment:
java.io.IOException: Cannot run program "C:\[...]": CreateProcess error=193,
%1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
I think I could simply write a bunch of queries, or include all sqlite3 executables and just check for the OS and hide this behind an interface, but I thought I'd ask first to see if anyone had a simpler solution, or even a different methodology that avoids the problem entirely.