use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ColumnFacadeTest method testGetSqlType.
@Test
public void testGetSqlType() {
Assert.assertNull(columnFacade.getSqlType());
column.setSqlType("foobar");
Assert.assertEquals("foobar", columnFacade.getSqlType());
Configuration configuration = new Configuration();
configuration.setProperty(Environment.DIALECT, "org.hibernate.dialect.H2Dialect");
SimpleValue value = new SimpleValue(configuration.createMappings());
value.setTypeName("int");
column.setValue(value);
IConfiguration configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
column.setSqlType(null);
Assert.assertEquals("integer", columnFacade.getSqlType(configurationFacade));
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewAnnotationConfiguration.
@Test
public void testNewAnnotationConfiguration() {
IConfiguration configuration = service.newAnnotationConfiguration();
Assert.assertNotNull(configuration);
Object target = ((IFacade) configuration).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Configuration);
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDefaultConfiguration.
@Test
public void testNewDefaultConfiguration() {
IConfiguration configuration = service.newDefaultConfiguration();
Assert.assertNotNull(configuration);
Object target = ((IFacade) configuration).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Configuration);
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHibernateMappingExporter.
@Test
public void testNewHibernateMappingExporter() {
IConfiguration configuration = service.newDefaultConfiguration();
File file = new File("");
IHibernateMappingExporter hibernateMappingExporter = service.newHibernateMappingExporter(configuration, file);
Configuration cfg = (Configuration) ((IFacade) configuration).getTarget();
HibernateMappingExporterExtension hmee = (HibernateMappingExporterExtension) ((IFacade) hibernateMappingExporter).getTarget();
Assert.assertSame(file, hmee.getOutputDirectory());
Assert.assertSame(cfg, hmee.getConfiguration());
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewJDBCReader.
@Test
public void testNewJDBCReader() {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
Assert.assertNotNull(jdbcReader);
Object target = ((IFacade) jdbcReader).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof JDBCReader);
}
Aggregations