use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDefaultReverseEngineeringStrategy.
@Test
public void testNewDefaultReverseEngineeringStrategy() throws Exception {
IReverseEngineeringStrategy reverseEngineeringStrategy = service.newDefaultReverseEngineeringStrategy();
Assert.assertNotNull(reverseEngineeringStrategy);
Object target = ((IFacade) reverseEngineeringStrategy).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof ReverseEngineeringStrategy);
}
use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewJDBCReader.
@Test
public void testNewJDBCReader() {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
Assert.assertNotNull(jdbcReader);
Object target = ((IFacade) jdbcReader).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof JDBCReader);
}
use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy 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.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateReverseEngineeringStrategy.
@Test
public void testCreateReverseEngineeringStrategy() {
ReverseEngineeringStrategy res = (ReverseEngineeringStrategy) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { ReverseEngineeringStrategy.class }, new TestInvocationHandler());
IReverseEngineeringStrategy facade = facadeFactory.createReverseEngineeringStrategy(res);
Assert.assertSame(res, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy 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));
}
Aggregations