Search in sources :

Example 16 with IExportPOJODelegate

use of org.jboss.tools.hibernate.runtime.spi.IExportPOJODelegate in project jbosstools-hibernate by jbosstools.

the class HibernateMappingExporterFacadeTest method testSetExportPOJODelegate.

@Test
public void testSetExportPOJODelegate() throws Exception {
    IExportPOJODelegate delegate = new IExportPOJODelegate() {

        @Override
        public void exportPOJO(Map<Object, Object> map, IPOJOClass pojoClass) {
        }
    };
    Field delegateField = HibernateMappingExporterExtension.class.getDeclaredField("delegateExporter");
    delegateField.setAccessible(true);
    Assert.assertNull(delegateField.get(hibernateMappingExporter));
    hibernateMappingExporterFacade.setExportPOJODelegate(delegate);
    Assert.assertSame(delegate, delegateField.get(hibernateMappingExporter));
}
Also used : Field(java.lang.reflect.Field) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) IExportPOJODelegate(org.jboss.tools.hibernate.runtime.spi.IExportPOJODelegate) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.Test)

Aggregations

Field (java.lang.reflect.Field)16 HashMap (java.util.HashMap)16 Map (java.util.Map)16 IExportPOJODelegate (org.jboss.tools.hibernate.runtime.spi.IExportPOJODelegate)16 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)16 Test (org.junit.Test)16 File (java.io.File)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)8 RootClass (org.hibernate.mapping.RootClass)7 Table (org.hibernate.mapping.Table)7 Configuration (org.hibernate.cfg.Configuration)4 Mappings (org.hibernate.cfg.Mappings)4 PojoMetaDataConfiguration (org.hibernate.cfg.PojoMetaDataConfiguration)3 Column (org.hibernate.mapping.Column)3 SimpleValue (org.hibernate.mapping.SimpleValue)3 MetadataDescriptor (org.hibernate.tool.api.metadata.MetadataDescriptor)1