use of org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateDatabaseCollector.
@Test
public void testCreateDatabaseCollector() {
DatabaseCollector databaseCollector = (DatabaseCollector) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { DatabaseCollector.class }, new TestInvocationHandler());
IDatabaseCollector facade = facadeFactory.createDatabaseCollector(databaseCollector);
Assert.assertSame(databaseCollector, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDatabaseCollector.
@Test
public void testNewDatabaseCollector() {
IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(new Configuration().getProperties(), new DefaultReverseEngineeringStrategy(), new StandardServiceRegistryBuilder().build()));
IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
Assert.assertNotNull(databaseCollectorFacade);
DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
Assert.assertNotNull(databaseCollector);
}
use of org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateDatabaseCollector.
@Test
public void testCreateDatabaseCollector() {
DatabaseCollector databaseCollector = (DatabaseCollector) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { DatabaseCollector.class }, new TestInvocationHandler());
IDatabaseCollector facade = facadeFactory.createDatabaseCollector(databaseCollector);
Assert.assertSame(databaseCollector, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector in project jbosstools-hibernate by jbosstools.
the class LazyDatabaseSchemaWorkbenchAdapter method readDatabaseSchema.
protected IDatabaseCollector readDatabaseSchema(final IProgressMonitor monitor, final ConsoleConfiguration consoleConfiguration, final IReverseEngineeringStrategy strategy) {
final IConfiguration configuration = consoleConfiguration.buildWith(null, false);
return (IDatabaseCollector) consoleConfiguration.execute(new ExecutionContext.Command() {
public Object execute() {
IDatabaseCollector db = null;
try {
IService service = consoleConfiguration.getHibernateExtension().getHibernateService();
IJDBCReader reader = service.newJDBCReader(configuration, strategy);
db = service.newDatabaseCollector(reader);
reader.readDatabaseSchema(db, new ProgressListener(monitor));
} catch (UnsupportedOperationException he) {
throw new HibernateException(he);
} catch (Exception he) {
he.printStackTrace();
throw new HibernateException(he.getMessage(), he.getCause());
}
return db;
}
});
}
use of org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDatabaseCollector.
@Test
public void testNewDatabaseCollector() {
Configuration cfg = new Configuration();
IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(cfg.getProperties(), cfg.buildSettings(), new DefaultReverseEngineeringStrategy()));
IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
Assert.assertNotNull(databaseCollectorFacade);
DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
Assert.assertNotNull(databaseCollector);
}
Aggregations