Search in sources :

Example 11 with IDatabaseCollector

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);
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Example 12 with IDatabaseCollector

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();
    ServiceRegistry sr = new ServiceRegistryBuilder().buildServiceRegistry();
    IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(cfg.getProperties(), cfg.buildSettings(sr), new DefaultReverseEngineeringStrategy(), sr));
    IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
    Assert.assertNotNull(databaseCollectorFacade);
    DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
    Assert.assertNotNull(databaseCollector);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ServiceRegistry(org.hibernate.service.ServiceRegistry) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) ServiceRegistryBuilder(org.hibernate.service.ServiceRegistryBuilder) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Example 13 with IDatabaseCollector

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);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Example 14 with IDatabaseCollector

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());
}
Also used : PersistentClass(org.hibernate.mapping.PersistentClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Example 15 with IDatabaseCollector

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);
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Aggregations

IDatabaseCollector (org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector)18 DatabaseCollector (org.hibernate.cfg.reveng.DatabaseCollector)16 Test (org.junit.Test)16 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)9 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)9 Configuration (org.hibernate.cfg.Configuration)8 DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)8 PersistentClass (org.hibernate.mapping.PersistentClass)8 RootClass (org.hibernate.mapping.RootClass)8 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)8 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)8 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)8 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)5 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)3 HibernateException (org.jboss.tools.hibernate.runtime.spi.HibernateException)2 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 HashMap (java.util.HashMap)1 List (java.util.List)1