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());
}
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());
}
use of org.hibernate.tool.hbm2x.HibernateConfigurationExporter in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Exception {
exporterTarget = new HibernateConfigurationExporter();
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporterTarget) {
};
Properties properties = new Properties();
Configuration configurationTarget = new Configuration();
configurationTarget.setProperties(properties);
assertNotSame(properties, exporterTarget.getProperties());
assertNotSame(configurationTarget, exporterTarget.getConfiguration());
IConfiguration configurationFacade = new AbstractConfigurationFacade(FACADE_FACTORY, configurationTarget) {
};
exporterFacade.setConfiguration(configurationFacade);
assertSame(properties, exporterTarget.getProperties());
assertSame(configurationTarget, exporterTarget.getConfiguration());
}
use of org.hibernate.tool.hbm2x.HibernateConfigurationExporter in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() throws Exception {
IExporter exporter = service.createExporter(POJOExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof POJOExporter);
exporter = service.createExporter(HibernateConfigurationExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof HibernateConfigurationExporter);
}
use of org.hibernate.tool.hbm2x.HibernateConfigurationExporter in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Exception {
exporterTarget = new HibernateConfigurationExporter();
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporterTarget) {
};
Properties properties = new Properties();
Configuration configurationTarget = new Configuration();
configurationTarget.setProperties(properties);
assertNotSame(properties, exporterTarget.getProperties());
assertNotSame(configurationTarget, exporterTarget.getConfiguration());
ConfigurationFacadeImpl configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configurationTarget);
exporterFacade.setConfiguration(configurationFacade);
assertSame(properties, exporterTarget.getProperties());
assertSame(configurationTarget, exporterTarget.getConfiguration());
}
Aggregations