Search in sources :

Example 41 with IReverseEngineeringStrategy

use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy 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);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Example 42 with IReverseEngineeringStrategy

use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewReverseEngineeringStrategy.

@Test
public void testNewReverseEngineeringStrategy() throws Exception {
    String defaultRevEngStratClassName = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy";
    IReverseEngineeringStrategy defaultStrategy = service.newDefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy newStrategy = service.newReverseEngineeringStrategy(defaultRevEngStratClassName, defaultStrategy);
    Assert.assertNotNull(newStrategy);
    Object target = ((IFacade) newStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertFalse(target instanceof DelegatingReverseEngineeringStrategy);
    newStrategy = service.newReverseEngineeringStrategy("org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy", defaultStrategy);
    Assert.assertNotNull(newStrategy);
    target = ((IFacade) newStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DelegatingReverseEngineeringStrategy);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 43 with IReverseEngineeringStrategy

use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewReverseEngineeringSettings.

@Test
public void testNewReverseEngineeringSettings() {
    IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
    IReverseEngineeringSettings reverseEngineeringSettings = service.newReverseEngineeringSettings(strategy);
    Assert.assertNotNull(reverseEngineeringSettings);
    Object target = ((IFacade) reverseEngineeringSettings).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof ReverseEngineeringSettings);
}
Also used : IReverseEngineeringSettings(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings) ReverseEngineeringSettings(org.hibernate.cfg.reveng.ReverseEngineeringSettings) IReverseEngineeringSettings(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 44 with IReverseEngineeringStrategy

use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewDefaultReverseEngineeringStrategy.

@Test
public void testNewDefaultReverseEngineeringStrategy() throws Exception {
    IReverseEngineeringStrategy reverseEngineeringStrategy = service.newDefaultReverseEngineeringStrategy();
    Assert.assertNotNull(reverseEngineeringStrategy);
    Object target = ((IFacade) reverseEngineeringStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof ReverseEngineeringStrategy);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 45 with IReverseEngineeringStrategy

use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewReverseEngineeringStrategy.

@Test
public void testNewReverseEngineeringStrategy() throws Exception {
    String defaultRevEngStratClassName = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy";
    IReverseEngineeringStrategy defaultStrategy = service.newDefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy newStrategy = service.newReverseEngineeringStrategy(defaultRevEngStratClassName, defaultStrategy);
    Assert.assertNotNull(newStrategy);
    Object target = ((IFacade) newStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertFalse(target instanceof DelegatingReverseEngineeringStrategy);
    newStrategy = service.newReverseEngineeringStrategy("org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy", defaultStrategy);
    Assert.assertNotNull(newStrategy);
    target = ((IFacade) newStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DelegatingReverseEngineeringStrategy);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Aggregations

IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)50 Test (org.junit.Test)44 DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)36 ReverseEngineeringStrategy (org.hibernate.cfg.reveng.ReverseEngineeringStrategy)32 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)20 DelegatingReverseEngineeringStrategy (org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy)16 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)10 Field (java.lang.reflect.Field)8 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)8 PersistentClass (org.hibernate.mapping.PersistentClass)8 RootClass (org.hibernate.mapping.RootClass)8 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)8 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)8 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)8 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)8 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)7 IReverseEngineeringSettings (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings)6 Configuration (org.hibernate.cfg.Configuration)4 ReverseEngineeringSettings (org.hibernate.cfg.reveng.ReverseEngineeringSettings)4 File (java.io.File)2