Search in sources :

Example 11 with DelegatingReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy 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 12 with DelegatingReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy 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

DelegatingReverseEngineeringStrategy (org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy)12 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)12 Test (org.junit.Test)12 Field (java.lang.reflect.Field)8 DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)8 ReverseEngineeringStrategy (org.hibernate.cfg.reveng.ReverseEngineeringStrategy)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)4