use of org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.
@Test
public void testGetReverseEngineeringStrategy() throws Exception {
ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
delegateField.setAccessible(true);
Assert.assertSame(res, delegateField.get(resultTarget));
}
use of org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.
@Test
public void testGetReverseEngineeringStrategy() throws Exception {
ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
delegateField.setAccessible(true);
Assert.assertSame(res, delegateField.get(resultTarget));
}
use of org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.
@Test
public void testGetReverseEngineeringStrategy() throws Exception {
ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
delegateField.setAccessible(true);
Assert.assertSame(res, delegateField.get(resultTarget));
}
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);
}
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);
}
Aggregations