Search in sources :

Example 1 with RevengSettings

use of org.hibernate.tool.api.reveng.RevengSettings 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);
}
Also used : Field(java.lang.reflect.Field) RevengSettings(org.hibernate.tool.api.reveng.RevengSettings) IReverseEngineeringSettings(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings) RevengStrategy(org.hibernate.tool.api.reveng.RevengStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultStrategy(org.hibernate.tool.internal.reveng.strategy.DefaultStrategy) Test(org.junit.jupiter.api.Test)

Example 2 with RevengSettings

use of org.hibernate.tool.api.reveng.RevengSettings in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateReverseEngineeringSettings.

@Test
public void testCreateReverseEngineeringSettings() {
    RevengSettings res = new RevengSettings(null);
    IReverseEngineeringSettings facade = facadeFactory.createReverseEngineeringSettings(res);
    assertSame(res, ((IFacade) facade).getTarget());
}
Also used : RevengSettings(org.hibernate.tool.api.reveng.RevengSettings) IReverseEngineeringSettings(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings) Test(org.junit.jupiter.api.Test)

Example 3 with RevengSettings

use of org.hibernate.tool.api.reveng.RevengSettings in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewReverseEngineeringSettings.

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

Example 4 with RevengSettings

use of org.hibernate.tool.api.reveng.RevengSettings 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) {
    };
}
Also used : RevengSettings(org.hibernate.tool.api.reveng.RevengSettings) AbstractReverseEngineeringSettingsFacade(org.jboss.tools.hibernate.runtime.common.AbstractReverseEngineeringSettingsFacade) DefaultStrategy(org.hibernate.tool.internal.reveng.strategy.DefaultStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

RevengSettings (org.hibernate.tool.api.reveng.RevengSettings)4 IReverseEngineeringSettings (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringSettings)3 Test (org.junit.jupiter.api.Test)3 DefaultStrategy (org.hibernate.tool.internal.reveng.strategy.DefaultStrategy)2 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)2 Field (java.lang.reflect.Field)1 RevengStrategy (org.hibernate.tool.api.reveng.RevengStrategy)1 AbstractReverseEngineeringSettingsFacade (org.jboss.tools.hibernate.runtime.common.AbstractReverseEngineeringSettingsFacade)1 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1