use of org.hibernate.tool.hbm2ddl.SchemaExport in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSchemaExport.
@Test
public void testCreateSchemaExport() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
SchemaExport schemaExport = new SchemaExport(configuration);
ISchemaExport facade = facadeFactory.createSchemaExport(schemaExport);
Assert.assertSame(schemaExport, ((IFacade) facade).getTarget());
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSchemaExport.
@Test
public void testCreateSchemaExport() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
SchemaExport schemaExport = new SchemaExport();
ISchemaExport facade = facadeFactory.createSchemaExport(schemaExport);
Assert.assertTrue(facade instanceof SchemaExportFacadeImpl);
Assert.assertSame(schemaExport, ((IFacade) facade).getTarget());
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project jbosstools-hibernate by jbosstools.
the class SchemaExportFacadeTest method testGetExceptions.
@SuppressWarnings("unchecked")
@Test
public void testGetExceptions() throws Throwable {
SchemaExport schemaExport = new SchemaExport();
ISchemaExport schemaExportFacade = new SchemaExportFacadeImpl(FACADE_FACTORY, schemaExport);
Assert.assertTrue(schemaExportFacade.getExceptions().isEmpty());
schemaExport.getExceptions().add(new HibernateException("blah"));
Assert.assertFalse(schemaExportFacade.getExceptions().isEmpty());
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project jbosstools-hibernate by jbosstools.
the class SchemaExportFacadeTest method testCreate.
@Test
public void testCreate() throws Exception {
String urlString = "jdbc:h2:mem:create_test";
Connection connection = DriverManager.getConnection(urlString);
configuration.setProperty(Environment.URL, urlString);
IConfiguration configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
SchemaExport schemaExport = new SchemaExport();
SchemaExportFacadeImpl schemaExportFacade = new SchemaExportFacadeImpl(FACADE_FACTORY, schemaExport);
schemaExportFacade.setConfiguration(configurationFacade);
Assert.assertFalse(connection.getMetaData().getTables(null, null, "FOO", null).next());
schemaExportFacade.create();
Assert.assertTrue(connection.getMetaData().getTables(null, null, "FOO", null).next());
}
use of org.hibernate.tool.hbm2ddl.SchemaExport in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSchemaExport.
@Test
public void testCreateSchemaExport() {
SchemaExport schemaExport = new SchemaExport();
ISchemaExport facade = facadeFactory.createSchemaExport(schemaExport);
Assert.assertTrue(facade instanceof SchemaExportFacadeImpl);
Assert.assertSame(schemaExport, ((IFacade) facade).getTarget());
}
Aggregations