use of org.hibernate.tool.internal.reveng.strategy.DelegatingStrategy in project jbosstools-hibernate by jbosstools.
the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.
@Test
public void testGetReverseEngineeringStrategy() throws Exception {
RevengStrategy res = new DefaultStrategy();
IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
DelegatingStrategy resultTarget = (DelegatingStrategy) ((IFacade) result).getTarget();
Field delegateField = DelegatingStrategy.class.getDeclaredField("delegate");
delegateField.setAccessible(true);
assertSame(res, delegateField.get(resultTarget));
}
use of org.hibernate.tool.internal.reveng.strategy.DelegatingStrategy in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewReverseEngineeringStrategy.
@Test
public void testNewReverseEngineeringStrategy() throws Exception {
IReverseEngineeringStrategy defaultStrategy = service.newDefaultReverseEngineeringStrategy();
IReverseEngineeringStrategy newStrategy = service.newReverseEngineeringStrategy(DefaultStrategy.class.getName(), defaultStrategy);
assertNotNull(newStrategy);
Object target = ((IFacade) newStrategy).getTarget();
assertNotNull(target);
assertFalse(target instanceof DelegatingStrategy);
newStrategy = service.newReverseEngineeringStrategy(DelegatingStrategy.class.getName(), defaultStrategy);
assertNotNull(newStrategy);
target = ((IFacade) newStrategy).getTarget();
assertNotNull(target);
assertTrue(target instanceof DelegatingStrategy);
}
Aggregations