use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy 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.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class ReverseEngineeringStrategyFacadeTest method testSetSettings.
@Test
public void testSetSettings() throws Exception {
RevengStrategy revengStrategyTarget = new DefaultStrategy();
RevengSettings revengSettingsTarget = new RevengSettings(revengStrategyTarget);
IReverseEngineeringSettings revengSettingsFacade = FACADE_FACTORY.createReverseEngineeringSettings(revengSettingsTarget);
IReverseEngineeringStrategy revengStrategyFacade = new ReverseEngineeringStrategyFacadeImpl(FACADE_FACTORY, revengStrategyTarget);
Field field = AbstractStrategy.class.getDeclaredField("settings");
field.setAccessible(true);
assertNotSame(field.get(revengStrategyTarget), revengSettingsTarget);
revengStrategyFacade.setSettings(revengSettingsFacade);
assertSame(field.get(revengStrategyTarget), revengSettingsTarget);
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy 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);
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDefaultReverseEngineeringStrategy.
@Test
public void testNewDefaultReverseEngineeringStrategy() throws Exception {
IReverseEngineeringStrategy reverseEngineeringStrategy = service.newDefaultReverseEngineeringStrategy();
assertNotNull(reverseEngineeringStrategy);
Object target = ((IFacade) reverseEngineeringStrategy).getTarget();
assertNotNull(target);
assertTrue(target instanceof DefaultStrategy);
}
use of org.hibernate.tool.internal.reveng.strategy.DefaultStrategy in project jbosstools-hibernate by jbosstools.
the class ReverseEngineeringSettingsFacadeTest method beforeEach.
@BeforeEach
public void beforeEach() {
revengSettingsTarget = new RevengSettings(new DefaultStrategy());
revengSettingsFacade = new AbstractReverseEngineeringSettingsFacade(FACADE_FACTORY, revengSettingsTarget) {
};
}
Aggregations