force cleaning of the table to have re-runnable tests

This commit is contained in:
Mark Struberg 2019-01-15 09:24:19 +01:00
parent 40d19ebc6c
commit 03ebe4fdd0
2 changed files with 8 additions and 2 deletions

View File

@ -29,13 +29,18 @@ import javax.validation.ConstraintViolationException;
import org.apache.openjpa.example.gallery.model.Image;
import org.apache.openjpa.example.gallery.model.Location;
import org.junit.Test;
import static org.junit.Assert.fail;
public class TestJPAValidation {
public class TestJPAValidation extends junit.framework.TestCase {
/**
* Shows usage of BV constraints with JPA at pre-update, pre-remove,
* and pre-persist lifecycle events.
*/
@Test
public void testValidation() {
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("BeanValidation");

View File

@ -43,7 +43,8 @@
<property name="openjpa.ConnectionURL"
value="jdbc:derby:target/database/ImageDB;create=true" />
-->
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
<!-- we synchronise the table schema and delete their table contents for repeatable tests -->
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true,SchemaAction='add,deleteTableContents')"/>
<property name="openjpa.DynamicEnhancementAgent" value="false"/>
<property name="javax.persistence.validation.group.pre-persist"