-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
Conceptually JFixtures is a translator - it translates(or compiles) fixtures(yaml) files into a SQL file. Roughly it has fixtures folder as input, SQL file as output and a few options, like, which SQL dialect to take to translate to. There are two ways in using JFixtures: as a java library and as a command line tool.
Include it from to your project and all is set.
com.github.vkorobkov.jfixtures.JFixtures
class is an entry point of JFixtures API:
import com.github.vkorobkov.jfixtures.JFixtures;
JFixtures.sql99("/home/user/fixtures-folder").toFile("home/user/test-data.sql");
This example compiles fixtures from /home/user/fixtures-folder
to home/user/test-data.sql
using SQL-99
dialect.
More examples are below:
import com.github.vkorobkov.jfixtures.JFixtures;
String testSql = JFixtures.sql99("/home/user/fixtures-folder").asString();
import com.github.vkorobkov.jfixtures.JFixtures;
JFixtures.mysql("/home/user/fixtures-folder").toFile("home/user/test-data.sql");
import com.github.vkorobkov.jfixtures.JFixtures;
JFixtures.microsoftSql("/home/user/fixtures-folder").toFile("home/user/test-data.sql");
There is also JFixtures.xml
method which allows to save the result into either XML file or just into a string with XML content.
https://github.com/rodionovsasha/CommentService
JFixtures is also distributed as a self packaged runnable jar which could be used as command line utility. This is a separate project, please, check it out on GitHub
Table of contents