Search in sources :

Example 36 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());
    Assert.assertSame(ConfigurationFacadeImpl.class, facade.getClass());
}
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 37 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 : Configuration(org.hibernate.cfg.Configuration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Test(org.junit.Test)

Example 38 with IConfiguration

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

the class ServiceImplTest method testNewAnnotationConfiguration.

@Test
public void testNewAnnotationConfiguration() {
    IConfiguration configuration = service.newAnnotationConfiguration();
    Assert.assertNotNull(configuration);
    Object target = ((IFacade) configuration).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Configuration);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 39 with IConfiguration

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

the class ColumnFacadeTest method testGetSqlType.

@Test
public void testGetSqlType() {
    Assert.assertNull(columnFacade.getSqlType());
    column.setSqlType("foobar");
    Assert.assertEquals("foobar", columnFacade.getSqlType());
    Configuration configuration = new Configuration();
    configuration.setProperty(Environment.DIALECT, "org.hibernate.dialect.H2Dialect");
    MetadataImplementor metadata = (MetadataImplementor) MetadataHelper.getMetadata(configuration);
    SimpleValue value = new SimpleValue(metadata);
    value.setTypeName("int");
    column.setValue(value);
    IConfiguration configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
    column.setSqlType(null);
    Assert.assertEquals("integer", columnFacade.getSqlType(configurationFacade));
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) MetadataImplementor(org.hibernate.boot.spi.MetadataImplementor) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 40 with IConfiguration

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 = FACADE_FACTORY.createConfiguration(new Configuration());
    IReverseEngineeringStrategy engineeringStrategy = FACADE_FACTORY.createReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
    IJDBCReader jdbcReaderFacade = service.newJDBCReader(configuration, engineeringStrategy);
    Assert.assertNotNull(jdbcReaderFacade);
    JDBCReader reader = (JDBCReader) ((IFacade) jdbcReaderFacade).getTarget();
    Assert.assertNotNull(reader);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) 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