use of org.jboss.tools.hibernate.runtime.spi.IConfiguration 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.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testSetConfiguration.
@Test
public void testSetConfiguration() {
Configuration cfg = new Configuration();
IConfiguration configuration = new AbstractConfigurationFacade(FACADE_FACTORY, cfg) {
};
exporterFacade.setConfiguration(configuration);
Assert.assertEquals("setMetadataDescriptor", methodName);
Object argument = arguments[0];
Assert.assertTrue(argument instanceof ConfigurationMetadataDescriptor);
ConfigurationMetadataDescriptor metadataDescriptor = (ConfigurationMetadataDescriptor) argument;
Assert.assertSame(configuration, metadataDescriptor.getConfiguration());
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLQueryPlan.
@Test
public void testNewHQLQueryPlan() throws Exception {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
File testFile = File.createTempFile("test", "tmp");
testFile.deleteOnExit();
FileWriter fileWriter = new FileWriter(testFile);
fileWriter.write(TEST_HBM_STRING);
fileWriter.close();
configuration.addFile(testFile);
ISessionFactory sfi = configuration.buildSessionFactory();
IHQLQueryPlan queryPlan = service.newHQLQueryPlan("from ServiceImplTest$Foo", true, sfi);
Assert.assertNotNull(queryPlan);
Object target = ((IFacade) queryPlan).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof HQLQueryPlan);
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLCodeAssist.
@Test
public void testNewHQLCodeAssist() {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
IHQLCodeAssist hqlCodeAssist = service.newHQLCodeAssist(configuration);
Assert.assertNotNull(hqlCodeAssist);
}
use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewDefaultConfiguration.
@Test
public void testNewDefaultConfiguration() {
IConfiguration configuration = service.newDefaultConfiguration();
Assert.assertNotNull(configuration);
Object target = ((IFacade) configuration).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Configuration);
}
Aggregations