Search in sources :

Example 61 with IConfiguration

use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateConfiguration.

@Test
public void testCreateConfiguration() {
    Configuration configuration = new Configuration();
    IConfiguration facade = facadeFactory.createConfiguration(configuration);
    Assert.assertSame(configuration, ((IFacade) facade).getTarget());
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Test(org.junit.Test)

Example 62 with IConfiguration

use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewSchemaExport.

@Test
public void testNewSchemaExport() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    ISchemaExport schemaExport = service.newSchemaExport(configuration);
    Assert.assertNotNull(schemaExport);
}
Also used : ISchemaExport(org.jboss.tools.hibernate.runtime.spi.ISchemaExport) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Test(org.junit.Test)

Example 63 with IConfiguration

use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewHibernateMappingExporter.

@Test
public void testNewHibernateMappingExporter() {
    IConfiguration configuration = service.newDefaultConfiguration();
    File file = new File("");
    IHibernateMappingExporter hibernateMappingExporter = service.newHibernateMappingExporter(configuration, file);
    HibernateMappingExporterExtension hmee = (HibernateMappingExporterExtension) ((IFacade) hibernateMappingExporter).getTarget();
    Assert.assertSame(file, hmee.getOutputDirectory());
    Assert.assertSame(((ConfigurationFacadeImpl) configuration).getMetadata(), hmee.getMetadata());
}
Also used : IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) File(java.io.File) Test(org.junit.Test)

Example 64 with IConfiguration

use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewJpaConfiguration.

@Test
public void testNewJpaConfiguration() {
    IConfiguration configuration = service.newJpaConfiguration(null, "test", null);
    Assert.assertNotNull(configuration);
    Object target = ((IFacade) configuration).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Configuration);
}
Also used : JdbcMetadataConfiguration(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration) Configuration(org.hibernate.cfg.Configuration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 65 with IConfiguration

use of org.jboss.tools.hibernate.runtime.spi.IConfiguration in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewJDBCMetaDataConfiguration.

@Test
public void testNewJDBCMetaDataConfiguration() {
    IConfiguration configuration = service.newJDBCMetaDataConfiguration();
    Assert.assertNotNull(configuration);
    Object target = ((IFacade) configuration).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof JdbcMetadataConfiguration);
}
Also used : JdbcMetadataConfiguration(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Aggregations

IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)137 Test (org.junit.Test)72 Configuration (org.hibernate.cfg.Configuration)65 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)29 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)25 File (java.io.File)19 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)17 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)16 Properties (java.util.Properties)13 CoreException (org.eclipse.core.runtime.CoreException)10 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)10 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)9 FileWriter (java.io.FileWriter)8 IOException (java.io.IOException)8 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)8 SimpleValue (org.hibernate.mapping.SimpleValue)8 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)8 JavaModelException (org.eclipse.jdt.core.JavaModelException)7 PartInitException (org.eclipse.ui.PartInitException)7 Ejb3Configuration (org.hibernate.ejb.Ejb3Configuration)7