Search in sources :

Example 11 with IHibernateMappingExporter

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

the class FacadeFactoryTest method testCreateHibernateMappingExporter.

@Test
public void testCreateHibernateMappingExporter() {
    HibernateMappingExporter hibernateMappingExporter = new HibernateMappingExporter();
    IHibernateMappingExporter facade = facadeFactory.createHibernateMappingExporter(hibernateMappingExporter);
    Assert.assertSame(hibernateMappingExporter, ((IFacade) facade).getTarget());
}
Also used : HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) Test(org.junit.Test)

Example 12 with IHibernateMappingExporter

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

the class FacadeFactoryTest method testCreateHibernateMappingExporter.

@Test
public void testCreateHibernateMappingExporter() {
    HibernateMappingExporter hibernateMappingExporter = new HibernateMappingExporter();
    IHibernateMappingExporter facade = facadeFactory.createHibernateMappingExporter(hibernateMappingExporter);
    Assert.assertSame(hibernateMappingExporter, ((IFacade) facade).getTarget());
}
Also used : HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) Test(org.junit.Test)

Example 13 with IHibernateMappingExporter

use of org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter 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);
    Configuration cfg = (Configuration) ((IFacade) configuration).getTarget();
    HibernateMappingExporterExtension hmee = (HibernateMappingExporterExtension) ((IFacade) hibernateMappingExporter).getTarget();
    Assert.assertSame(file, hmee.getOutputDirectory());
    Assert.assertSame(cfg, hmee.getConfiguration());
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) 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 14 with IHibernateMappingExporter

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

the class FacadeFactoryTest method testCreateHibernateMappingExporter.

@Test
public void testCreateHibernateMappingExporter() {
    HibernateMappingExporter hibernateMappingExporter = new HibernateMappingExporter();
    IHibernateMappingExporter facade = facadeFactory.createHibernateMappingExporter(hibernateMappingExporter);
    Assert.assertSame(hibernateMappingExporter, ((IFacade) facade).getTarget());
}
Also used : HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) Test(org.junit.Test)

Example 15 with IHibernateMappingExporter

use of org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter 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);
    Configuration cfg = (Configuration) ((IFacade) configuration).getTarget();
    HibernateMappingExporterExtension hmee = (HibernateMappingExporterExtension) ((IFacade) hibernateMappingExporter).getTarget();
    Assert.assertSame(file, hmee.getOutputDirectory());
    Assert.assertSame(cfg, hmee.getConfiguration());
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) File(java.io.File) Test(org.junit.Test)

Aggregations

IHibernateMappingExporter (org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter)15 Test (org.junit.Test)12 HibernateMappingExporter (org.hibernate.tool.hbm2x.HibernateMappingExporter)8 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)7 File (java.io.File)6 IFile (org.eclipse.core.resources.IFile)3 CoreException (org.eclipse.core.runtime.CoreException)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 JavaModelException (org.eclipse.jdt.core.JavaModelException)3 Configuration (org.hibernate.cfg.Configuration)3 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)3 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)3 IArtifactCollector (org.jboss.tools.hibernate.runtime.spi.IArtifactCollector)3 FileNotFoundException (java.io.FileNotFoundException)2 IPath (org.eclipse.core.runtime.IPath)2 Path (org.eclipse.core.runtime.Path)2 IPackageFragment (org.eclipse.jdt.core.IPackageFragment)2 PartInitException (org.eclipse.ui.PartInitException)2 IService (org.jboss.tools.hibernate.runtime.spi.IService)2