HHH-8505: boolean added to test

This commit is contained in:
zuchos 2013-09-30 10:01:26 +02:00 committed by adamw
parent 7dd862eeb5
commit 0aefe3a55b
2 changed files with 9 additions and 1 deletions

View File

@ -78,6 +78,7 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
entity.getCustomFields().put("prop1", 13);
entity.getCustomFields().put("prop2", 0.1f);
entity.getCustomFields().put("prop3", simpleEntity);
entity.getCustomFields().put("prop4", true);
session.save(entity);
session.getTransaction().commit();
@ -94,6 +95,7 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
session.getTransaction().begin();
entity = (AuditedDynamicComponentEntity) session.get(AuditedDynamicComponentEntity.class, entity.getId());
entity.getCustomFields().put("prop1", 2);
entity.getCustomFields().put("prop4", false);
session.update(entity);
session.getTransaction().commit();
@ -135,6 +137,7 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
entity.getCustomFields().put("prop1", 13);
entity.getCustomFields().put("prop2", 0.1f);
entity.getCustomFields().put("prop3", new SimpleEntity(1L, "Very simple entity"));
entity.getCustomFields().put("prop4", true);
AuditedDynamicComponentEntity ver2 = getAuditReader().find(
AuditedDynamicComponentEntity.class,
entity.getId(),
@ -154,6 +157,7 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
// Revision 4
entity.getCustomFields().put("prop1", 2);
entity.getCustomFields().put("prop4", false);
AuditedDynamicComponentEntity ver4 = getAuditReader().find(
AuditedDynamicComponentEntity.class,
entity.getId(),
@ -174,6 +178,7 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
entity.getCustomFields().put("prop1",null);
entity.getCustomFields().put("prop2",null);
entity.getCustomFields().put("prop3",null);
entity.getCustomFields().put("prop4",null);
AuditedDynamicComponentEntity ver6 = getAuditReader().find(
AuditedDynamicComponentEntity.class,
entity.getId(),
@ -183,12 +188,14 @@ public class AuditedDynamicComponentTest extends BaseEnversFunctionalTestCase {
}
//@Test
@Test
public void testOfQueryOnDynamicComponent() {
//given (and result of initData()
AuditedDynamicComponentEntity entity = new AuditedDynamicComponentEntity(1L, "static field value");
entity.getCustomFields().put("prop1", 13);
entity.getCustomFields().put("prop2", 0.1f);
entity.getCustomFields().put("prop3", new SimpleEntity(1L,"Very simple entity"));
entity.getCustomFields().put("prop4", true);
//when
List ver1 = getAuditReader().createQuery()

View File

@ -9,6 +9,7 @@
<dynamic-component name="customFields">
<property name="prop1" type="integer"/>
<property name="prop2" type="float"/>
<property name="prop4" type="boolean"/>
<many-to-one name="prop3" class="org.hibernate.envers.test.integration.components.dynamic.SimpleEntity" column="SIMPLE_ID"/>
</dynamic-component>
</class>