simter / simter-kv

Simple Application Key-Value Pair Manager
3 stars 0 forks source link

Add embedded derby for unit test #4

Closed rj-hwang closed 5 years ago

rj-hwang commented 5 years ago

Add embedded-derby profile support by commit-8afcde3. Use bellow command on simter-kv-data-jpa module to run unit test on derby database:

mvn clean test -P embedded-derby

Notes:

  1. derby not support drop table if exists st_kv, need drop table "st_kv".
  2. derby not support add comment to table or column.
  3. Need to set spring.datasource.jpa.properties.hibernate.globally_quoted_identifiers=true to make hibernate to auto quote all table and column name to avoid reserved word problem.
  4. Need to set spring.datasource.continue-on-error=true to avoid the execute error of schema-drop.sql that stop the unti test.

Reference:

  1. Global escaping using the Hibernate globally_quoted_identifiers property
  2. Derby SQL reserved words