-
Notifications
You must be signed in to change notification settings - Fork 2
Building the project from the source code
The project consists of three main parts: the fixes for different entity mapping method and Hibernate versions, their testing modules and the utility classes for JPA.
DbAssistBuilder (root)
DbAssist-4.2.21 |
DbAssist-4.3.11 |
... |
DbAssist-5.2.2 } fixes
DbAssist-hbm-3.3.2 |
DbAssist-hbm-3.6.10 |
DbAssist-test-commons |
DbAssist-hbm-tester } testing modules
DbAssist-jpa-tester |
DbAssist-jpa-commons | utility classes ConditionsBuilder, AbstractRepository etc.
The project DbAssist-test-commons contains the shared code between two tests projects (annotations and .hbm testers) and also uses Liquibase plugin to automatically setup the SQL test database with proper tables and fields, so that the unit tests can be run.
The unit tests in DbAssist project use the external DB to test its functionality. Therefore you have to set it up before running them.
Also make sure the user assigned to this database has read/write access.
Most JDBC drivers can be installed by simply adding an appropriate dependency into a pom file of DbAssist-test-commons project.
The exception is Microsoft JDBC driver which has to be installed manually. You can download it from the following link:
https://www.microsoft.com/en-us/download/details.aspx?id=11774
Change the pom file in DbAssist-test-commons to use the correct JDBC driver corresponding to your installed DB.
Then update the following files with the current DB credentials, driver and url settings:
-
DbAssist-test-commons\src\main\resources\liquibase.properties(for creating schemas and tables) -
DbAssist-hbm-tester\src\main\resources\hibernate.cfg.xml(for HBM test cases) -
DbAssist-jpa-tester\src\test\resources\config\application.properties(for Spring settings in JPA testers)
The current configuration is set up to work with Microsoft SQL Server.
Add mvn to the PATH environmental variable and run mvn -v from command line in order to verify it is set up correctly.
In order to build the whole project and run the tests for all the supported Hibernate versions and both entity mapping methods, use the command
mvn install
in the root DbAssistBuilder project.
It will first build the projects for all the fixes, then build the projects for testing and their dependencies, and finally it will run the tests for each Hibernate and fix version separately.
We are using a Groovy script and Maven custom plugin to perform these steps correctly and in a proper order.
In order to add a new fix version to a test suite, you need to go to a correct tester project and edit the .pom file so that you specify it in a list of <projectNames>, which is read by the MavenTestAll plugin.
The testing of a single version of the fix can be achieved by temporarily overriding for example DbAssist-jpa-tester .pom file (for JPA case) and changing the following line to refer to a version that we want to test.
<montrosesoftware.version>DbAssist-5.2.2</montrosesoftware.version>