Search in sources :

Example 41 with HibernateConfigurationExporter

use of org.hibernate.tool.hbm2x.HibernateConfigurationExporter in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeTest method testSetCustomProperties.

@Test
public void testSetCustomProperties() {
    Properties properties = new Properties();
    exporterFacade.setCustomProperties(properties);
    assertNotSame(properties, ((TestExporter) exporterTarget).getProperties());
    exporterTarget = new HibernateConfigurationExporter();
    exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporterTarget) {
    };
    assertNotSame(properties, ((HibernateConfigurationExporter) exporterTarget).getCustomProperties());
    exporterFacade.setCustomProperties(properties);
    assertSame(properties, ((HibernateConfigurationExporter) exporterTarget).getCustomProperties());
}
Also used : HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) Properties(java.util.Properties) AbstractExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade) Test(org.junit.jupiter.api.Test)

Example 42 with HibernateConfigurationExporter

use of org.hibernate.tool.hbm2x.HibernateConfigurationExporter in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeTest method testSetOutput.

@Test
public void testSetOutput() {
    StringWriter stringWriter = new StringWriter();
    exporterFacade.setOutput(stringWriter);
    assertNotSame(stringWriter, ((TestExporter) exporterTarget).writer);
    exporterTarget = new HibernateConfigurationExporter();
    exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporterTarget) {
    };
    assertNotSame(stringWriter, ((HibernateConfigurationExporter) exporterTarget).getOutput());
    exporterFacade.setOutput(stringWriter);
    assertSame(stringWriter, ((HibernateConfigurationExporter) exporterTarget).getOutput());
}
Also used : StringWriter(java.io.StringWriter) HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) AbstractExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade) Test(org.junit.jupiter.api.Test)

Aggregations

HibernateConfigurationExporter (org.hibernate.tool.hbm2x.HibernateConfigurationExporter)42 Test (org.junit.jupiter.api.Test)40 Properties (java.util.Properties)21 AbstractExporterFacade (org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade)18 IExporter (org.jboss.tools.hibernate.runtime.spi.IExporter)12 StringWriter (java.io.StringWriter)11 Configuration (org.hibernate.cfg.Configuration)10 POJOExporter (org.hibernate.tool.hbm2x.POJOExporter)10 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)10 Field (java.lang.reflect.Field)8 MetadataDescriptor (org.hibernate.tool.api.metadata.MetadataDescriptor)4 Exporter (org.hibernate.tool.hbm2x.Exporter)2 GenericExporter (org.hibernate.tool.hbm2x.GenericExporter)2 Hbm2DDLExporter (org.hibernate.tool.hbm2x.Hbm2DDLExporter)2 QueryExporter (org.hibernate.tool.hbm2x.QueryExporter)2 IGenericExporter (org.jboss.tools.hibernate.runtime.spi.IGenericExporter)2 IHbm2DDLExporter (org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter)2 IQueryExporter (org.jboss.tools.hibernate.runtime.spi.IQueryExporter)2 Test (org.junit.Test)2 AbstractConfigurationFacade (org.jboss.tools.hibernate.runtime.common.AbstractConfigurationFacade)1